Replace the module parameter 'pcs_krpc_support' with 'pcs_krpc_version'
for better kRPC version management. Older userspace client would be able
to detect version mismatch with absence of 'pcs_krpc_support', while
newer userspace client will check against 'pcs_krpc_version'.

Relates to
https://virtuozzo.atlassian.net/browse/VSTOR-90183

Signed-off-by: Liu Kui <kui....@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 6 +++---
 fs/fuse/kio/pcs/pcs_krpc.c         | 3 +++
 fs/fuse/kio/pcs/pcs_krpc_prot.h    | 8 +++++++-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c 
b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index a0452bad1fd1..2bab4481844a 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -81,9 +81,9 @@ unsigned int cpu_worker_flags = 1;
 module_param(cpu_worker_flags, uint, 0444);
 MODULE_PARM_DESC(cpu_worker_flags, "Set cpu worker flags");
 
-bool pcs_krpc_support = true;
-module_param(pcs_krpc_support, bool, 0444);
-MODULE_PARM_DESC(pcs_krpc_support, "krpc support");
+unsigned int pcs_krpc_version;
+module_param(pcs_krpc_version, uint, 0444);
+MODULE_PARM_DESC(pcs_krpc_version, "krpc version");
 
 #define sel_wq_flags(f) ((((f) & 1) ? WQ_CPU_INTENSIVE : 0) | (((f) & 2) ? 
WQ_UNBOUND : 0))
 
diff --git a/fs/fuse/kio/pcs/pcs_krpc.c b/fs/fuse/kio/pcs/pcs_krpc.c
index 8f62f12782e5..4f3c988f1f3c 100644
--- a/fs/fuse/kio/pcs/pcs_krpc.c
+++ b/fs/fuse/kio/pcs/pcs_krpc.c
@@ -17,6 +17,8 @@
 #include "pcs_req.h"
 #include "pcs_krpc.h"
 
+extern unsigned int pcs_krpc_version;
+
 struct kmem_cache *krpc_req_cachep;
 
 static int krpc_completion_post(struct pcs_krpc *krpc, struct krpc_completion 
*comp)
@@ -913,6 +915,7 @@ int __init pcs_krpc_init(void)
        if (!krpc_req_cachep)
                return -ENOMEM;
 
+       pcs_krpc_version = PCS_KRPC_VERSION;
        return 0;
 }
 
diff --git a/fs/fuse/kio/pcs/pcs_krpc_prot.h b/fs/fuse/kio/pcs/pcs_krpc_prot.h
index 2729520a7cd0..81caa1d53669 100644
--- a/fs/fuse/kio/pcs/pcs_krpc_prot.h
+++ b/fs/fuse/kio/pcs/pcs_krpc_prot.h
@@ -1,9 +1,15 @@
 #ifndef _PCS_KRPC_PROT_H_
 #define _PCS_KRPC_PROT_H_
 #include <linux/ioctl.h>
-
 #include "pcs_prot_types.h"
 
+/*
+ * kRPC version:
+ * v1: Initial krpc support
+ * v2: Support zerocopy read
+ */
+#define PCS_KRPC_VERSION 2
+
 /* Device ioctls: */
 #define PCS_KRPC_IOC_MAGIC  255
 
-- 
2.39.5 (Apple Git-154)

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to