[Devel] [PATCH RHEL9 COMMIT] fs/fuse kio: Add kRPC versioning support

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 7 20:17:26 MSK 2024


The commit is pushed to "branch-rh9-5.14.0-427.35.1.vz9.76.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh9-5.14.0-427.35.1.vz9.76.4
------>
commit b9727d032aeec976764e9896dfe74be34819fd89
Author: Liu Kui <kui.liu at virtuozzo.com>
Date:   Mon Oct 7 22:59:28 2024 +0800

    fs/fuse kio: Add kRPC versioning support
    
    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.liu at virtuozzo.com>
    Acked-by: Alexey Kuznetsov <kuznet at 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 6ab61455641e..89b190a50805 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)
@@ -964,6 +966,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
 


More information about the Devel mailing list