* [PATCH] lustre: Use time_before()
@ 2014-05-21 17:16 Manuel Schölling
0 siblings, 0 replies; only message in thread
From: Manuel Schölling @ 2014-05-21 17:16 UTC (permalink / raw)
To: gregkh
Cc: bergwolf, andreas.dilger, manuel.schoelling, devel, linux-kernel,
kernel-janitors
To be future-proof and for better readability the time comparisons are modified
to use time_before() instead of plain, error-prone math.
Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
---
drivers/staging/lustre/lustre/include/linux/obd.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/linux/obd.h b/drivers/staging/lustre/lustre/include/linux/obd.h
index dc36f75e..518e48a 100644
--- a/drivers/staging/lustre/lustre/include/linux/obd.h
+++ b/drivers/staging/lustre/lustre/include/linux/obd.h
@@ -80,8 +80,8 @@ static inline void __client_obd_list_lock(client_obd_lock_t *lock,
break;
}
- if ((jiffies - cur > 5 * HZ) &&
- (jiffies - lock->time > 5 * HZ)) {
+ if (time_before(cur + 5 * HZ, jiffies) &&
+ time_before(lock->time + 5 * HZ, jiffies)) {
struct task_struct *task = lock->task;
if (task == NULL)
--
1.7.10.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-05-21 17:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-21 17:16 [PATCH] lustre: Use time_before() Manuel Schölling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®