Commit a861fb9f authored by Wang Qing's avatar Wang Qing Committed by Theodore Ts'o

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: default avatarWang Qing <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1646018120-61462-1-git-send-email-wangqing@vivo.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent b3998b3b
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/jiffies.h>
#include "ext4_jbd2.h" #include "ext4_jbd2.h"
...@@ -2100,7 +2101,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count) ...@@ -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, while (ext4_setup_next_flex_gd(sb, flex_gd, n_blocks_count,
flexbg_size)) { flexbg_size)) {
if (jiffies - last_update_time > HZ * 10) { if (time_is_before_jiffies(last_update_time + HZ * 10)) {
if (last_update_time) if (last_update_time)
ext4_msg(sb, KERN_INFO, ext4_msg(sb, KERN_INFO,
"resized to %llu blocks", "resized to %llu blocks",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment