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 * Re-written Oct 2001.
23 * Copyright (C) 2001 Cluster File Systems, Inc. (author: braam@clusterfs.com)
28 #include <linux/stat.h>
29 #include <linux/locks.h>
31 #define DEBUG_SUBSYSTEM S_OBDFS
33 #include <linux/obd_support.h> /* for ENTRY and EXIT only */
34 #include <linux/obdfs.h>
36 static int obdfs_fast_readlink(struct dentry *dentry, char *buffer, int buflen)
38 char *s = obdfs_i2info(dentry->d_inode)->oi_inline;
39 return vfs_readlink(dentry, buffer, buflen, s);
42 static int obdfs_fast_follow_link(struct dentry *dentry, struct nameidata *nd)
44 char *s = obdfs_i2info(dentry->d_inode)->oi_inline;
45 return vfs_follow_link(nd, s);
48 extern int obdfs_setattr(struct dentry *de, struct iattr *attr);
49 struct inode_operations obdfs_fast_symlink_inode_operations = {
50 readlink: obdfs_fast_readlink,
51 follow_link: obdfs_fast_follow_link,
52 setattr: obdfs_setattr
55 static int obdfs_readlink(struct dentry *dentry, char *buffer, int buflen)
57 struct page *page = NULL;
61 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
66 res = vfs_readlink(dentry, buffer, buflen, (char *)page_address(page));
67 page_cache_release(page);
70 } /* obdfs_readlink */
72 static int obdfs_follow_link(struct dentry * dentry,
75 struct page *page = NULL;
79 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
85 res = vfs_follow_link(nd, (char *)page_address(page));
86 page_cache_release(page);
91 struct inode_operations obdfs_symlink_inode_operations = {
92 readlink: obdfs_readlink,
93 follow_link: obdfs_follow_link,
94 setattr: obdfs_setattr