[Devel] [PATCH RHEL7 COMMIT] ve: cgroup: initialize odirect_enable, features and _randomize_va_space

Konstantin Khorenko khorenko at virtuozzo.com
Tue Jun 30 07:29:02 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.23
------>
commit b9b7e1097aa8a516446b9e157be11dcb567d5b5e
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Tue Jun 30 18:29:02 2015 +0400

    ve: cgroup: initialize odirect_enable, features and _randomize_va_space
    
    Patchset description:
    
    ve: fix initialization and remove sysctl_fsync_enable
    
    v2:
    - initialize only on ve cgroup creation, remove get_ve_features
    - rename setup_iptables_mask into ve_setup_iptables_mask
    
    https://jira.sw.ru/browse/PSBM-34286
    https://jira.sw.ru/browse/PSBM-34285
    
    Pavel Tikhomirov (4):
      ve: remove sysctl_fsync_enable and use ve_fsync_behavior instead
      ve: initialize fsync_enable also for non ve0 environment
      ve: iptables: fix mask initialization and changing
      ve: cgroup: initialize odirect_enable, features and _randomize_va_space
    
    =====================================================================
    This patch description:
    
    v2: move intitialization from init_ve_struct to ve_create, remove
    get_ve_features
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
    Acked-by: Dmitry Monakhov <dmonakhov at openvz.org>
---
 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 946b0d6..6496727 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -662,6 +662,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 00c5c04..f4c3190 100644
--- a/kernel/ve/vecalls.c
+++ b/kernel/ve/vecalls.c
@@ -206,33 +206,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



More information about the Devel mailing list