[Devel] [PATCH rh8 v3 1/2] ve/time: Move ve_get_uptime() to header

Valeriy Vdovin valeriy.vdovin at virtuozzo.com
Tue Dec 22 12:41:08 MSK 2020


On Mon, Dec 21, 2020 at 06:09:55PM +0300, Konstantin Khorenko wrote:
> Will be used in ve.h in another function.
> 
> Fixes: 9644a237d401 ("ve/vestat: Introduce /proc/vz/vestat")
> 
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
Reviewed-by: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
> ---
>  include/linux/ve.h  | 5 +++++
>  kernel/ve/vecalls.c | 5 -----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/ve.h b/include/linux/ve.h
> index 7cb416f342e7..3aa0ea0b1bab 100644
> --- a/include/linux/ve.h
> +++ b/include/linux/ve.h
> @@ -143,6 +143,11 @@ static inline struct ve_struct *css_to_ve(struct cgroup_subsys_state *css)
>  
>  extern struct cgroup_subsys_state *ve_get_init_css(struct ve_struct *ve, int subsys_id);
>  
> +static u64 ve_get_uptime(struct ve_struct *ve)
> +{
> +	return ktime_get_boot_ns() - ve->real_start_time;
> +}
> +
>  extern void monotonic_abs_to_ve(clockid_t which_clock, struct timespec64 *tp);
>  extern void monotonic_ve_to_abs(clockid_t which_clock, struct timespec64 *tp);
>  
> diff --git a/kernel/ve/vecalls.c b/kernel/ve/vecalls.c
> index 786a743faa1a..f1cc04ee82da 100644
> --- a/kernel/ve/vecalls.c
> +++ b/kernel/ve/vecalls.c
> @@ -32,11 +32,6 @@
>  #include <linux/veowner.h>
>  #include <linux/device_cgroup.h>
>  
> -static u64 ve_get_uptime(struct ve_struct *ve)
> -{
> -	return ktime_get_boot_ns() - ve->real_start_time;
> -}
> -
>  static int fill_cpu_stat(envid_t veid, struct vz_cpu_stat __user *buf)
>  {
>  	struct ve_struct *ve;
> -- 
> 2.28.0
> 


More information about the Devel mailing list