aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/include/linux/obd.h
diff options
context:
space:
mode:
authorManuel Schölling <manuel.schoelling@gmx.de>2014-05-21 19:16:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-23 21:06:30 +0900
commit0c9f38a1d1837de9060ce06f1897235236d38545 (patch)
treecd2257c721e8720e4acec153b56f3a24e015b04d /drivers/staging/lustre/lustre/include/linux/obd.h
parentstaging: lustre: lustre: ptlrpc: sec_config.c: Fix for possible null pointer dereference (diff)
downloadlinux-dev-0c9f38a1d1837de9060ce06f1897235236d38545.tar.xz
linux-dev-0c9f38a1d1837de9060ce06f1897235236d38545.zip
staging: lustre: Use time_before()
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/include/linux/obd.h')
-rw-r--r--drivers/staging/lustre/lustre/include/linux/obd.h4
1 files 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 fea7e6cd44c3..f96f65d5168f 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)