[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210105005452.92521-10-ebiggers@kernel.org>
Date: Mon, 4 Jan 2021 16:54:48 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: linux-fsdevel@...r.kernel.org
Cc: linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
linux-xfs@...r.kernel.org, Theodore Ts'o <tytso@....edu>,
Christoph Hellwig <hch@....de>
Subject: [PATCH 09/13] fs: drop redundant checks from __writeback_single_inode()
From: Eric Biggers <ebiggers@...gle.com>
I_DIRTY_TIME and I_DIRTY_INODE are mutually exclusive in i_state. So
after seeing that I_DIRTY_TIME is set, there's no point in checking for
I_DIRTY_INODE, as it must be clear.
Separately, wbc->for_sync implies wbc->sync_mode == WB_SYNC_ALL.
So there's no need to check for both. Just check for WB_SYNC_ALL.
Signed-off-by: Eric Biggers <ebiggers@...gle.com>
---
fs/fs-writeback.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index f20daf4f5e19b..3f5a589399afe 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1482,8 +1482,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
dirty = inode->i_state & I_DIRTY;
if ((inode->i_state & I_DIRTY_TIME) &&
- ((dirty & I_DIRTY_INODE) ||
- wbc->sync_mode == WB_SYNC_ALL || wbc->for_sync ||
+ (wbc->sync_mode == WB_SYNC_ALL ||
time_after(jiffies, inode->dirtied_time_when +
dirtytime_expire_interval * HZ))) {
dirty |= I_DIRTY_TIME;
--
2.30.0
Powered by blists - more mailing lists