summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Yufan <chenyufan@vivo.com>2024-08-22 17:55:41 +0800
committerIlya Dryomov <idryomov@gmail.com>2024-08-27 09:30:09 +0200
commit2015716adbd9cac8505ed461f5f330e832be0c84 (patch)
tree59fe7805b0924ca661090e84f70747f335c184d4
parent9a948c0c8e741776ee6d938b49d34d22034fbb7d (diff)
downloadlinux-2015716adbd9cac8505ed461f5f330e832be0c84.tar.gz
linux-2015716adbd9cac8505ed461f5f330e832be0c84.tar.bz2
linux-2015716adbd9cac8505ed461f5f330e832be0c84.zip
ceph: Convert to use jiffies macro
Use time_after_eq macro instead of using jiffies directly to handle wraparound. [ xiubli: adjust the header files order ] Signed-off-by: Chen Yufan <chenyufan@vivo.com> Reviewed-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--fs/ceph/caps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 808c9c048276..6561a6cd94de 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -10,6 +10,7 @@
#include <linux/writeback.h>
#include <linux/iversion.h>
#include <linux/filelock.h>
+#include <linux/jiffies.h>
#include "super.h"
#include "mds_client.h"
@@ -4659,7 +4660,7 @@ unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
* slowness doesn't block mdsc delayed work,
* preventing send_renew_caps() from running.
*/
- if (jiffies - loop_start >= 5 * HZ)
+ if (time_after_eq(jiffies, loop_start + 5 * HZ))
break;
}
spin_unlock(&mdsc->cap_delay_lock);