diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 14:56:51 (GMT) |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 14:56:51 (GMT) |
commit | b8d4caddd871758ffa156be51b4c8be82fea470d (patch) | |
tree | c388304ca2f1163b2737409ccc4cbc2d29ad3f41 /fs/nfs/dir.c | |
parent | f46e0bd34ec002d0727761da52b8fd47f06d4440 (diff) | |
download | linux-b8d4caddd871758ffa156be51b4c8be82fea470d.tar.xz |
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/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 194676c..196775c 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1169,6 +1169,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) struct dentry *parent = NULL; struct inode *inode = dentry->d_inode; struct inode *dir; + struct nfs_open_context *ctx; int openflags, ret = 0; if (!is_atomic_open(nd) || d_mountpoint(dentry)) @@ -1194,12 +1195,20 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) /* We can't create new files, or truncate existing ones here */ openflags &= ~(O_CREAT|O_EXCL|O_TRUNC); + ctx = nameidata_to_nfs_open_context(dentry, nd); + ret = PTR_ERR(ctx); + if (IS_ERR(ctx)) + goto out; /* * Note: we're not holding inode->i_mutex and so may be racing with * operations that change the directory. We therefore save the * change attribute *before* we do the RPC call. */ - ret = nfs4_open_revalidate(dir, dentry, openflags, nd); + ret = nfs4_open_revalidate(dir, ctx, openflags); + if (ret == 1) + nfs_intent_set_file(nd, ctx); + else + put_nfs_open_context(ctx); out: dput(parent); if (!ret) |