Skip to contentSkip to conversation

md: use time_after_eq() instead of jiffies judgment

PATCH New Qing Wang 1 participant 1 message Feb 10, 2022 Device mapper

lore
Share & tools
lore

Qing Wang

author
#0 lore raw

PATCH 1/1 md: use time_after_eq() instead of jiffies judgment

From: Wang Qing <[email protected]>

It is better to use time_xxx() directly instead of jiffies judgment for understanding.

---
 drivers/md/dm-thin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-thin.c +1 -1
index f4234d6..dced764
@@ -161,7 +161,7 @@ static void throttle_work_start(struct throttle *t)
 
 static void throttle_work_update(struct throttle *t)
 {
-	if (!t->throttle_applied && jiffies > t->threshold) {
+	if (!t->throttle_applied && time_after(jiffies, t->threshold)) {
 		down_write(&t->lock);
 		t->throttle_applied = true;
 	}
Signature · 1 line
2.7.4