Skip to content

Commit a861fb9

Browse files
Wang Qingtytso
authored andcommitted
ext4: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent b3998b3 commit a861fb9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/ext4/resize.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <linux/errno.h>
1616
#include <linux/slab.h>
17+
#include <linux/jiffies.h>
1718

1819
#include "ext4_jbd2.h"
1920

@@ -2100,7 +2101,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
21002101
*/
21012102
while (ext4_setup_next_flex_gd(sb, flex_gd, n_blocks_count,
21022103
flexbg_size)) {
2103-
if (jiffies - last_update_time > HZ * 10) {
2104+
if (time_is_before_jiffies(last_update_time + HZ * 10)) {
21042105
if (last_update_time)
21052106
ext4_msg(sb, KERN_INFO,
21062107
"resized to %llu blocks",

0 commit comments

Comments
 (0)