[Devel] [PATCH RH7 v2 4/4] ve: cgroup: initialize odirect_enable, features and _randomize_va_space
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Tue Jun 30 00:25:57 PDT 2015
v2: move intitialization from init_ve_struct to ve_create, remove
get_ve_features
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
kernel/ve/ve.c | 5 +++++
kernel/ve/vecalls.c | 23 -----------------------
2 files changed, 5 insertions(+), 23 deletions(-)
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 802dc79..e50b9ee 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -665,6 +665,11 @@ static struct cgroup_subsys_state *ve_create(struct cgroup *cg)
if (!ve->ve_name)
goto err_name;
+ ve->_randomize_va_space = ve0._randomize_va_space;
+
+ ve->features = VE_FEATURES_DEF;
+
+ ve->odirect_enable = 2;
ve->fsync_enable = 2;
#ifdef CONFIG_VE_IPTABLES
diff --git a/kernel/ve/vecalls.c b/kernel/ve/vecalls.c
index 71ee93d..b171492 100644
--- a/kernel/ve/vecalls.c
+++ b/kernel/ve/vecalls.c
@@ -205,33 +205,10 @@ static inline int init_ve_namespaces(void)
return 0;
}
-static __u64 get_ve_features(env_create_param_t *data, int datalen)
-{
- __u64 known_features;
-
- if (datalen < sizeof(struct env_create_param3))
- /* this version of vzctl is aware of VE_FEATURES_OLD only */
- known_features = VE_FEATURES_OLD;
- else
- known_features = data->known_features;
-
- /*
- * known features are set as required
- * yet unknown features are set as in VE_FEATURES_DEF
- */
- return (data->feature_mask & known_features) |
- (VE_FEATURES_DEF & ~known_features);
-}
-
static int init_ve_struct(struct ve_struct *ve,
u32 class_id, env_create_param_t *data, int datalen)
{
ve->class_id = class_id;
- ve->features = get_ve_features(data, datalen);
-
- ve->_randomize_va_space = ve0._randomize_va_space;
-
- ve->odirect_enable = 2;
#ifdef CONFIG_VE_IPTABLES
/* Set up ipt_mask as it will be used during
--
1.9.3
More information about the Devel
mailing list