diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 16:56:51 +0200 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 16:56:51 +0200 |
commit | 535918f14176396646b5547b7d1353c932f24f5e (patch) | |
tree | 0736137c736ac8c35cfbdd99a1de68eb556e4b4a /fs/nfs/dir.c | |
parent | NFSv4: Clean up nfs4_open_revalidate (diff) | |
download | linux-535918f14176396646b5547b7d1353c932f24f5e.tar.xz linux-535918f14176396646b5547b7d1353c932f24f5e.zip |
NFSv4: Further cleanups for nfs4_open_revalidate()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 196775c70948..dc93d356341b 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1204,16 +1204,36 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) * operations that change the directory. We therefore save the * change attribute *before* we do the RPC call. */ - ret = nfs4_open_revalidate(dir, ctx, openflags); - if (ret == 1) + inode = nfs4_atomic_open(dir, ctx, openflags, NULL); + if (IS_ERR(inode)) { + ret = PTR_ERR(inode); + switch (ret) { + case -EPERM: + case -EACCES: + case -EDQUOT: + case -ENOSPC: + case -EROFS: + goto out_put_ctx; + default: + goto out_drop; + } + } + iput(inode); + if (inode == dentry->d_inode) { + nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_intent_set_file(nd, ctx); - else - put_nfs_open_context(ctx); + } else + goto out_drop; out: dput(parent); - if (!ret) - d_drop(dentry); return ret; +out_drop: + d_drop(dentry); + ret = 0; +out_put_ctx: + put_nfs_open_context(ctx); + goto out; + no_open_dput: dput(parent); no_open: |