All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: use time_is_before_jiffies() instead of open coding it
@ 2022-02-28  3:15 Qing Wang
  2022-03-03 15:14 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Qing Wang @ 2022-02-28  3:15 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel; +Cc: Wang Qing

From: Wang Qing <wangqing@vivo.com>

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

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 fs/ext4/resize.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index ee8f02f..4a80d9b
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -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",
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: use time_is_before_jiffies() instead of open coding it
  2022-02-28  3:15 [PATCH] ext4: use time_is_before_jiffies() instead of open coding it Qing Wang
@ 2022-03-03 15:14 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2022-03-03 15:14 UTC (permalink / raw)
  To: linux-kernel, linux-ext4, Andreas Dilger, Qing Wang; +Cc: Theodore Ts'o

On Sun, 27 Feb 2022 19:15:20 -0800, Qing Wang wrote:
> From: Wang Qing <wangqing@vivo.com>
> 
> 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,
-- 
Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-03 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28  3:15 [PATCH] ext4: use time_is_before_jiffies() instead of open coding it Qing Wang
2022-03-03 15:14 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.