[PATCH] SQUASHME: pnfs-submit: highest backchannel slot used for !CONFIG_NFS_V4_1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux