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 | cd9a1c0e5ac681871d64804f82291649e2a0accb (patch) | |
tree | 900c2bf6ba75c2a02af07091afcf4ba4cfdb2396 /fs/nfs/inode.c | |
parent | 859d5024f450686ad0a42ed3c06f2fa20295c9e6 (diff) |
NFSv4: Clean up nfs4_atomic_open
Start moving the 'struct nameidata' dependent code out of the lower level
NFS code in preparation for the removal of open intents.
Instead of the struct nameidata, we pass down a partially initialised
struct nfs_open_context that will be fully initialised by the atomic open
upon success.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 7d2d6c72aa78..2f9266406afc 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -623,7 +623,7 @@ void nfs_close_context(struct nfs_open_context *ctx, int is_sync) | |||
623 | nfs_revalidate_inode(server, inode); | 623 | nfs_revalidate_inode(server, inode); |
624 | } | 624 | } |
625 | 625 | ||
626 | static struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred) | 626 | struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred, fmode_t f_mode) |
627 | { | 627 | { |
628 | struct nfs_open_context *ctx; | 628 | struct nfs_open_context *ctx; |
629 | 629 | ||
@@ -633,6 +633,7 @@ static struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct | |||
633 | path_get(&ctx->path); | 633 | path_get(&ctx->path); |
634 | ctx->cred = get_rpccred(cred); | 634 | ctx->cred = get_rpccred(cred); |
635 | ctx->state = NULL; | 635 | ctx->state = NULL; |
636 | ctx->mode = f_mode; | ||
636 | ctx->flags = 0; | 637 | ctx->flags = 0; |
637 | ctx->error = 0; | 638 | ctx->error = 0; |
638 | ctx->dir_cookie = 0; | 639 | ctx->dir_cookie = 0; |
@@ -673,7 +674,7 @@ void put_nfs_open_context(struct nfs_open_context *ctx) | |||
673 | * Ensure that mmap has a recent RPC credential for use when writing out | 674 | * Ensure that mmap has a recent RPC credential for use when writing out |
674 | * shared pages | 675 | * shared pages |
675 | */ | 676 | */ |
676 | static void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx) | 677 | void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx) |
677 | { | 678 | { |
678 | struct inode *inode = filp->f_path.dentry->d_inode; | 679 | struct inode *inode = filp->f_path.dentry->d_inode; |
679 | struct nfs_inode *nfsi = NFS_I(inode); | 680 | struct nfs_inode *nfsi = NFS_I(inode); |
@@ -730,11 +731,10 @@ int nfs_open(struct inode *inode, struct file *filp) | |||
730 | cred = rpc_lookup_cred(); | 731 | cred = rpc_lookup_cred(); |
731 | if (IS_ERR(cred)) | 732 | if (IS_ERR(cred)) |
732 | return PTR_ERR(cred); | 733 | return PTR_ERR(cred); |
733 | ctx = alloc_nfs_open_context(&filp->f_path, cred); | 734 | ctx = alloc_nfs_open_context(&filp->f_path, cred, filp->f_mode); |
734 | put_rpccred(cred); | 735 | put_rpccred(cred); |
735 | if (ctx == NULL) | 736 | if (ctx == NULL) |
736 | return -ENOMEM; | 737 | return -ENOMEM; |
737 | ctx->mode = filp->f_mode; | ||
738 | nfs_file_set_open_context(filp, ctx); | 738 | nfs_file_set_open_context(filp, ctx); |
739 | put_nfs_open_context(ctx); | 739 | put_nfs_open_context(ctx); |
740 | nfs_fscache_set_inode_cookie(inode, filp); | 740 | nfs_fscache_set_inode_cookie(inode, filp); |