[Devel] [PATCH hci-8.1 2/4] ve: Introduce override_ve/revert_ve helpers
Vladimir Riabchun
vladimir.riabchun at virtuozzo.com
Thu Oct 22 18:05:26 MSK 2026
These helpers mirror override_creds/revert_creds and are supposed to
be used together in cases when VE creds may be stored and later used
by the different VE task.
https://virtuozzo.atlassian.net/browse/VSTOR-142405
Signed-off-by: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
---
include/linux/ve.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/include/linux/ve.h b/include/linux/ve.h
index 717567775f58..157326ef91b9 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -295,6 +295,19 @@ static inline struct vdso_image *ve_get_vdso_64(struct ve_struct *ve)
return ve->vdso_64;
}
+static inline struct ve_struct *override_ve(struct ve_struct *new_ve)
+{
+ struct ve_struct *old_ve = current->task_ve;
+
+ current->task_ve = new_ve;
+ return old_ve;
+}
+
+static inline void revert_ve(struct ve_struct *orig_ve)
+{
+ current->task_ve = orig_ve;
+}
+
#else /* CONFIG_VE */
#include <linux/init_task.h>
#include <net/net_namespace.h>
@@ -403,6 +416,14 @@ static inline struct vdso_image *ve_get_vdso_64(struct ve_struct *ve)
{
return (struct vdso_image *)&vdso_image_64;
}
+
+static inline struct ve_struct *override_ve(struct ve_struct *new_ve)
+{
+ return NULL;
+}
+
+static inline void revert_ve(struct ve_struct *orig_ve) {}
+
#endif /* CONFIG_X86 */
#endif /* CONFIG_VE */
--
2.52.0
More information about the Devel
mailing list