]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
nfs41: cb_sequence proc implementation
authorBenny Halevy <bhalevy@panasas.com>
Wed, 1 Apr 2009 13:23:25 +0000 (09:23 -0400)
committerBenny Halevy <bhalevy@panasas.com>
Wed, 17 Jun 2009 21:11:38 +0000 (14:11 -0700)
Currently, just free up any referring calls information.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: fix csr_{,target}highestslotid]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
fs/nfs/callback.h
fs/nfs/callback_proc.c

index 2b933ce064ddbd9288ac96c31079528898a83825..576f51f4dc528347bd4b113756d59db08015f869 100644 (file)
@@ -103,6 +103,9 @@ struct cb_sequenceres {
        uint32_t                        csr_target_highestslotid;
 };
 
+extern unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
+                                      struct cb_sequenceres *res);
+
 #endif /* CONFIG_NFS_V4_1 */
 
 extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res);
@@ -119,6 +122,7 @@ extern void nfs_callback_down(int minorversion);
  * of slots for the backchannel.
  */
 #define NFS41_BC_MIN_CALLBACKS 1
+#define NFS41_BC_MAX_CALLBACKS 1
 
 extern unsigned int nfs_callback_set_tcpport;
 extern unsigned short nfs_callback_tcpport;
index f7e83e23cf9f47a991ee6d303eee2227009f2712..f731bbe7ac6ad54b36560f323459279ebf29bc71 100644 (file)
@@ -101,3 +101,31 @@ out:
        dprintk("%s: exit with status = %d\n", __func__, 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 - 1;
+       res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS - 1;
+
+       dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
+       res->csr_status = status;
+       return status;
+}
+
+#endif /* CONFIG_NFS_V4_1 */