Skip to content

Commit 26770a7

Browse files
Ye Bintytso
authored andcommitted
jbd2: add prefix 'jbd2' for 'shrink_type'
As 'shrink_type' is exported. The module prefix 'jbd2' is added to distinguish from memory reclamation. Signed-off-by: Ye Bin <yebin10@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Link: https://lore.kernel.org/r/20240407065355.1528580-3-yebin10@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 078760d commit 26770a7

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

fs/jbd2/checkpoint.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal)
348348
* Called with j_list_lock held.
349349
*/
350350
static unsigned long journal_shrink_one_cp_list(struct journal_head *jh,
351-
enum shrink_type type,
351+
enum jbd2_shrink_type type,
352352
bool *released)
353353
{
354354
struct journal_head *last_jh;
@@ -365,12 +365,12 @@ static unsigned long journal_shrink_one_cp_list(struct journal_head *jh,
365365
jh = next_jh;
366366
next_jh = jh->b_cpnext;
367367

368-
if (type == SHRINK_DESTROY) {
368+
if (type == JBD2_SHRINK_DESTROY) {
369369
ret = __jbd2_journal_remove_checkpoint(jh);
370370
} else {
371371
ret = jbd2_journal_try_remove_checkpoint(jh);
372372
if (ret < 0) {
373-
if (type == SHRINK_BUSY_SKIP)
373+
if (type == JBD2_SHRINK_BUSY_SKIP)
374374
continue;
375375
break;
376376
}
@@ -437,7 +437,7 @@ unsigned long jbd2_journal_shrink_checkpoint_list(journal_t *journal,
437437
tid = transaction->t_tid;
438438

439439
freed = journal_shrink_one_cp_list(transaction->t_checkpoint_list,
440-
SHRINK_BUSY_SKIP, &released);
440+
JBD2_SHRINK_BUSY_SKIP, &released);
441441
nr_freed += freed;
442442
(*nr_to_scan) -= min(*nr_to_scan, freed);
443443
if (*nr_to_scan == 0)
@@ -470,20 +470,20 @@ unsigned long jbd2_journal_shrink_checkpoint_list(journal_t *journal,
470470
* journal_clean_checkpoint_list
471471
*
472472
* Find all the written-back checkpoint buffers in the journal and release them.
473-
* If 'type' is SHRINK_DESTROY, release all buffers unconditionally. If 'type'
474-
* is SHRINK_BUSY_STOP, will stop release buffers if encounters a busy buffer.
475-
* To avoid wasting CPU cycles scanning the buffer list in some cases, don't
476-
* pass SHRINK_BUSY_SKIP 'type' for this function.
473+
* If 'type' is JBD2_SHRINK_DESTROY, release all buffers unconditionally. If
474+
* 'type' is JBD2_SHRINK_BUSY_STOP, will stop release buffers if encounters a
475+
* busy buffer. To avoid wasting CPU cycles scanning the buffer list in some
476+
* cases, don't pass JBD2_SHRINK_BUSY_SKIP 'type' for this function.
477477
*
478478
* Called with j_list_lock held.
479479
*/
480480
void __jbd2_journal_clean_checkpoint_list(journal_t *journal,
481-
enum shrink_type type)
481+
enum jbd2_shrink_type type)
482482
{
483483
transaction_t *transaction, *last_transaction, *next_transaction;
484484
bool released;
485485

486-
WARN_ON_ONCE(type == SHRINK_BUSY_SKIP);
486+
WARN_ON_ONCE(type == JBD2_SHRINK_BUSY_SKIP);
487487

488488
transaction = journal->j_checkpoint_transactions;
489489
if (!transaction)
@@ -529,7 +529,7 @@ void jbd2_journal_destroy_checkpoint(journal_t *journal)
529529
spin_unlock(&journal->j_list_lock);
530530
break;
531531
}
532-
__jbd2_journal_clean_checkpoint_list(journal, SHRINK_DESTROY);
532+
__jbd2_journal_clean_checkpoint_list(journal, JBD2_SHRINK_DESTROY);
533533
spin_unlock(&journal->j_list_lock);
534534
cond_resched();
535535
}

fs/jbd2/commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
501501
* frees some memory
502502
*/
503503
spin_lock(&journal->j_list_lock);
504-
__jbd2_journal_clean_checkpoint_list(journal, SHRINK_BUSY_STOP);
504+
__jbd2_journal_clean_checkpoint_list(journal, JBD2_SHRINK_BUSY_STOP);
505505
spin_unlock(&journal->j_list_lock);
506506

507507
jbd2_debug(3, "JBD2: commit phase 1\n");

include/linux/jbd2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,9 +1434,9 @@ void jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block);
14341434
extern void jbd2_journal_commit_transaction(journal_t *);
14351435

14361436
/* Checkpoint list management */
1437-
enum shrink_type {SHRINK_DESTROY, SHRINK_BUSY_STOP, SHRINK_BUSY_SKIP};
1437+
enum jbd2_shrink_type {JBD2_SHRINK_DESTROY, JBD2_SHRINK_BUSY_STOP, JBD2_SHRINK_BUSY_SKIP};
14381438

1439-
void __jbd2_journal_clean_checkpoint_list(journal_t *journal, enum shrink_type type);
1439+
void __jbd2_journal_clean_checkpoint_list(journal_t *journal, enum jbd2_shrink_type type);
14401440
unsigned long jbd2_journal_shrink_checkpoint_list(journal_t *journal, unsigned long *nr_to_scan);
14411441
int __jbd2_journal_remove_checkpoint(struct journal_head *);
14421442
int jbd2_journal_try_remove_checkpoint(struct journal_head *jh);

0 commit comments

Comments
 (0)