linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: Arne Jansen <sensille@gmx.net>
Cc: chris.mason@oracle.com, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v4 1/7] btrfs: add an extra wait mode to read_extent_buffer_pages
Date: Wed, 29 Jun 2011 16:50:25 -0400	[thread overview]
Message-ID: <4E0B9011.4050902@redhat.com> (raw)
In-Reply-To: <85d9e7d63ee2492ae15c2693654d3837e6037ad2.1309375866.git.sensille@gmx.net>

On 06/29/2011 04:10 PM, Arne Jansen wrote:
> read_extent_buffer_pages currently has two modes, either trigger a read
> without waiting for anything, or wait for the I/O to finish. The former
> also bails when it's unable to lock the page. This patch now adds an
> additional parameter to allow it to block on page lock, but don't wait
> for completion.
> 
> Signed-off-by: Arne Jansen <sensille@gmx.net>
> ---
>  fs/btrfs/disk-io.c   |    4 ++--
>  fs/btrfs/extent_io.c |    6 +++---
>  fs/btrfs/extent_io.h |    3 ++-
>  3 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 1ac8db5d..cff882c 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -325,7 +325,7 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root,
>  	clear_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags);
>  	io_tree = &BTRFS_I(root->fs_info->btree_inode)->io_tree;
>  	while (1) {
> -		ret = read_extent_buffer_pages(io_tree, eb, start, 1,
> +		ret = read_extent_buffer_pages(io_tree, eb, start, 1, 1,
>  					       btree_get_extent, mirror_num);
>  		if (!ret &&
>  		    !verify_parent_transid(io_tree, eb, parent_transid))
> @@ -940,7 +940,7 @@ int readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize,
>  	if (!buf)
>  		return 0;
>  	read_extent_buffer_pages(&BTRFS_I(btree_inode)->io_tree,
> -				 buf, 0, 0, btree_get_extent, 0);
> +				 buf, 0, 0, 0, btree_get_extent, 0);
>  	free_extent_buffer(buf);
>  	return ret;
>  }
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index b181a94..b7f0b9b 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3358,7 +3358,7 @@ int extent_buffer_uptodate(struct extent_io_tree *tree,
>  
>  int read_extent_buffer_pages(struct extent_io_tree *tree,
>  			     struct extent_buffer *eb,
> -			     u64 start, int wait,
> +			     u64 start, int wait_lock, int wait_complete,
>  			     get_extent_t *get_extent, int mirror_num)

Don't do this, it makes it confusing to figure out which one is which.
Add a flags parameter at the end so we can specify stuff like

WAIT_COMPLETE
WAIT_PAGE_LOCK

which is easier to read.  Thanks,

Josef

  reply	other threads:[~2011-06-29 20:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29 20:10 [PATCH v4 0/6] btrfs: generic readeahead interface Arne Jansen
2011-06-29 20:10 ` [PATCH v4 1/7] btrfs: add an extra wait mode to read_extent_buffer_pages Arne Jansen
2011-06-29 20:50   ` Josef Bacik [this message]
2011-06-29 20:10 ` [PATCH v4 2/7] btrfs: add READAHEAD extent buffer flag Arne Jansen
2011-06-29 20:55   ` Josef Bacik
2011-06-29 20:10 ` [PATCH v4 3/7] btrfs: state information for readahead Arne Jansen
2011-06-29 20:58   ` Josef Bacik
2011-06-29 20:10 ` [PATCH v4 4/7] btrfs: initial readahead code and prototypes Arne Jansen
2011-06-29 21:49   ` Josef Bacik
2011-06-30  7:37     ` Arne Jansen
2011-06-30 12:49       ` Josef Bacik
2011-06-30 14:01         ` Arne Jansen
2011-06-29 20:10 ` [PATCH v4 5/7] btrfs: hooks for readahead Arne Jansen
2011-06-29 20:10 ` [PATCH v4 6/7] btrfs: test ioctl " Arne Jansen
2011-06-29 20:10 ` [PATCH v4 7/7] btrfs: use readahead API for scrub Arne Jansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E0B9011.4050902@redhat.com \
    --to=josef@redhat.com \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sensille@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).