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 <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1646018120-61462-1-git-send-email-wangqing@vivo.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Wang Qing 2022-02-27 19:15:20 -08:00 committed by Theodore Ts'o
parent b3998b3bc6
commit a861fb9fa5

View File

@ -14,6 +14,7 @@
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include "ext4_jbd2.h"
@ -2100,7 +2101,7 @@ retry:
*/
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",