diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 10:56:50 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 10:56:50 -0400 |
commit | f46e0bd34ec002d0727761da52b8fd47f06d4440 (patch) | |
tree | bb4ce4d00a9857b370765abf6faf89a09f4c4ff4 /fs/nfs/nfs4proc.c | |
parent | cd9a1c0e5ac681871d64804f82291649e2a0accb (diff) | |
download | lwn-f46e0bd34ec002d0727761da52b8fd47f06d4440.tar.gz lwn-f46e0bd34ec002d0727761da52b8fd47f06d4440.zip |
NFSv4: Further minor cleanups for nfs4_atomic_open()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 38c3bed2240d..f8d41eed9a6b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2024,37 +2024,17 @@ out_close: return ret; } -struct dentry * +struct inode * nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags, struct iattr *attr) { - struct dentry *dentry = ctx->path.dentry; - struct dentry *parent; struct nfs4_state *state; - struct dentry *res; - parent = dentry->d_parent; /* Protect against concurrent sillydeletes */ - nfs_block_sillyrename(parent); state = nfs4_do_open(dir, &ctx->path, ctx->mode, open_flags, attr, ctx->cred); - if (IS_ERR(state)) { - if (PTR_ERR(state) == -ENOENT) { - d_add(dentry, NULL); - nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); - } - nfs_unblock_sillyrename(parent); - return (struct dentry *)state; - } - res = d_add_unique(dentry, igrab(state->inode)); - if (res != NULL) { - struct dentry *dummy = ctx->path.dentry; - - ctx->path.dentry = dget(res); - dput(dummy); - } + if (IS_ERR(state)) + return ERR_CAST(state); ctx->state = state; - nfs_set_verifier(ctx->path.dentry, nfs_save_change_attribute(dir)); - nfs_unblock_sillyrename(parent); - return res; + return igrab(state->inode); } int |