diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-22 18:47:28 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 01:43:45 -0400 |
commit | 511415980ace0ceecd71088dbe1c7ce4ca7c79fe (patch) | |
tree | 153510403c8053f3287d304c02609c17d07801d3 /fs/nfs/dir.c | |
parent | 3d4ff43d895c50319af45eb4bf04a4618eccdf76 (diff) |
nameidata_to_nfs_open_context() doesn't need nameidata, actually...
just open flags; switched to passing just those and
renamed to create_nfs_open_context()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index a0693f3f11c0..cc613c354bb8 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1343,11 +1343,11 @@ static int is_atomic_open(struct nameidata *nd) | |||
1343 | return 1; | 1343 | return 1; |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | static struct nfs_open_context *nameidata_to_nfs_open_context(struct dentry *dentry, struct nameidata *nd) | 1346 | static struct nfs_open_context *create_nfs_open_context(struct dentry *dentry, int open_flags) |
1347 | { | 1347 | { |
1348 | struct nfs_open_context *ctx; | 1348 | struct nfs_open_context *ctx; |
1349 | struct rpc_cred *cred; | 1349 | struct rpc_cred *cred; |
1350 | fmode_t fmode = nd->intent.open.flags & (FMODE_READ | FMODE_WRITE | FMODE_EXEC); | 1350 | fmode_t fmode = open_flags & (FMODE_READ | FMODE_WRITE | FMODE_EXEC); |
1351 | 1351 | ||
1352 | cred = rpc_lookup_cred(); | 1352 | cred = rpc_lookup_cred(); |
1353 | if (IS_ERR(cred)) | 1353 | if (IS_ERR(cred)) |
@@ -1416,12 +1416,13 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
1416 | goto out; | 1416 | goto out; |
1417 | } | 1417 | } |
1418 | 1418 | ||
1419 | ctx = nameidata_to_nfs_open_context(dentry, nd); | 1419 | open_flags = nd->intent.open.flags; |
1420 | |||
1421 | ctx = create_nfs_open_context(dentry, open_flags); | ||
1420 | res = ERR_CAST(ctx); | 1422 | res = ERR_CAST(ctx); |
1421 | if (IS_ERR(ctx)) | 1423 | if (IS_ERR(ctx)) |
1422 | goto out; | 1424 | goto out; |
1423 | 1425 | ||
1424 | open_flags = nd->intent.open.flags; | ||
1425 | if (nd->flags & LOOKUP_CREATE) { | 1426 | if (nd->flags & LOOKUP_CREATE) { |
1426 | attr.ia_mode = nd->intent.open.create_mode; | 1427 | attr.ia_mode = nd->intent.open.create_mode; |
1427 | attr.ia_valid = ATTR_MODE; | 1428 | attr.ia_valid = ATTR_MODE; |
@@ -1513,7 +1514,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
1513 | /* We can't create new files, or truncate existing ones here */ | 1514 | /* We can't create new files, or truncate existing ones here */ |
1514 | openflags &= ~(O_CREAT|O_EXCL|O_TRUNC); | 1515 | openflags &= ~(O_CREAT|O_EXCL|O_TRUNC); |
1515 | 1516 | ||
1516 | ctx = nameidata_to_nfs_open_context(dentry, nd); | 1517 | ctx = create_nfs_open_context(dentry, openflags); |
1517 | ret = PTR_ERR(ctx); | 1518 | ret = PTR_ERR(ctx); |
1518 | if (IS_ERR(ctx)) | 1519 | if (IS_ERR(ctx)) |
1519 | goto out; | 1520 | goto out; |
@@ -1577,7 +1578,7 @@ static int nfs_open_create(struct inode *dir, struct dentry *dentry, int mode, | |||
1577 | if ((nd->flags & LOOKUP_CREATE) != 0) { | 1578 | if ((nd->flags & LOOKUP_CREATE) != 0) { |
1578 | open_flags = nd->intent.open.flags; | 1579 | open_flags = nd->intent.open.flags; |
1579 | 1580 | ||
1580 | ctx = nameidata_to_nfs_open_context(dentry, nd); | 1581 | ctx = create_nfs_open_context(dentry, open_flags); |
1581 | error = PTR_ERR(ctx); | 1582 | error = PTR_ERR(ctx); |
1582 | if (IS_ERR(ctx)) | 1583 | if (IS_ERR(ctx)) |
1583 | goto out_err_drop; | 1584 | goto out_err_drop; |