reiserfs: remove useless flush_old_journal_lists
PATCH 1/2 reiserfs: remove useless flush_old_journal_lists
Commit a3172027 introduced test_transaction as a requirement for flushing old lists -- but it can never return 1 unless the transaction has already been flushed.
As a result, we have a routine that iterates the j_realblocks list but doesn't actually do anything. Since it's been this way since 2006 and the latency numbers were what Chris expected, let's just rip it out.
--- fs/reiserfs/journal.c | 62 -------------------------------------------------- 1 file changed, 62 deletions(-)
fs/reiserfs/journal.c +0 -62
@@ -1173,21 +1173,6 @@ static struct reiserfs_journal_list *finreturn NULL ; } -static int newer_jl_done (struct reiserfs_journal_cnode *cn) -{ -struct super_block *sb = cn->sb; -b_blocknr_t blocknr = cn->blocknr; - - cn = cn->hprev; -while (cn) { -if (cn->sb == sb && cn->blocknr == blocknr && cn->jlist && -atomic_read (&cn->jlist->j_commit_left) !=0 ) -return 0 ; - cn = cn->hprev; - } -return 1 ; -} - static void remove_journal_hash(struct super_block *, struct reiserfs_journal_cnode **, struct reiserfs_journal_list *, unsigned long,
@@ -1606,31 +1591,6 @@ static int flush_journal_list(struct supreturn err; } -static int test_transaction (struct super_block *s, -struct reiserfs_journal_list *jl) -{ -struct reiserfs_journal_cnode *cn; - -if (jl->j_len ==0 ||atomic_read (&jl->j_nonzerolen) ==0 ) -return 1 ; - - cn = jl->j_realblock; -while (cn) { -/* if the blocknr == 0, this has been cleared from the hash, -** skip it -*/ -if (cn->blocknr ==0 ) { - goto next; - } -if (cn->bh && !newer_jl_done (cn)) -return 0 ; - next: - cn = cn->next; -cond_resched (); - } -return 0 ; -} -static int write_one_transaction (struct super_block *s,struct reiserfs_journal_list *jl,struct buffer_chunk *chunk)
@@ -3897,27 +3857,6 @@ int reiserfs_prepare_for_journal(structreturn 1 ; } -static void flush_old_journal_lists (struct super_block *s) -{ -struct reiserfs_journal *journal =SB_JOURNAL (s); -struct reiserfs_journal_list *jl; -struct list_head *entry; -time_t now =get_seconds (); - -while (!list_empty (&journal->j_journal_list)) { - entry = journal->j_journal_list.next; - jl =JOURNAL_LIST_ENTRY (entry); -/* this check should always be run, to send old lists to disk */ -if (jl->j_timestamp < (now - (JOURNAL_MAX_TRANS_AGE *4 )) && -atomic_read (&jl->j_commit_left) ==0 && -test_transaction (s, jl)) { -flush_used_journal_lists (s, jl); - }else { -break ; - } - } -} -/* ** long and ugly. If flush, will not return until all commit ** blocks and all real buffers in the trans are on disk.
@@ -4262,7 +4201,6 @@ static int do_journal_end(struct reiserf } } } -flush_old_journal_lists (sb); journal->j_current_jl->j_list_bitmap =get_list_bitmap (sb, journal->j_current_jl);
Signature · 2 lines
Jeff Mahoney SUSE Labs
Quoted 9 lines · Jeff Mahoney
Commit
a3172027introducedtest_transactionas a requirement for flushing old lists -- but it can never return 1 unless the transaction has already been flushed.As a result, we have a routine that iterates the
j_realblockslist but doesn't actually do anything. Since it's been this way since 2006 and the latency numbers were what Chris expected, let's just rip it out.Signed-off-by Jeff Mahoney <[email protected]>
Thanks. I've merged the patch into my tree.
Honza
Quoted 101 lines
--- fs/reiserfs/journal.c | 62 -------------------------------------------------- 1 file changed, 62 deletions(-)fs/reiserfs/journal.c +0
-62@@ -1173,21 +1173,6 @@ static struct reiserfs_journal_list *finreturn NULL ; } -static int newer_jl_done (struct reiserfs_journal_cnode *cn) -{ -struct super_block *sb = cn->sb; -b_blocknr_t blocknr = cn->blocknr; - - cn = cn->hprev; -while (cn) { -if (cn->sb == sb && cn->blocknr == blocknr && cn->jlist && -atomic_read (&cn->jlist->j_commit_left) !=0 ) -return 0 ; - cn = cn->hprev; - } -return 1 ; -} - static void remove_journal_hash(struct super_block *, struct reiserfs_journal_cnode **, struct reiserfs_journal_list *, unsigned long,@@ -1606,31 +1591,6 @@ static int flush_journal_list(struct supreturn err; } -static int test_transaction (struct super_block *s, -struct reiserfs_journal_list *jl) -{ -struct reiserfs_journal_cnode *cn; - -if (jl->j_len ==0 ||atomic_read (&jl->j_nonzerolen) ==0 ) -return 1 ; - - cn = jl->j_realblock; -while (cn) { -/* if the blocknr == 0, this has been cleared from the hash, -** skip it -*/ -if (cn->blocknr ==0 ) { - goto next; - } -if (cn->bh && !newer_jl_done (cn)) -return 0 ; - next: - cn = cn->next; -cond_resched (); - } -return 0 ; -} -static int write_one_transaction (struct super_block *s,struct reiserfs_journal_list *jl,struct buffer_chunk *chunk)@@ -3897,27 +3857,6 @@ int reiserfs_prepare_for_journal(structreturn 1 ; } -static void flush_old_journal_lists (struct super_block *s) -{ -struct reiserfs_journal *journal =SB_JOURNAL (s); -struct reiserfs_journal_list *jl; -struct list_head *entry; -time_t now =get_seconds (); - -while (!list_empty (&journal->j_journal_list)) { - entry = journal->j_journal_list.next; - jl =JOURNAL_LIST_ENTRY (entry); -/* this check should always be run, to send old lists to disk */ -if (jl->j_timestamp < (now - (JOURNAL_MAX_TRANS_AGE *4 )) && -atomic_read (&jl->j_commit_left) ==0 && -test_transaction (s, jl)) { -flush_used_journal_lists (s, jl); - }else { -break ; - } - } -} -/* ** long and ugly. If flush, will not return until all commit ** blocks and all real buffers in the trans are on disk. @@ -4262,7 +4201,6 @@ static int do_journal_end(struct reiserf } } } -flush_old_journal_lists (sb); journal->j_current_jl->j_list_bitmap =get_list_bitmap (sb, journal->j_current_jl);Signature · 3 lines
-- Jeff Mahoney SUSE Labs
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR