diff options
author | Trond Myklebust <trond.myklebust@fys.uio.no> | 2005-01-04 21:37:20 +0100 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@fys.uio.no> | 2005-01-04 21:37:20 +0100 |
commit | 462ccee72e3f1eaebef14033d9a2f3afab3e3a6c (patch) | |
tree | 4a9a2ac1cdd111102eace3f36b3b433ff9f34c46 /fs | |
parent | 14a98a0292d01bb28c33d0aee5accf1a5b19629c (diff) | |
download | history-462ccee72e3f1eaebef14033d9a2f3afab3e3a6c.tar.gz |
NFS: Change rpc_ops->create() to take a dentry argument rather than a
qstr.
Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/dir.c | 8 | ||||
-rw-r--r-- | fs/nfs/nfs3proc.c | 10 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
-rw-r--r-- | fs/nfs/proc.c | 8 |
4 files changed, 12 insertions, 18 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 8a1e63629d6232..55e50396dd8149 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -986,15 +986,9 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode, 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); diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 6be08f67800917..83668c2f66aa74 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -296,7 +296,7 @@ static int nfs3_proc_commit(struct nfs_write_data *cdata) * 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 @@ nfs3_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr, 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 @@ nfs3_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr, }; 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 @@ exit: 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; } diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 7509bd2ae1818f..04f1a47784d34a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1327,7 +1327,7 @@ static int nfs4_proc_commit(struct nfs_write_data *cdata) */ 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 @@ nfs4_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr, 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; diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index ae9500199b2d09..2252014c10442e 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -213,15 +213,15 @@ static int nfs_proc_write(struct nfs_write_data *wdata) } 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 @@ nfs_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr, 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) { |