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 extern int obdfs_setattr(struct dentry *de, struct iattr *attr);
44 struct inode_operations obdfs_fast_symlink_inode_operations = {
45 readlink: obdfs_fast_readlink,
46 follow_link: obdfs_fast_follow_link,
47 setattr: obdfs_setattr
50 static int obdfs_readlink(struct dentry *dentry, char *buffer, int buflen)
52 struct page *page = NULL;
56 OIDEBUG(dentry->d_inode);
57 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
58 /* PDEBUG(page, "readlink"); */
63 res = vfs_readlink(dentry, buffer, buflen, (char *)page_address(page));
64 page_cache_release(page);
67 } /* obdfs_readlink */
69 static int obdfs_follow_link(struct dentry * dentry,
72 struct page *page = NULL;
76 OIDEBUG(dentry->d_inode);
77 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
78 /* PDEBUG(page, "follow_link"); */
84 res = vfs_follow_link(nd, (char *)page_address(page));
85 page_cache_release(page);
90 struct inode_operations obdfs_symlink_inode_operations = {
91 readlink: obdfs_readlink,
92 follow_link: obdfs_follow_link,
93 setattr: obdfs_setattr