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>
This commit is contained in:
Jeff Mahoney 2013-09-23 16:50:28 -04:00 committed by Jan Kara
parent 69d75671d9
commit 7bc9cc07ee
1 changed files with 0 additions and 62 deletions

View File

@ -1163,21 +1163,6 @@ static struct reiserfs_journal_list *find_newer_jl_for_cn(struct
return 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,
@ -1593,31 +1578,6 @@ static int flush_journal_list(struct super_block *s,
return 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)
@ -3868,27 +3828,6 @@ int reiserfs_prepare_for_journal(struct super_block *sb,
return 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.
@ -4232,7 +4171,6 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
}
}
}
flush_old_journal_lists(sb);
journal->j_current_jl->j_list_bitmap =
get_list_bitmap(sb, journal->j_current_jl);