mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] ceph: Convert to use jiffies macro
@ 2024-08-22  9:55 Chen Yufan
  2024-08-23  1:43 ` Xiubo Li
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Yufan @ 2024-08-22  9:55 UTC (permalink / raw)
  To: Xiubo Li, Ilya Dryomov, ceph-devel, linux-kernel
  Cc: opensource.kernel, Chen Yufan

Use time_after_eq macro instead of using
jiffies directly to handle wraparound.
The modifications made compared to the previous version are as follows:
1. Remove extra '+' in the header.

Signed-off-by: Chen Yufan <chenyufan@vivo.com>
---
 fs/ceph/caps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 808c9c048..6a55825c3 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -17,6 +17,7 @@
 #include "crypto.h"
 #include <linux/ceph/decode.h>
 #include <linux/ceph/messenger.h>
+#include <linux/jiffies.h>
 
 /*
  * Capability management
@@ -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);
-- 
2.39.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-23  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-22  9:55 [PATCH v2] ceph: Convert to use jiffies macro Chen Yufan
2024-08-23  1:43 ` Xiubo Li

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®