[Devel] [PATCH RH9 2/7] ve/kernfs: export kernfs_perms_set() helper

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Oct 5 15:55:48 MSK 2021


From: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>

Wiill be used for dynamic export/unexport of modules sysfs entries.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>

(cherry picked from vz8 commit c417bba2b37333d4a5e2f523d9526601cbc35dc2)
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 fs/kernfs/ve.c            | 4 ++--
 include/linux/kernfs-ve.h | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/kernfs/ve.c b/fs/kernfs/ve.c
index ea8b583c8d8f..0c4c28cc745d 100644
--- a/fs/kernfs/ve.c
+++ b/fs/kernfs/ve.c
@@ -247,8 +247,8 @@ int kernfs_perms_show(struct seq_file *m, void *v, struct kmapset_key *key)
 	return 0;
 }
 
-static int kernfs_perms_set(char *path, struct ve_struct *ve, int mask,
-			    struct kernfs_node *root, struct kmapset_key *key)
+int kernfs_perms_set(char *path, struct ve_struct *ve, int mask,
+		     struct kernfs_node *root, struct kmapset_key *key)
 {
 	struct kernfs_node *kn = root, *nkn;
 	struct kmapset_map *map = NULL;
diff --git a/include/linux/kernfs-ve.h b/include/linux/kernfs-ve.h
index 11420351b3dd..2cb905918393 100644
--- a/include/linux/kernfs-ve.h
+++ b/include/linux/kernfs-ve.h
@@ -13,6 +13,7 @@
 
 struct kernfs_root;
 struct dentry;
+struct ve_struct;
 
 #ifdef CONFIG_VE
 int kernfs_init_ve_perms(struct kernfs_root *root,
@@ -31,6 +32,9 @@ ssize_t kernfs_perms_write(struct kernfs_open_file *of,
 			   char *buf, size_t nbytes, loff_t off,
 			   struct kernfs_node *root, struct kmapset_key *key);
 
+int kernfs_perms_set(char *path, struct ve_struct *ve, int mask,
+		     struct kernfs_node *root, struct kmapset_key *key);
+
 #else   /* CONFIG_VE */
 static inline int kernfs_init_ve_perms(struct kernfs_root *root,
 				       struct kmapset_set *perms_set)
-- 
2.31.1



More information about the Devel mailing list