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)
23 #include <linux/stat.h>
24 #include <linux/locks.h>
25 #include <linux/obd_support.h> /* for ENTRY and EXIT only */
26 #include <linux/obdfs.h>
28 static int obdfs_fast_readlink(struct dentry *dentry, char *buffer, int buflen)
30 char *s = obdfs_i2info(dentry->d_inode)->oi_inline;
31 return vfs_readlink(dentry, buffer, buflen, s);
34 static int obdfs_fast_follow_link(struct dentry *dentry, struct nameidata *nd)
36 char *s = obdfs_i2info(dentry->d_inode)->oi_inline;
37 return vfs_follow_link(nd, s);
40 struct inode_operations obdfs_fast_symlink_inode_operations = {
41 readlink: obdfs_fast_readlink,
42 follow_link: obdfs_fast_follow_link,
45 static int obdfs_readlink(struct dentry *dentry, char *buffer, int buflen)
47 struct page *page = NULL;
51 OIDEBUG(dentry->d_inode);
52 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
53 /* PDEBUG(page, "readlink"); */
58 res = vfs_readlink(dentry, buffer, buflen, (char *)page_address(page));
59 page_cache_release(page);
62 } /* obdfs_readlink */
64 static int obdfs_follow_link(struct dentry * dentry,
67 struct page *page = NULL;
71 OIDEBUG(dentry->d_inode);
72 page = obdfs_getpage(dentry->d_inode, 0, 0, 0);
73 /* PDEBUG(page, "follow_link"); */
79 res = vfs_follow_link(nd, (char *)page_address(page));
80 page_cache_release(page);
85 struct inode_operations obdfs_symlink_inode_operations = {
86 readlink: obdfs_readlink,
87 follow_link: obdfs_follow_link,