diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 10:56:51 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 10:56:51 -0400 |
commit | b8d4caddd871758ffa156be51b4c8be82fea470d (patch) | |
tree | c388304ca2f1163b2737409ccc4cbc2d29ad3f41 /fs/nfs/dir.c | |
parent | f46e0bd34ec002d0727761da52b8fd47f06d4440 (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/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 194676cc5b04..196775c70948 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) | |||
1169 | struct dentry *parent = NULL; | 1169 | struct dentry *parent = NULL; |
1170 | struct inode *inode = dentry->d_inode; | 1170 | struct inode *inode = dentry->d_inode; |
1171 | struct inode *dir; | 1171 | struct inode *dir; |
1172 | struct nfs_open_context *ctx; | ||
1172 | int openflags, ret = 0; | 1173 | int openflags, ret = 0; |
1173 | 1174 | ||
1174 | if (!is_atomic_open(nd) || d_mountpoint(dentry)) | 1175 | if (!is_atomic_open(nd) || d_mountpoint(dentry)) |
@@ -1194,12 +1195,20 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
1194 | /* We can't create new files, or truncate existing ones here */ | 1195 | /* We can't create new files, or truncate existing ones here */ |
1195 | openflags &= ~(O_CREAT|O_EXCL|O_TRUNC); | 1196 | openflags &= ~(O_CREAT|O_EXCL|O_TRUNC); |
1196 | 1197 | ||
1198 | ctx = nameidata_to_nfs_open_context(dentry, nd); | ||
1199 | ret = PTR_ERR(ctx); | ||
1200 | if (IS_ERR(ctx)) | ||
1201 | goto out; | ||
1197 | /* | 1202 | /* |
1198 | * Note: we're not holding inode->i_mutex and so may be racing with | 1203 | * Note: we're not holding inode->i_mutex and so may be racing with |
1199 | * operations that change the directory. We therefore save the | 1204 | * operations that change the directory. We therefore save the |
1200 | * change attribute *before* we do the RPC call. | 1205 | * change attribute *before* we do the RPC call. |
1201 | */ | 1206 | */ |
1202 | ret = nfs4_open_revalidate(dir, dentry, openflags, nd); | 1207 | ret = nfs4_open_revalidate(dir, ctx, openflags); |
1208 | if (ret == 1) | ||
1209 | nfs_intent_set_file(nd, ctx); | ||
1210 | else | ||
1211 | put_nfs_open_context(ctx); | ||
1203 | out: | 1212 | out: |
1204 | dput(parent); | 1213 | dput(parent); |
1205 | if (!ret) | 1214 | if (!ret) |