[Devel] [VZ10 v2 12/21] ve/kernfs: Fix when !CONFIG_VE
Vladimir Riabchun
vladimir.riabchun at virtuozzo.com
Fri May 15 23:01:52 MSK 2026
1. Have kernfs_super_info->ve unconditionally
2. Add missing static inline for stub functions
3. Fix kernfs_ve_allowed arguments so they match
4. Replace removed has_ns with kernfs_ns_enabled in kernfs_find_ns
https://virtuozzo.atlassian.net/browse/VSTOR-130116
Feature: !CONFIG_VE build
Signed-off-by: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
---
fs/kernfs/dir.c | 3 ++-
fs/kernfs/kernfs-internal.h | 2 --
fs/kernfs/kernfs-ve.h | 11 ++++++-----
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index b9573848b9b2..835d92e7ec82 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -849,7 +849,8 @@ static struct kernfs_node *kernfs_find_ns(struct kernfs_node *parent,
#ifndef CONFIG_VE
if ((bool)kernfs_ns_enabled(parent) != (bool)ns) {
WARN(1, KERN_WARNING "kernfs: ns %s in '%s' for '%s'\n",
- has_ns ? "required" : "invalid", parent->name, name);
+ kernfs_ns_enabled(parent) ? "required" : "invalid",
+ parent->name, name);
return NULL;
}
#endif
diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h
index 6f5b79e0d1f6..70d1c4cff484 100644
--- a/fs/kernfs/kernfs-internal.h
+++ b/fs/kernfs/kernfs-internal.h
@@ -97,10 +97,8 @@ struct kernfs_super_info {
/* anchored at kernfs_root->supers, protected by kernfs_rwsem */
struct list_head node;
-#ifdef CONFIG_VE
struct ve_struct *ve;
off_t ve_perms_off;
-#endif
};
#define kernfs_info(SB) ((struct kernfs_super_info *)(SB->s_fs_info))
diff --git a/fs/kernfs/kernfs-ve.h b/fs/kernfs/kernfs-ve.h
index 116898829e07..023e91c600a3 100644
--- a/fs/kernfs/kernfs-ve.h
+++ b/fs/kernfs/kernfs-ve.h
@@ -25,10 +25,10 @@ int kernfs_ve_allowed(struct kernfs_node *kn);
bool kernfs_d_visible(struct kernfs_node *kn, struct kernfs_super_info *info);
-#else // CONFIG_VE
+#else /* CONFIG_VE*/
-void kernfs_get_ve_perms(struct kernfs_node *kn) { }
-void kernfs_put_ve_perms(struct kernfs_node *kn) { }
+static inline void kernfs_get_ve_perms(struct kernfs_node *kn) { }
+static inline void kernfs_put_ve_perms(struct kernfs_node *kn) { }
static inline int kernfs_ve_permission(struct kernfs_node *kn,
struct kernfs_super_info *info, int mask)
@@ -36,12 +36,13 @@ static inline int kernfs_ve_permission(struct kernfs_node *kn,
return 0;
}
-static inline int kernfs_ve_allowed(void)
+static inline int kernfs_ve_allowed(struct kernfs_node *kn)
{
return 1;
}
-bool kernfs_d_visible(struct kernfs_node *kn, struct kernfs_super_info *info)
+static inline bool kernfs_d_visible(struct kernfs_node *kn,
+ struct kernfs_super_info *info)
{
return true;
}
--
2.43.0
More information about the Devel
mailing list