2 * linux/fs/ext2/symlink.c
4 * Copyright (C) 1992, 1993, 1994, 1995
5 * Remy Card (card@masi.ibp.fr)
6 * Laboratoire MASI - Institut Blaise Pascal
7 * Universite Pierre et Marie Curie (Paris VI)
11 * linux/fs/minix/symlink.c
13 * Copyright (C) 1991, 1992 Linus Torvalds
15 * ext2 symlink handling code
18 * Copyright (C) 1999 Seagate Technology Inc. (author: braam@stelias.com)
22 #include <linux/ext2_fs.h>
24 #include <linux/stat.h>
25 #include <linux/locks.h>
26 #include <linux/obd_support.h> /* for ENTRY and EXIT only */
27 #include <linux/obdfs.h>
29 static int obdfs_fast_readlink(struct dentry *dentry, char *buffer, int buflen)
31 char *s = obdfs_i2info(dentry->d_inode)->oi_inline;
32 return vfs_readlink(dentry, buffer, buflen, s);
35 static struct dentry *obdfs_fast_follow_link(struct dentry *dentry, struct dentry *base, unsigned flags)
37 char *s = obdfs_i2info(dentry->d_inode)->oi_inline;
38 return vfs_follow_link(dentry, base, flags, s);
41 struct inode_operations obdfs_fast_symlink_inode_operations = {
42 readlink: obdfs_fast_readlink,
43 follow_link: obdfs_fast_follow_link,
46 static int obdfs_readlink(struct dentry *dentry, char *buffer, int buflen)
48 struct page *page = NULL;
52 OIDEBUG(dentry->d_inode);
53 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
54 /* PDEBUG(page, "readlink"); */
59 res = vfs_readlink(dentry, buffer, buflen, (char *)page_address(page));
60 page_cache_release(page);
63 } /* obdfs_readlink */
65 static struct dentry * obdfs_follow_link(struct dentry * dentry,
69 struct page *page = NULL;
73 OIDEBUG(dentry->d_inode);
74 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
75 /* PDEBUG(page, "follow_link"); */
81 res = vfs_follow_link(dentry, base, follow, (char *)page_address(page));
82 page_cache_release(page);
87 struct inode_operations obdfs_symlink_inode_operations = {
88 readlink: obdfs_readlink,
89 follow_link: obdfs_follow_link,