Re: [PATCH 1/2] reiserfs: remove useless flush_old_journal_lists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
  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@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux