From: Benny Halevy <bhalevy@panasas.com>
To: Andy Adamson <andros@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH] SQUASHME: pnfs-submit: highest backchannel slot used for !CONFIG_NFS_V4_1
Date: Sun, 14 Nov 2010 14:08:38 +0200 [thread overview]
Message-ID: <1289736518-22008-1-git-send-email-bhalevy@panasas.com> (raw)
In-Reply-To: <1289484640-4100-2-git-send-email-andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfs/callback_xdr.c | 38 +++++++++++++++++++++-----------------
1 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 39da338..a77877c 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -728,6 +728,24 @@ encode_hdr:
return status;
}
+static void nfs4_callback_free_slot(struct nfs4_session *session)
+{
+#if defined(CONFIG_NFS_V4_1)
+ struct nfs4_slot_table *tbl = &session->bc_slot_table;
+
+ spin_lock(&tbl->slot_tbl_lock);
+ /*
+ * Let the state manager know callback processing done.
+ * A single slot, so highest used slotid is either 0 or -1
+ */
+ tbl->highest_used_slotid--;
+ nfs41_check_drain_bc_complete(session);
+ spin_unlock(&tbl->slot_tbl_lock);
+ dprintk("%s highest_used_slotid %d\n", __func__,
+ tbl->highest_used_slotid);
+#endif /* CONFIG_NFS_V4_1 */
+}
+
/*
* Decode, process and encode a COMPOUND
*/
@@ -773,23 +791,9 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r
*hdr_res.status = status;
*hdr_res.nops = htonl(nops);
- if (cps.session) {
- struct nfs4_slot_table *tbl = &cps.session->bc_slot_table;
-
- spin_lock(&tbl->slot_tbl_lock);
- /*
- * Let the state manager know callback processing done.
- * A single slot, so highest used slotid is either 0 or -1
- */
- tbl->highest_used_slotid--;
- nfs41_check_drain_bc_complete(cps.session);
- spin_unlock(&tbl->slot_tbl_lock);
- dprintk("%s highest_used_slotid %d\n", __func__,
- tbl->highest_used_slotid);
-
- /* matched by cb_sequence find_client_with_session */
- put_session_client(cps.session);
- }
+ nfs4_callback_free_slot(cps.session);
+ /* matched by cb_sequence find_client_with_session */
+ put_session_client(cps.session);
dprintk("%s: done, status = %u\n", __func__, ntohl(status));
return rpc_success;
}
--
1.7.2.3
prev parent reply other threads:[~2010-11-14 12:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-11 14:10 [PATCH 0/3] Fix session draining and back channel processing andros
2010-11-11 2:13 ` Andy Adamson
2010-11-11 14:10 ` [PATCH 1/3] pnfs-submit: set back channel highest slot used andros
2010-11-11 14:10 ` [PATCH 2/3] pnfs-submit: add back channel draining andros
2010-11-11 14:10 ` [PATCH 3/3] pnfs-submit: callbacks cannot use an nfs_client that is being freed andros
2010-11-11 13:22 ` Benny Halevy
2010-11-12 8:13 ` William A. (Andy) Adamson
[not found] ` <AANLkTi=55LGD+s+tg5d1wVyMdL9c-SmCguNLW_8veR8X-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-12 10:08 ` Benny Halevy
2010-11-14 12:08 ` Benny Halevy [this message]
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=1289736518-22008-1-git-send-email-bhalevy@panasas.com \
--to=bhalevy@panasas.com \
--cc=andros@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).