* [PATCH 1/2] reiserfs: remove useless flush_old_journal_lists
@ 2013-09-23 20:50 Jeff Mahoney
2013-09-24 9:11 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Mahoney @ 2013-09-23 20:50 UTC (permalink / raw)
To: reiserfs-devel; +Cc: Jan Kara
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>
---
fs/reiserfs/journal.c | 62 --------------------------------------------------
1 file changed, 62 deletions(-)
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -1173,21 +1173,6 @@ static struct reiserfs_journal_list *fin
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,
@@ -1606,31 +1591,6 @@ static int flush_journal_list(struct sup
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)
@@ -3897,27 +3857,6 @@ int reiserfs_prepare_for_journal(struct
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.
@@ -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);
--
Jeff Mahoney
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] reiserfs: remove useless flush_old_journal_lists
2013-09-23 20:50 [PATCH 1/2] reiserfs: remove useless flush_old_journal_lists Jeff Mahoney
@ 2013-09-24 9:11 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2013-09-24 9:11 UTC (permalink / raw)
To: Jeff Mahoney; +Cc: reiserfs-devel, Jan Kara
On Mon 23-09-13 16:50:28, Jeff Mahoney wrote:
> 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>
Thanks. I've merged the patch into my tree.
Honza
> ---
> fs/reiserfs/journal.c | 62 --------------------------------------------------
> 1 file changed, 62 deletions(-)
>
> --- a/fs/reiserfs/journal.c
> +++ b/fs/reiserfs/journal.c
> @@ -1173,21 +1173,6 @@ static struct reiserfs_journal_list *fin
> 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,
> @@ -1606,31 +1591,6 @@ static int flush_journal_list(struct sup
> 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)
> @@ -3897,27 +3857,6 @@ int reiserfs_prepare_for_journal(struct
> 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.
> @@ -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);
>
>
> --
> Jeff Mahoney
> SUSE Labs
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-24 9:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23 20:50 [PATCH 1/2] reiserfs: remove useless flush_old_journal_lists Jeff Mahoney
2013-09-24 9:11 ` Jan Kara
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.