NFS: Change rpc_ops->create() to take a dentry argument rather than a qstr. Signed-off-by: Trond Myklebust --- fs/nfs/dir.c | 8 +------- fs/nfs/nfs3proc.c | 10 +++++----- fs/nfs/nfs4proc.c | 4 ++-- fs/nfs/proc.c | 8 ++++---- include/linux/nfs_xdr.h | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) Index: linux-2.6.9-rc1/fs/nfs/nfs3proc.c =================================================================== --- linux-2.6.9-rc1.orig/fs/nfs/nfs3proc.c 2004-09-03 19:21:14.180526669 -0400 +++ linux-2.6.9-rc1/fs/nfs/nfs3proc.c 2004-09-03 19:48:20.794214317 -0400 @@ -296,7 +296,7 @@ * For now, we don't implement O_EXCL. */ static struct inode * -nfs3_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr, +nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, int flags) { struct nfs_fh fhandle; @@ -304,8 +304,8 @@ struct nfs_fattr dir_attr; struct nfs3_createargs arg = { .fh = NFS_FH(dir), - .name = name->name, - .len = name->len, + .name = dentry->d_name.name, + .len = dentry->d_name.len, .sattr = sattr, }; struct nfs3_diropres res = { @@ -315,7 +315,7 @@ }; int status; - dprintk("NFS call create %s\n", name->name); + dprintk("NFS call create %s\n", dentry->d_name.name); arg.createmode = NFS3_CREATE_UNCHECKED; if (flags & O_EXCL) { arg.createmode = NFS3_CREATE_EXCLUSIVE; @@ -353,7 +353,7 @@ if (status != 0) goto out; if (fhandle.size == 0 || !(fattr.valid & NFS_ATTR_FATTR)) { - status = nfs3_proc_lookup(dir, name, &fhandle, &fattr); + status = nfs3_proc_lookup(dir, &dentry->d_name, &fhandle, &fattr); if (status != 0) goto out; } Index: linux-2.6.9-rc1/fs/nfs/nfs4proc.c =================================================================== --- linux-2.6.9-rc1.orig/fs/nfs/nfs4proc.c 2004-09-03 19:21:22.850415123 -0400 +++ linux-2.6.9-rc1/fs/nfs/nfs4proc.c 2004-09-03 19:48:57.148423813 -0400 @@ -1327,7 +1327,7 @@ */ static struct inode * -nfs4_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr, +nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, int flags) { struct inode *inode; @@ -1335,7 +1335,7 @@ struct rpc_cred *cred; cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0); - state = nfs4_do_open(dir, name, flags, sattr, cred); + state = nfs4_do_open(dir, &dentry->d_name, flags, sattr, cred); put_rpccred(cred); if (!IS_ERR(state)) { inode = state->inode; Index: linux-2.6.9-rc1/fs/nfs/proc.c =================================================================== --- linux-2.6.9-rc1.orig/fs/nfs/proc.c 2004-09-03 19:21:34.497922228 -0400 +++ linux-2.6.9-rc1/fs/nfs/proc.c 2004-09-03 19:46:52.055931621 -0400 @@ -213,15 +213,15 @@ } static struct inode * -nfs_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr, +nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, int flags) { struct nfs_fh fhandle; struct nfs_fattr fattr; struct nfs_createargs arg = { .fh = NFS_FH(dir), - .name = name->name, - .len = name->len, + .name = dentry->d_name.name, + .len = dentry->d_name.len, .sattr = sattr }; struct nfs_diropok res = { @@ -231,7 +231,7 @@ int status; fattr.valid = 0; - dprintk("NFS call create %s\n", name->name); + dprintk("NFS call create %s\n", dentry->d_name.name); status = rpc_call(NFS_CLIENT(dir), NFSPROC_CREATE, &arg, &res, 0); dprintk("NFS reply create: %d\n", status); if (status == 0) { Index: linux-2.6.9-rc1/fs/nfs/dir.c =================================================================== --- linux-2.6.9-rc1.orig/fs/nfs/dir.c 2004-09-03 19:21:14.136532310 -0400 +++ linux-2.6.9-rc1/fs/nfs/dir.c 2004-09-03 19:44:14.762786742 -0400 @@ -1034,15 +1034,9 @@ if (nd && (nd->flags & LOOKUP_CREATE)) open_flags = nd->intent.open.flags; - /* - * The 0 argument passed into the create function should one day - * contain the O_EXCL flag if requested. This allows NFSv3 to - * select the appropriate create strategy. Currently open_namei - * does not pass the create flags. - */ lock_kernel(); nfs_begin_data_update(dir); - inode = NFS_PROTO(dir)->create(dir, &dentry->d_name, &attr, open_flags); + inode = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags); nfs_end_data_update(dir); if (!IS_ERR(inode)) { d_instantiate(dentry, inode); Index: linux-2.6.9-rc1/include/linux/nfs_xdr.h =================================================================== --- linux-2.6.9-rc1.orig/include/linux/nfs_xdr.h 2004-09-03 19:21:23.604318479 -0400 +++ linux-2.6.9-rc1/include/linux/nfs_xdr.h 2004-09-03 19:44:49.531167301 -0400 @@ -681,7 +681,7 @@ int (*read) (struct nfs_read_data *); int (*write) (struct nfs_write_data *); int (*commit) (struct nfs_write_data *); - struct inode * (*create) (struct inode *, struct qstr *, + struct inode * (*create) (struct inode *, struct dentry *, struct iattr *, int); int (*remove) (struct inode *, struct qstr *); int (*unlink_setup) (struct rpc_message *,