patch-2.3.99-pre4 linux/fs/nfs/symlink.c

Next file: linux/fs/nfs/write.c
Previous file: linux/fs/nfs/read.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre3/linux/fs/nfs/symlink.c linux/fs/nfs/symlink.c
@@ -14,8 +14,9 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/sunrpc/clnt.h>
-#include <linux/nfs_fs.h>
 #include <linux/nfs.h>
+#include <linux/nfs2.h>
+#include <linux/nfs_fs.h>
 #include <linux/pagemap.h>
 #include <linux/stat.h>
 #include <linux/mm.h>
@@ -27,16 +28,17 @@
  */
 static int nfs_symlink_filler(struct dentry *dentry, struct page *page)
 {
-	struct nfs_readlinkargs rl_args;
-	kmap(page);
+	struct inode *inode = dentry->d_inode;
+	void *buffer = (void *)kmap(page);
+	int error;
+
 	/* We place the length at the beginning of the page,
 	 * in host byte order, followed by the string.  The
 	 * XDR response verification will NULL terminate it.
 	 */
-	rl_args.fh = NFS_FH(dentry);
-	rl_args.buffer = (const void *)page_address(page);
-	if (rpc_call(NFS_CLIENT(dentry->d_inode), NFSPROC_READLINK,
-		     &rl_args, NULL, 0) < 0)
+	error = NFS_PROTO(inode)->readlink(dentry, buffer,
+					   PAGE_CACHE_SIZE - sizeof(u32)-4);
+	if (error < 0)
 		goto error;
 	SetPageUptodate(page);
 	kunmap(page);
@@ -85,12 +87,10 @@
 	return res;
 }
 
-static struct dentry *
-nfs_follow_link(struct dentry *dentry, struct dentry *base, unsigned int follow)
+static int nfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	struct page *page = NULL;
-	struct dentry *res = vfs_follow_link(dentry, base, follow,
-					     nfs_getlink(dentry, &page));
+	int res = vfs_follow_link(nd, nfs_getlink(dentry,&page));
 	if (page) {
 		kunmap(page);
 		page_cache_release(page);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)