diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-20 20:31:51 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-28 16:03:12 -0400 |
commit | 1f7977c1368afc483908281daaffd31bca5a8d1e (patch) | |
tree | ab8bcc2e66719825ee91a5559250fc21882cf397 /fs | |
parent | 7fdab069b7172f2348cf3d87e19c6c24340292bf (diff) |
NFSv4.1: Simplify the pNFS return-on-close code
Confine it to the nfs4_do_close() code.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4_fs.h | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 | ||||
-rw-r--r-- | fs/nfs/nfs4state.c | 7 |
3 files changed, 5 insertions, 10 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 71d407fd00a..9cacc131a8a 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -223,7 +223,7 @@ extern int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred); | |||
223 | extern int nfs4_destroy_clientid(struct nfs_client *clp); | 223 | extern int nfs4_destroy_clientid(struct nfs_client *clp); |
224 | extern int nfs4_init_clientid(struct nfs_client *, struct rpc_cred *); | 224 | extern int nfs4_init_clientid(struct nfs_client *, struct rpc_cred *); |
225 | extern int nfs41_init_clientid(struct nfs_client *, struct rpc_cred *); | 225 | extern int nfs41_init_clientid(struct nfs_client *, struct rpc_cred *); |
226 | extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc); | 226 | extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait); |
227 | extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); | 227 | extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); |
228 | extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *, | 228 | extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *, |
229 | struct nfs4_fs_locations *, struct page *); | 229 | struct nfs4_fs_locations *, struct page *); |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 6d5750cabd8..8de0435caed 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2204,7 +2204,7 @@ static const struct rpc_call_ops nfs4_close_ops = { | |||
2204 | * | 2204 | * |
2205 | * NOTE: Caller must be holding the sp->so_owner semaphore! | 2205 | * NOTE: Caller must be holding the sp->so_owner semaphore! |
2206 | */ | 2206 | */ |
2207 | int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc) | 2207 | int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait) |
2208 | { | 2208 | { |
2209 | struct nfs_server *server = NFS_SERVER(state->inode); | 2209 | struct nfs_server *server = NFS_SERVER(state->inode); |
2210 | struct nfs4_closedata *calldata; | 2210 | struct nfs4_closedata *calldata; |
@@ -2240,7 +2240,7 @@ int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc) | |||
2240 | calldata->res.fattr = &calldata->fattr; | 2240 | calldata->res.fattr = &calldata->fattr; |
2241 | calldata->res.seqid = calldata->arg.seqid; | 2241 | calldata->res.seqid = calldata->arg.seqid; |
2242 | calldata->res.server = server; | 2242 | calldata->res.server = server; |
2243 | calldata->roc = roc; | 2243 | calldata->roc = pnfs_roc(state->inode); |
2244 | nfs_sb_active(calldata->inode->i_sb); | 2244 | nfs_sb_active(calldata->inode->i_sb); |
2245 | 2245 | ||
2246 | msg.rpc_argp = &calldata->arg; | 2246 | msg.rpc_argp = &calldata->arg; |
@@ -2257,8 +2257,6 @@ int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc) | |||
2257 | out_free_calldata: | 2257 | out_free_calldata: |
2258 | kfree(calldata); | 2258 | kfree(calldata); |
2259 | out: | 2259 | out: |
2260 | if (roc) | ||
2261 | pnfs_roc_release(state->inode); | ||
2262 | nfs4_put_open_state(state); | 2260 | nfs4_put_open_state(state); |
2263 | nfs4_put_state_owner(sp); | 2261 | nfs4_put_state_owner(sp); |
2264 | return status; | 2262 | return status; |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index fc6cfe68ad1..a5331ec094a 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -729,11 +729,8 @@ static void __nfs4_close(struct nfs4_state *state, | |||
729 | if (!call_close) { | 729 | if (!call_close) { |
730 | nfs4_put_open_state(state); | 730 | nfs4_put_open_state(state); |
731 | nfs4_put_state_owner(owner); | 731 | nfs4_put_state_owner(owner); |
732 | } else { | 732 | } else |
733 | bool roc = pnfs_roc(state->inode); | 733 | nfs4_do_close(state, gfp_mask, wait); |
734 | |||
735 | nfs4_do_close(state, gfp_mask, wait, roc); | ||
736 | } | ||
737 | } | 734 | } |
738 | 735 | ||
739 | void nfs4_close_state(struct nfs4_state *state, fmode_t fmode) | 736 | void nfs4_close_state(struct nfs4_state *state, fmode_t fmode) |