[pnfs] [Fwd: [PATCH 03/13] nfs41: cb_sequence proc implementation]

Benny Halevy bhalevy at panasas.com
Wed Jan 23 05:46:00 EST 2008


Resending since previous message didn't get to the mailing list.

On Jan. 22, 2008, 21:33 +0200, Benny Halevy <bhalevy at panasas.com> wrote:

Currently, just free up any referring calls information.

Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfs/callback.h      |    4 ++++
 fs/nfs/callback_proc.c |   30 ++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h
index b177e03..b1b18a3 100644
--- a/fs/nfs/callback.h
+++ b/fs/nfs/callback.h
@@ -121,6 +121,10 @@ extern void nfs_callback_down(void);
  * so we limit their concurrency to 1.
  */
 #define NFS41_BC_MIN_CALLBACKS 1
+#define NFS41_BC_MAX_CALLBACKS 1
+
+extern unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
+				       struct cb_sequenceres *res);
 #endif /* CONFIG_NFS_V4_1 */
 
 extern unsigned int nfs_callback_set_tcpport;
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 72e55d8..e949e63 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -86,3 +86,33 @@ out:
 	dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(res));
 	return res;
 }
+
+#if defined(CONFIG_NFS_V4_1)
+
+/* FIXME: validate args->cbs_{sequence,slot}id */
+/* FIXME: referring calls should be processed */
+unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
+				struct cb_sequenceres *res)
+{
+	int i;
+	unsigned status = 0;
+
+	for (i = 0; i < args->csa_nrclists; i++)
+		kfree(args->csa_rclists[i].rcl_refcalls);
+	kfree(args->csa_rclists);
+
+	memcpy(&res->csr_sessionid, &args->csa_sessionid,
+	       sizeof(res->csr_sessionid));
+	res->csr_sequenceid = args->csa_sequenceid;
+	res->csr_slotid = args->csa_slotid;
+	res->csr_highestslotid = NFS41_BC_MAX_CALLBACKS;
+	if (res->csr_highestslotid > args->csa_highestslotid)
+		res->csr_highestslotid = args->csa_highestslotid;
+	res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS;
+
+	dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
+	res->csr_status = status;
+	return status;
+}
+
+#endif /* CONFIG_NFS_V4_1 */
-- 
1.5.3.3


-- 
Benny Halevy
Software Architect
Tel/Fax: +972-3-647-8340
Mobile: +972-54-802-8340
US:      +1-412-203-3187
bhalevy at panasas.com
 
Panasas, Inc.
The Leader in Parallel Storage
www.panasas.com


More information about the pNFS mailing list