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 = kmap(page);
18 struct slink_front *lf;
25 pr_debug("AFFS: follow_link(ino=%lu)\n",inode->i_ino);
28 bh = affs_bread(inode->i_sb, inode->i_ino);
33 lf = (struct slink_front *)bh->b_data;
35 pf = AFFS_SB(inode->i_sb)->s_prefix ? AFFS_SB(inode->i_sb)->s_prefix : "/";
37 if (strchr(lf->symname,':')) { /* Handle assign or volume name */
38 while (i < 1023 && (c = pf[i]))
40 while (i < 1023 && lf->symname[j] != ':')
41 link[i++] = lf->symname[j++];
47 while (i < 1023 && (c = lf->symname[j])) {
48 if (c == '/' && lc == '/' && i < 1020) { /* parent dir */
58 SetPageUptodate(page);
69 struct address_space_operations affs_symlink_aops = {
70 .readpage = affs_symlink_readpage,
73 struct inode_operations affs_symlink_inode_operations = {
74 .readlink = generic_readlink,
75 .follow_link = page_follow_link_light,
76 .put_link = page_put_link,
77 .setattr = affs_notify_change,