[Devel] [PATCH RH7 v2 4/4] ve: cgroup: initialize odirect_enable, features and _randomize_va_space

Dmitry Monakhov dmonakhov at openvz.org
Tue Jun 30 05:20:13 PDT 2015


Pavel Tikhomirov <ptikhomirov at virtuozzo.com> writes:

> 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(-)
ACK
>
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20150630/6a712267/attachment-0001.sig>


More information about the Devel mailing list