Commit 7bc9cc07ee5bbac58bab88e8a5d6e32785f8fd32
Committed by
Jan Kara
1 parent
69d75671d9
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
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. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
Showing 1 changed file with 0 additions and 62 deletions Side-by-side Diff
fs/reiserfs/journal.c
... | ... | @@ -1163,21 +1163,6 @@ |
1163 | 1163 | return NULL; |
1164 | 1164 | } |
1165 | 1165 | |
1166 | -static int newer_jl_done(struct reiserfs_journal_cnode *cn) | |
1167 | -{ | |
1168 | - struct super_block *sb = cn->sb; | |
1169 | - b_blocknr_t blocknr = cn->blocknr; | |
1170 | - | |
1171 | - cn = cn->hprev; | |
1172 | - while (cn) { | |
1173 | - if (cn->sb == sb && cn->blocknr == blocknr && cn->jlist && | |
1174 | - atomic_read(&cn->jlist->j_commit_left) != 0) | |
1175 | - return 0; | |
1176 | - cn = cn->hprev; | |
1177 | - } | |
1178 | - return 1; | |
1179 | -} | |
1180 | - | |
1181 | 1166 | static void remove_journal_hash(struct super_block *, |
1182 | 1167 | struct reiserfs_journal_cnode **, |
1183 | 1168 | struct reiserfs_journal_list *, unsigned long, |
... | ... | @@ -1593,31 +1578,6 @@ |
1593 | 1578 | return err; |
1594 | 1579 | } |
1595 | 1580 | |
1596 | -static int test_transaction(struct super_block *s, | |
1597 | - struct reiserfs_journal_list *jl) | |
1598 | -{ | |
1599 | - struct reiserfs_journal_cnode *cn; | |
1600 | - | |
1601 | - if (jl->j_len == 0 || atomic_read(&jl->j_nonzerolen) == 0) | |
1602 | - return 1; | |
1603 | - | |
1604 | - cn = jl->j_realblock; | |
1605 | - while (cn) { | |
1606 | - /* if the blocknr == 0, this has been cleared from the hash, | |
1607 | - ** skip it | |
1608 | - */ | |
1609 | - if (cn->blocknr == 0) { | |
1610 | - goto next; | |
1611 | - } | |
1612 | - if (cn->bh && !newer_jl_done(cn)) | |
1613 | - return 0; | |
1614 | - next: | |
1615 | - cn = cn->next; | |
1616 | - cond_resched(); | |
1617 | - } | |
1618 | - return 0; | |
1619 | -} | |
1620 | - | |
1621 | 1581 | static int write_one_transaction(struct super_block *s, |
1622 | 1582 | struct reiserfs_journal_list *jl, |
1623 | 1583 | struct buffer_chunk *chunk) |
... | ... | @@ -3868,27 +3828,6 @@ |
3868 | 3828 | return 1; |
3869 | 3829 | } |
3870 | 3830 | |
3871 | -static void flush_old_journal_lists(struct super_block *s) | |
3872 | -{ | |
3873 | - struct reiserfs_journal *journal = SB_JOURNAL(s); | |
3874 | - struct reiserfs_journal_list *jl; | |
3875 | - struct list_head *entry; | |
3876 | - time_t now = get_seconds(); | |
3877 | - | |
3878 | - while (!list_empty(&journal->j_journal_list)) { | |
3879 | - entry = journal->j_journal_list.next; | |
3880 | - jl = JOURNAL_LIST_ENTRY(entry); | |
3881 | - /* this check should always be run, to send old lists to disk */ | |
3882 | - if (jl->j_timestamp < (now - (JOURNAL_MAX_TRANS_AGE * 4)) && | |
3883 | - atomic_read(&jl->j_commit_left) == 0 && | |
3884 | - test_transaction(s, jl)) { | |
3885 | - flush_used_journal_lists(s, jl); | |
3886 | - } else { | |
3887 | - break; | |
3888 | - } | |
3889 | - } | |
3890 | -} | |
3891 | - | |
3892 | 3831 | /* |
3893 | 3832 | ** long and ugly. If flush, will not return until all commit |
3894 | 3833 | ** blocks and all real buffers in the trans are on disk. |
... | ... | @@ -4232,7 +4171,6 @@ |
4232 | 4171 | } |
4233 | 4172 | } |
4234 | 4173 | } |
4235 | - flush_old_journal_lists(sb); | |
4236 | 4174 | |
4237 | 4175 | journal->j_current_jl->j_list_bitmap = |
4238 | 4176 | get_list_bitmap(sb, journal->j_current_jl); |