From 9d49877bcb0e16c423a064de39865cfa5910d9da Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Jul 2018 16:50:41 +0000 Subject: [PATCH] scst_targ: Port to Linux kernel v4.18 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7417 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 09c4d35dd..58056823c 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -5822,17 +5822,9 @@ again: #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) if (scst_poll_ns > 0) { - struct timespec ts; ktime_t end, kt; - int rc; - rc = __getnstimeofday(&ts); - if (unlikely(rc != 0)) { - WARN_ON_ONCE(rc); - goto go; - } - - end = timespec_to_ktime(ts); + end = ktime_get(); end = ktime_add_ns(end, scst_poll_ns); do { @@ -5843,16 +5835,9 @@ again: goto again; } cpu_relax(); - rc = __getnstimeofday(&ts); - if (unlikely(rc != 0)) { - WARN_ON_ONCE(rc); - goto go; - } - kt = timespec_to_ktime(ts); + kt = ktime_get(); } while (ktime_before(kt, end)); } - -go: #endif spin_lock_irq(&p_cmd_threads->cmd_list_lock); spin_lock(&thr->thr_cmd_list_lock);