2 * linux/fs/ext2/symlink.c
4 * This code is issued under the GNU General Public License.
5 * See the file COPYING in this distribution
7 * Copyright (C) 1992, 1993, 1994, 1995
8 * Remy Card (card@masi.ibp.fr)
9 * Laboratoire MASI - Institut Blaise Pascal
10 * Universite Pierre et Marie Curie (Paris VI)
14 * linux/fs/minix/symlink.c
16 * Copyright (C) 1991, 1992 Linus Torvalds
18 * ext2 symlink handling code
21 * Copyright (C) 1999 Seagate Technology Inc. (author: braam@stelias.com)
26 #include <linux/stat.h>
27 #include <linux/locks.h>
28 #include <linux/obd_support.h> /* for ENTRY and EXIT only */
29 #include <linux/obdfs.h>
31 static int obdfs_fast_readlink(struct dentry *dentry, char *buffer, int buflen)
33 char *s = obdfs_i2info(dentry->d_inode)->oi_inline;
34 return vfs_readlink(dentry, buffer, buflen, s);
37 static int obdfs_fast_follow_link(struct dentry *dentry, struct nameidata *nd)
39 char *s = obdfs_i2info(dentry->d_inode)->oi_inline;
40 return vfs_follow_link(nd, s);
43 struct inode_operations obdfs_fast_symlink_inode_operations = {
44 readlink: obdfs_fast_readlink,
45 follow_link: obdfs_fast_follow_link,
48 static int obdfs_readlink(struct dentry *dentry, char *buffer, int buflen)
50 struct page *page = NULL;
54 OIDEBUG(dentry->d_inode);
55 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
56 /* PDEBUG(page, "readlink"); */
61 res = vfs_readlink(dentry, buffer, buflen, (char *)page_address(page));
62 page_cache_release(page);
65 } /* obdfs_readlink */
67 static int obdfs_follow_link(struct dentry * dentry,
70 struct page *page = NULL;
74 OIDEBUG(dentry->d_inode);
75 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
76 /* PDEBUG(page, "follow_link"); */
82 res = vfs_follow_link(nd, (char *)page_address(page));
83 page_cache_release(page);
88 struct inode_operations obdfs_symlink_inode_operations = {
89 readlink: obdfs_readlink,
90 follow_link: obdfs_follow_link,