All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 04/14] NFSv4.1: Simplify the pNFS return-on-close code
Date: Thu, 20 Sep 2012 21:35:47 -0400	[thread overview]
Message-ID: <1348191357-44503-4-git-send-email-Trond.Myklebust@netapp.com> (raw)
In-Reply-To: <1348191357-44503-3-git-send-email-Trond.Myklebust@netapp.com>

Confine it to the nfs4_do_close() code.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 fs/nfs/nfs4_fs.h   | 2 +-
 fs/nfs/nfs4proc.c  | 6 ++----
 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 71d407f..9cacc13 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);
 extern int nfs4_destroy_clientid(struct nfs_client *clp);
 extern int nfs4_init_clientid(struct nfs_client *, struct rpc_cred *);
 extern int nfs41_init_clientid(struct nfs_client *, struct rpc_cred *);
-extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc);
+extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait);
 extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle);
 extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *,
 				  struct nfs4_fs_locations *, struct page *);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 49d5c7d..d9d67b3 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2204,7 +2204,7 @@ static const struct rpc_call_ops nfs4_close_ops = {
  *
  * NOTE: Caller must be holding the sp->so_owner semaphore!
  */
-int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc)
+int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait)
 {
 	struct nfs_server *server = NFS_SERVER(state->inode);
 	struct nfs4_closedata *calldata;
@@ -2240,7 +2240,7 @@ int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc)
 	calldata->res.fattr = &calldata->fattr;
 	calldata->res.seqid = calldata->arg.seqid;
 	calldata->res.server = server;
-	calldata->roc = roc;
+	calldata->roc = pnfs_roc(state->inode);
 	nfs_sb_active(calldata->inode->i_sb);
 
 	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)
 out_free_calldata:
 	kfree(calldata);
 out:
-	if (roc)
-		pnfs_roc_release(state->inode);
 	nfs4_put_open_state(state);
 	nfs4_put_state_owner(sp);
 	return status;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index fc6cfe6..a5331ec 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -729,11 +729,8 @@ static void __nfs4_close(struct nfs4_state *state,
 	if (!call_close) {
 		nfs4_put_open_state(state);
 		nfs4_put_state_owner(owner);
-	} else {
-		bool roc = pnfs_roc(state->inode);
-
-		nfs4_do_close(state, gfp_mask, wait, roc);
-	}
+	} else
+		nfs4_do_close(state, gfp_mask, wait);
 }
 
 void nfs4_close_state(struct nfs4_state *state, fmode_t fmode)
-- 
1.7.11.4


  reply	other threads:[~2012-09-21  1:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21  1:35 [PATCH 01/14] NFSv4.1: Fix a reference leak in pnfs_update_layout Trond Myklebust
2012-09-21  1:35 ` [PATCH 02/14] NFSv4.1: pnfs_layout_io_test_failed must clear invalid lsegs before a retry Trond Myklebust
2012-09-21  1:35   ` [PATCH 03/14] NFSv4.1: Fix a race in the pNFS return-on-close code Trond Myklebust
2012-09-21  1:35     ` Trond Myklebust [this message]
2012-09-21  1:35       ` [PATCH 05/14] NFSv4.1: Get rid of pNFS layout state "NFS_LAYOUT_INVALID" Trond Myklebust
2012-09-21  1:35         ` [PATCH 06/14] NFSv4.1: reset the inode MDS threshold counters on layout destruction Trond Myklebust
2012-09-21  1:35           ` [PATCH 07/14] NFSv4.1: Rename the pnfs_put_lseg_common to pnfs_layout_remove_lseg Trond Myklebust
2012-09-21  1:35             ` [PATCH 08/14] NFSv4.1: Remove redundant reference to the pnfs_layout_hdr Trond Myklebust
2012-09-21  1:35               ` [PATCH 09/14] NFSv4.1: Free the pnfs_layout_hdr outside the inode->i_lock Trond Myklebust
2012-09-21  1:35                 ` [PATCH 10/14] NFSv4.1: Clean up the removal of pnfs_layout_hdr from the server list Trond Myklebust
2012-09-21  1:35                   ` [PATCH 11/14] NFSv4.1: Clean up pnfs_put_lseg() Trond Myklebust
2012-09-21  1:35                     ` [PATCH 12/14] NFSv4.1: Balance pnfs_layout_hdr refcount in pnfs_layout_(insert|remove)_lseg Trond Myklebust
2012-09-21  1:35                       ` [PATCH 13/14] NFSv4.1: Get rid of pNFS spin lock debugging asserts Trond Myklebust
2012-09-21  1:35                         ` [PATCH 14/14] NFSv4.1: Remove unused 'default allocation' for pnfs_alloc_layout_hdr() Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348191357-44503-4-git-send-email-Trond.Myklebust@netapp.com \
    --to=trond.myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.