[Devel] [PATCH rh7 4/4] ve: zap legacy_veid_to_name
Vladimir Davydov
vdavydov at parallels.com
Sun May 31 06:23:13 PDT 2015
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 7da0c657a663..60d50df2c8c0 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 8f572611773e..53519c35e611 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -169,20 +169,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);
}
@@ -190,9 +183,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);
--
2.1.4
More information about the Devel
mailing list