From: Trond Myklebust Date: Thu, 10 Oct 2002 05:46:48 +0000 (-0700) Subject: [PATCH] A basic NFSv4 client for 2.5.x X-Git-Tag: v2.5.42~44^2~11 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=40a4b2a4836023d76b652f1fd695c1c6d4d63632;p=history.git [PATCH] A basic NFSv4 client for 2.5.x This patch changes the interface of the ->readdir() nfs_rpc_op so that its first argument is a dentry instead of an inode. [Explanation: The dentry is required because in NFSv4, we need to make use of the _parent_ directory's inode. This is because NFSv4 servers no longer return an entry for ".." in the READDIR response, so the client kernel needs to fake this entry, inode number and all.] --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 5bb31a8ee6f0..b2540bfc295c 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -107,7 +107,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page) dfprintk(VFS, "NFS: nfs_readdir_filler() reading cookie %Lu into page %lu.\n", (long long)desc->entry->cookie, page->index); again: - error = NFS_PROTO(inode)->readdir(inode, cred, desc->entry->cookie, page, + error = NFS_PROTO(inode)->readdir(file->f_dentry, cred, desc->entry->cookie, page, NFS_SERVER(inode)->dtsize, desc->plus); if (error < 0) { /* We requested READDIRPLUS, but the server doesn't grok it */ @@ -341,7 +341,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent, status = -ENOMEM; goto out; } - desc->error = NFS_PROTO(inode)->readdir(inode, cred, desc->target, + desc->error = NFS_PROTO(inode)->readdir(file->f_dentry, cred, desc->target, page, NFS_SERVER(inode)->dtsize, desc->plus); diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index c14a6624179a..c0d8be017f80 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -543,9 +543,10 @@ nfs3_proc_rmdir(struct inode *dir, struct qstr *name) * readdirplus. */ static int -nfs3_proc_readdir(struct inode *dir, struct rpc_cred *cred, +nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, u64 cookie, struct page *page, unsigned int count, int plus) { + struct inode *dir = dentry->d_inode; struct nfs_fattr dir_attr; u32 *verf = NFS_COOKIEVERF(dir); struct nfs3_readdirargs arg = { diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 51d8dba0a94f..411461013124 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -425,9 +425,10 @@ nfs_proc_rmdir(struct inode *dir, struct qstr *name) * from nfs_readdir by calling the decode_entry function directly. */ static int -nfs_proc_readdir(struct inode *dir, struct rpc_cred *cred, +nfs_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, u64 cookie, struct page *page, unsigned int count, int plus) { + struct inode *dir = dentry->d_inode; struct nfs_readdirargs arg = { .fh = NFS_FH(dir), .cookie = cookie, diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 8d9c04899d65..b27525074317 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -338,7 +338,7 @@ struct nfs_rpc_ops { int (*mkdir) (struct inode *, struct qstr *, struct iattr *, struct nfs_fh *, struct nfs_fattr *); int (*rmdir) (struct inode *, struct qstr *); - int (*readdir) (struct inode *, struct rpc_cred *, + int (*readdir) (struct dentry *, struct rpc_cred *, u64, struct page *, unsigned int, int); int (*mknod) (struct inode *, struct qstr *, struct iattr *, dev_t, struct nfs_fh *, struct nfs_fattr *);