diff options
author | Kemeng Shi <shikemeng@huaweicloud.com> | 2024-05-14 19:24:38 +0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-06-27 10:20:26 -0400 |
commit | b07855348b305c234d9fabb7ab9b50fa9b3a7759 (patch) | |
tree | e5168377658ad719905984fd350f6b67da4537de /fs/jbd2 | |
parent | 136d3e0703e807b14ed6f9b8a5a544b6ba08d940 (diff) |
jbd2: remove unnecessary "should_sleep" in kjournald2
We only need to sleep if no running transaction is expired. Simply remove
unnecessary "should_sleep".
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240514112438.1269037-10-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2')
-rw-r--r-- | fs/jbd2/journal.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index c7869b187380..8d782a88aee1 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -220,15 +220,12 @@ loop: * so we don't sleep */ DEFINE_WAIT(wait); - int should_sleep = 1; prepare_to_wait(&journal->j_wait_commit, &wait, TASK_INTERRUPTIBLE); transaction = journal->j_running_transaction; - if (transaction && time_after_eq(jiffies, - transaction->t_expires)) - should_sleep = 0; - if (should_sleep) { + if (transaction == NULL || + time_before(jiffies, transaction->t_expires)) { write_unlock(&journal->j_state_lock); schedule(); write_lock(&journal->j_state_lock); |