2 * linux/fs/affs/symlink.c
4 * 1995 Hans-Joachim Widmaier - Modified for affs.
6 * Copyright (C) 1991, 1992 Linus Torvalds
8 * affs symlink handling code
13 static int affs_symlink_readpage(struct file *file, struct page *page)
15 struct buffer_head *bh;
16 struct inode *inode = page->mapping->host;
17 char *link = page_address(page);
18 struct slink_front *lf;
23 pr_debug("get_link(ino=%lu)\n", inode->i_ino);
25 bh = affs_bread(inode->i_sb, inode->i_ino);
30 lf = (struct slink_front *)bh->b_data;
33 if (strchr(lf->symname,':')) { /* Handle assign or volume name */
34 struct affs_sb_info *sbi = AFFS_SB(inode->i_sb);
36 spin_lock(&sbi->symlink_lock);
37 pf = sbi->s_prefix ? sbi->s_prefix : "/";
38 while (i < 1023 && (c = pf[i]))
40 spin_unlock(&sbi->symlink_lock);
41 while (i < 1023 && lf->symname[j] != ':')
42 link[i++] = lf->symname[j++];
48 while (i < 1023 && (c = lf->symname[j])) {
49 if (c == '/' && lc == '/' && i < 1020) { /* parent dir */
59 SetPageUptodate(page);
68 const struct address_space_operations affs_symlink_aops = {
69 .readpage = affs_symlink_readpage,
72 const struct inode_operations affs_symlink_inode_operations = {
73 .readlink = generic_readlink,
74 .get_link = page_get_link,
75 .setattr = affs_notify_change,