Commit 98f2d643 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

staging/lustre: 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: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bf6d2153
...@@ -1021,8 +1021,8 @@ static int process_param2_config(struct lustre_cfg *lcfg) ...@@ -1021,8 +1021,8 @@ static int process_param2_config(struct lustre_cfg *lcfg)
[2] = param, [2] = param,
[3] = NULL [3] = NULL
}; };
struct timeval start; ktime_t start;
struct timeval end; ktime_t end;
int rc; int rc;
...@@ -1032,19 +1032,19 @@ static int process_param2_config(struct lustre_cfg *lcfg) ...@@ -1032,19 +1032,19 @@ static int process_param2_config(struct lustre_cfg *lcfg)
return -EINVAL; return -EINVAL;
} }
do_gettimeofday(&start); start = ktime_get();
rc = call_usermodehelper(argv[0], argv, NULL, 1); rc = call_usermodehelper(argv[0], argv, NULL, 1);
do_gettimeofday(&end); end = ktime_get();
if (rc < 0) { if (rc < 0) {
CERROR( CERROR(
"lctl: error invoking upcall %s %s %s: rc = %d; time %ldus\n", "lctl: error invoking upcall %s %s %s: rc = %d; time %ldus\n",
argv[0], argv[1], argv[2], rc, argv[0], argv[1], argv[2], rc,
cfs_timeval_sub(&end, &start, NULL)); (long)ktime_us_delta(end, start));
} else { } else {
CDEBUG(D_HA, "lctl: invoked upcall %s %s %s, time %ldus\n", CDEBUG(D_HA, "lctl: invoked upcall %s %s %s, time %ldus\n",
argv[0], argv[1], argv[2], argv[0], argv[1], argv[2],
cfs_timeval_sub(&end, &start, NULL)); (long)ktime_us_delta(end, start));
rc = 0; rc = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment