Skip to content

Commit be22255

Browse files
zhangyi089tytso
authored andcommitted
jbd2: remove t_checkpoint_io_list
Since t_checkpoint_io_list was stop using in jbd2_log_do_checkpoint() now, it's time to remove the whole t_checkpoint_io_list logic. Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20230606135928.434610-3-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent c2d6fd9 commit be22255

File tree

3 files changed

+3
-48
lines changed

3 files changed

+3
-48
lines changed

fs/jbd2/checkpoint.c

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
* Called with j_list_lock held.
2929
*/
30-
static inline void __buffer_unlink_first(struct journal_head *jh)
30+
static inline void __buffer_unlink(struct journal_head *jh)
3131
{
3232
transaction_t *transaction = jh->b_cp_transaction;
3333

@@ -40,23 +40,6 @@ static inline void __buffer_unlink_first(struct journal_head *jh)
4040
}
4141
}
4242

43-
/*
44-
* Unlink a buffer from a transaction checkpoint(io) list.
45-
*
46-
* Called with j_list_lock held.
47-
*/
48-
static inline void __buffer_unlink(struct journal_head *jh)
49-
{
50-
transaction_t *transaction = jh->b_cp_transaction;
51-
52-
__buffer_unlink_first(jh);
53-
if (transaction->t_checkpoint_io_list == jh) {
54-
transaction->t_checkpoint_io_list = jh->b_cpnext;
55-
if (transaction->t_checkpoint_io_list == jh)
56-
transaction->t_checkpoint_io_list = NULL;
57-
}
58-
}
59-
6043
/*
6144
* Check a checkpoint buffer could be release or not.
6245
*
@@ -503,15 +486,6 @@ unsigned long jbd2_journal_shrink_checkpoint_list(journal_t *journal,
503486
break;
504487
if (need_resched() || spin_needbreak(&journal->j_list_lock))
505488
break;
506-
if (released)
507-
continue;
508-
509-
nr_freed += journal_shrink_one_cp_list(transaction->t_checkpoint_io_list,
510-
nr_to_scan, &released);
511-
if (*nr_to_scan == 0)
512-
break;
513-
if (need_resched() || spin_needbreak(&journal->j_list_lock))
514-
break;
515489
} while (transaction != last_transaction);
516490

517491
if (transaction != last_transaction) {
@@ -566,17 +540,6 @@ void __jbd2_journal_clean_checkpoint_list(journal_t *journal, bool destroy)
566540
*/
567541
if (need_resched())
568542
return;
569-
if (ret)
570-
continue;
571-
/*
572-
* It is essential that we are as careful as in the case of
573-
* t_checkpoint_list with removing the buffer from the list as
574-
* we can possibly see not yet submitted buffers on io_list
575-
*/
576-
ret = journal_clean_one_cp_list(transaction->
577-
t_checkpoint_io_list, destroy);
578-
if (need_resched())
579-
return;
580543
/*
581544
* Stop scanning if we couldn't free the transaction. This
582545
* avoids pointless scanning of transactions which still
@@ -661,7 +624,7 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
661624
jbd2_journal_put_journal_head(jh);
662625

663626
/* Is this transaction empty? */
664-
if (transaction->t_checkpoint_list || transaction->t_checkpoint_io_list)
627+
if (transaction->t_checkpoint_list)
665628
return 0;
666629

667630
/*
@@ -753,7 +716,6 @@ void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transact
753716
J_ASSERT(transaction->t_forget == NULL);
754717
J_ASSERT(transaction->t_shadow_list == NULL);
755718
J_ASSERT(transaction->t_checkpoint_list == NULL);
756-
J_ASSERT(transaction->t_checkpoint_io_list == NULL);
757719
J_ASSERT(atomic_read(&transaction->t_updates) == 0);
758720
J_ASSERT(journal->j_committing_transaction != transaction);
759721
J_ASSERT(journal->j_running_transaction != transaction);

fs/jbd2/commit.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,8 +1141,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
11411141
spin_lock(&journal->j_list_lock);
11421142
commit_transaction->t_state = T_FINISHED;
11431143
/* Check if the transaction can be dropped now that we are finished */
1144-
if (commit_transaction->t_checkpoint_list == NULL &&
1145-
commit_transaction->t_checkpoint_io_list == NULL) {
1144+
if (commit_transaction->t_checkpoint_list == NULL) {
11461145
__jbd2_journal_drop_transaction(journal, commit_transaction);
11471146
jbd2_journal_free_transaction(commit_transaction);
11481147
}

include/linux/jbd2.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -613,12 +613,6 @@ struct transaction_s
613613
*/
614614
struct journal_head *t_checkpoint_list;
615615

616-
/*
617-
* Doubly-linked circular list of all buffers submitted for IO while
618-
* checkpointing. [j_list_lock]
619-
*/
620-
struct journal_head *t_checkpoint_io_list;
621-
622616
/*
623617
* Doubly-linked circular list of metadata buffers being
624618
* shadowed by log IO. The IO buffers on the iobuf list and

0 commit comments

Comments
 (0)