From: Arnd Bergmann Date: Tue, 10 Jan 2017 23:16:11 +0000 (-0500) Subject: LU-4423 obd: use ktime_t for calculating elapsed time X-Git-Tag: 2.9.52~19 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=939a742d5093c1a79cc9c08496d181597d28f243 LU-4423 obd: use ktime_t for calculating elapsed time process_param2_config() tries to print how much time has passed across a call_usermodehelper() function, and uses struct timeval for that. We want to remove this structure, so this is better expressed in terms of ktime_t and ktime_us_delta(). Signed-off-by: Arnd Bergmann Change-Id: I90c61d9d49ee0d500772f1b370790e37859f18b2 Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/23146 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Dmitry Eremin --- diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 3d43727..34c5711 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -1096,8 +1096,8 @@ static int process_param2_config(struct lustre_cfg *lcfg) [2] = param, [3] = NULL }; - struct timeval start; - struct timeval end; + ktime_t start; + ktime_t end; int rc; ENTRY; @@ -1107,18 +1107,18 @@ static int process_param2_config(struct lustre_cfg *lcfg) RETURN(-EINVAL); } - do_gettimeofday(&start); + start = ktime_get(); rc = call_usermodehelper(argv[0], argv, NULL, UMH_WAIT_PROC); - do_gettimeofday(&end); + end = ktime_get(); if (rc < 0) { CERROR("lctl: error invoking upcall %s %s %s: rc = %d; " "time %ldus\n", argv[0], argv[1], argv[2], rc, - cfs_timeval_sub(&end, &start, NULL)); + (long)ktime_us_delta(end, start)); } else { CDEBUG(D_HA, "lctl: invoked upcall %s %s %s, time %ldus\n", argv[0], argv[1], argv[2], - cfs_timeval_sub(&end, &start, NULL)); + (long)ktime_us_delta(end, start)); rc = 0; }