Skip to content

Commit 7bc9cc0

Browse files
jeffmahoneyjankara
authored andcommitted
reiserfs: remove useless flush_old_journal_lists
Commit a317202 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>
1 parent 69d7567 commit 7bc9cc0

1 file changed

Lines changed: 0 additions & 62 deletions

File tree

‎fs/reiserfs/journal.c‎

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,21 +1163,6 @@ static struct reiserfs_journal_list *find_newer_jl_for_cn(struct
11631163
return NULL;
11641164
}
11651165

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-
11811166
static void remove_journal_hash(struct super_block *,
11821167
struct reiserfs_journal_cnode **,
11831168
struct reiserfs_journal_list *, unsigned long,
@@ -1593,31 +1578,6 @@ static int flush_journal_list(struct super_block *s,
15931578
return err;
15941579
}
15951580

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-
16211581
static int write_one_transaction(struct super_block *s,
16221582
struct reiserfs_journal_list *jl,
16231583
struct buffer_chunk *chunk)
@@ -3868,27 +3828,6 @@ int reiserfs_prepare_for_journal(struct super_block *sb,
38683828
return 1;
38693829
}
38703830

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-
38923831
/*
38933832
** long and ugly. If flush, will not return until all commit
38943833
** 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,
42324171
}
42334172
}
42344173
}
4235-
flush_old_journal_lists(sb);
42364174

42374175
journal->j_current_jl->j_list_bitmap =
42384176
get_list_bitmap(sb, journal->j_current_jl);

0 commit comments

Comments
 (0)