aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-09-17 10:56:51 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-09-17 10:56:51 -0400
commitb8d4caddd871758ffa156be51b4c8be82fea470d (patch)
treec388304ca2f1163b2737409ccc4cbc2d29ad3f41 /fs/nfs/nfs4proc.c
parentf46e0bd34ec002d0727761da52b8fd47f06d4440 (diff)
NFSv4: Clean up nfs4_open_revalidate
Remove references to 'struct nameidata' from the low-level open_revalidate code, and replace them with a struct nfs_open_context which will be correctly initialised upon success. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f8d41eed9a6b..b4762463b19f 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2038,21 +2038,11 @@ nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags
2038} 2038}
2039 2039
2040int 2040int
2041nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags, struct nameidata *nd) 2041nfs4_open_revalidate(struct inode *dir, struct nfs_open_context *ctx, int openflags)
2042{ 2042{
2043 struct path path = {
2044 .mnt = nd->path.mnt,
2045 .dentry = dentry,
2046 };
2047 struct rpc_cred *cred;
2048 struct nfs4_state *state; 2043 struct nfs4_state *state;
2049 fmode_t fmode = openflags & (FMODE_READ | FMODE_WRITE);
2050 2044
2051 cred = rpc_lookup_cred(); 2045 state = nfs4_do_open(dir, &ctx->path, ctx->mode, openflags, NULL, ctx->cred);
2052 if (IS_ERR(cred))
2053 return PTR_ERR(cred);
2054 state = nfs4_do_open(dir, &path, fmode, openflags, NULL, cred);
2055 put_rpccred(cred);
2056 if (IS_ERR(state)) { 2046 if (IS_ERR(state)) {
2057 switch (PTR_ERR(state)) { 2047 switch (PTR_ERR(state)) {
2058 case -EPERM: 2048 case -EPERM:
@@ -2065,14 +2055,13 @@ nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags, st
2065 goto out_drop; 2055 goto out_drop;
2066 } 2056 }
2067 } 2057 }
2068 if (state->inode == dentry->d_inode) { 2058 ctx->state = state;
2069 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 2059 if (state->inode == ctx->path.dentry->d_inode) {
2070 nfs4_intent_set_file(nd, &path, state, fmode); 2060 nfs_set_verifier(ctx->path.dentry, nfs_save_change_attribute(dir));
2071 return 1; 2061 return 1;
2072 } 2062 }
2073 nfs4_close_sync(&path, state, fmode);
2074out_drop: 2063out_drop:
2075 d_drop(dentry); 2064 d_drop(ctx->path.dentry);
2076 return 0; 2065 return 0;
2077} 2066}
2078 2067