[Devel] [PATCH RHEL7 COMMIT] ve: zap legacy_veid_to_name

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jun 4 06:07:36 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.9
------>
commit 24a1cd8ebd97862cf9b170558291cfc42fa92817
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Thu Jun 4 17:07:36 2015 +0400

    ve: zap legacy_veid_to_name
    
    This function is only used in ve_cgroup_open/ve_cgroup_remove. Since it
    is a trivial one-line function, inline and then zap it.
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 include/linux/ve_proto.h |  4 ----
 kernel/ve/ve.c           | 15 ++++-----------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/include/linux/ve_proto.h b/include/linux/ve_proto.h
index 7da0c65..60d50df 100644
--- a/include/linux/ve_proto.h
+++ b/include/linux/ve_proto.h
@@ -33,11 +33,7 @@ static inline bool ve_is_super(struct ve_struct *ve)
 #define get_exec_env()		(current->task_ve)
 #define get_env_init(ve)	(ve->ve_ns->pid_ns->child_reaper)
 
-
-#define VE_LEGACY_NAME_MAXLEN	16
-
 const char *ve_name(struct ve_struct *ve);
-void legacy_veid_to_name(envid_t veid, char *name);
 
 /* must be called under rcu_read_lock if task != current */
 const char *task_ve_name(struct task_struct *task);
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index b787e7e..8a04cc3 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -171,20 +171,13 @@ const char *ve_name(struct ve_struct *ve)
 }
 EXPORT_SYMBOL(ve_name);
 
-void legacy_veid_to_name(envid_t veid, char *name)
-{
-	snprintf(name, VE_LEGACY_NAME_MAXLEN, "%u", veid);
-}
-EXPORT_SYMBOL(legacy_veid_to_name);
-
 /* Cgroup must be closed with cgroup_kernel_close */
 struct cgroup *ve_cgroup_open(struct cgroup *root, int flags, envid_t veid)
 {
-	char name[VE_LEGACY_NAME_MAXLEN];
+	char name[16];
 	struct cgroup *cgrp;
 
-	legacy_veid_to_name(veid, name);
-
+	snprintf(name, sizeof(name), "%u", veid);
 	cgrp = cgroup_kernel_open(root, flags, name);
 	return cgrp ? cgrp : ERR_PTR(-ENOENT);
 }
@@ -192,9 +185,9 @@ EXPORT_SYMBOL(ve_cgroup_open);
 
 int ve_cgroup_remove(struct cgroup *root, envid_t veid)
 {
-	char name[VE_LEGACY_NAME_MAXLEN];
+	char name[16];
 
-	legacy_veid_to_name(veid, name);
+	snprintf(name, sizeof(name), "%u", veid);
 	return cgroup_kernel_remove(root, name);
 }
 EXPORT_SYMBOL(ve_cgroup_remove);



More information about the Devel mailing list