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

Submitted by Konstantin Khorenko on Dec. 21, 2020, 3:09 p.m.

Details

Message ID 20201221150956.226097-1-khorenko@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko Dec. 21, 2020, 3:09 p.m.
Will be used in ve.h in another function.

Fixes: 9644a237d401 ("ve/vestat: Introduce /proc/vz/vestat")

Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 include/linux/ve.h  | 5 +++++
 kernel/ve/vecalls.c | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

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;

Comments

Valeriy Vdovin Dec. 22, 2020, 9:41 a.m.
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@virtuozzo.com>
Reviewed-by: Valeriy Vdovin <valeriy.vdovin@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
>