Skip to content

Commit b078553

Browse files
Kemeng Shitytso
authored andcommitted
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 <[email protected]> Reviewed-by: Zhang Yi <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 136d3e0 commit b078553

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/jbd2/journal.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,12 @@ static int kjournald2(void *arg)
220220
* so we don't sleep
221221
*/
222222
DEFINE_WAIT(wait);
223-
int should_sleep = 1;
224223

225224
prepare_to_wait(&journal->j_wait_commit, &wait,
226225
TASK_INTERRUPTIBLE);
227226
transaction = journal->j_running_transaction;
228-
if (transaction && time_after_eq(jiffies,
229-
transaction->t_expires))
230-
should_sleep = 0;
231-
if (should_sleep) {
227+
if (transaction == NULL ||
228+
time_before(jiffies, transaction->t_expires)) {
232229
write_unlock(&journal->j_state_lock);
233230
schedule();
234231
write_lock(&journal->j_state_lock);

0 commit comments

Comments
 (0)