Skip to contentSkip to conversation

ext4: use time_is_before_jiffies() instead of open coding it

PATCH Applied Qing Wang 2 participants 2 messages Feb 28, 2022 – Mar 3, 2022 ext4 file system

lore
Share & tools
lore

Qing Wang

author
#0 lore raw

PATCH 1/1 ext4: use time_is_before_jiffies() instead of open coding it

From: Wang Qing <[email protected]>

Use the helper function time_is_{before,after}_jiffies() to improve code readability.

---
 fs/ext4/resize.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/resize.c +2 -1
index ee8f02f..4a80d9b
@@ -14,6 +14,7 @@
 
 #include <linux/errno.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 
 #include "ext4_jbd2.h"
 
@@ -2100,7 +2101,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
 	 */
 	while (ext4_setup_next_flex_gd(sb, flex_gd, n_blocks_count,
 					      flexbg_size)) {
-		if (jiffies - last_update_time > HZ * 10) {
+		if (time_is_before_jiffies(last_update_time + HZ * 10)) {
 			if (last_update_time)
 				ext4_msg(sb, KERN_INFO,
 					 "resized to %llu blocks",
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 6 lines · Qing Wang

From: Wang Qing <[email protected]>

Use the helper function time_is_{before,after}_jiffies() to improve code readability.

Applied, thanks!

[1/1] ext4: use time_is_before_jiffies() instead of open coding it

      commit: a861fb9fa51da7b1957f612b742ce62a95591628

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>