linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org, dsterba@suse.cz
Subject: Re: [PATCH 5/7] btrfs-progs: volumes: Allow find_free_dev_extent() to return maximum hole size
Date: Fri, 2 Feb 2018 13:41:29 +0200	[thread overview]
Message-ID: <295a561d-dc4c-8a05-ac51-02d3ab24c278@suse.com> (raw)
In-Reply-To: <20180202081929.15162-6-wqu@suse.com>



On  2.02.2018 10:19, Qu Wenruo wrote:
> Just as kernel find_free_dev_extent(), allow it to return maximum hole
> size for us to build device list for later chunk allocator rework.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  volumes.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/volumes.c b/volumes.c
> index b47ff1f392b5..f4009ffa7c9e 100644
> --- a/volumes.c
> +++ b/volumes.c
> @@ -516,10 +516,10 @@ out:
>  }
>  
>  static int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes,
> -				u64 *start)
> +				u64 *start, u64 *len)
>  {
>  	/* FIXME use last free of some kind */
> -	return find_free_dev_extent_start(device, num_bytes, 0, start, NULL);
> +	return find_free_dev_extent_start(device, num_bytes, 0, start, len);

Why do we need the free_dev_extent() wrapper over free_dev_extent_start
at all?
>  }
>  
>  static int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
> @@ -543,7 +543,7 @@ static int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
>  	 * is responsible to make sure it's free.
>  	 */
>  	if (!convert) {
> -		ret = find_free_dev_extent(device, num_bytes, start);
> +		ret = find_free_dev_extent(device, num_bytes, start, NULL);
>  		if (ret)
>  			goto err;
>  	}
>

  reply	other threads:[~2018-02-02 11:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02  8:19 [PATCH 0/7] Chunk allocator unification Qu Wenruo
2018-02-02  8:19 ` [PATCH 1/7] btrfs-progs: Refactor parameter of BTRFS_MAX_DEVS() from root to fs_info Qu Wenruo
2018-02-02  8:19 ` [PATCH 2/7] btrfs-progs: Merge btrfs_alloc_data_chunk into btrfs_alloc_chunk Qu Wenruo
2018-02-02  9:20   ` Su Yue
2018-02-02  9:41     ` Qu Wenruo
2018-02-02  9:54       ` Su Yue
2018-02-02  8:19 ` [PATCH 3/7] btrfs-progs: Make btrfs_alloc_chunk to handle block group creation Qu Wenruo
2018-02-02 11:33   ` Nikolay Borisov
2018-02-02  8:19 ` [PATCH 4/7] btrfs-progs: Introduce btrfs_raid_array and related infrastructures Qu Wenruo
2018-02-02 11:37   ` Nikolay Borisov
2018-02-02 11:53     ` Qu Wenruo
2018-02-02  8:19 ` [PATCH 5/7] btrfs-progs: volumes: Allow find_free_dev_extent() to return maximum hole size Qu Wenruo
2018-02-02 11:41   ` Nikolay Borisov [this message]
2018-02-02 11:49     ` Qu Wenruo
2018-02-02 11:57       ` Nikolay Borisov
2018-02-02  8:19 ` [PATCH 6/7] btrfs-progs: kernel-lib: Port kernel sort() to btrfs-progs Qu Wenruo
2018-02-02  8:19 ` [PATCH 7/7] btrfs-progs: volumes: Unify free dev extent search behavior between kernel and btrfs-progs Qu Wenruo

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=295a561d-dc4c-8a05-ac51-02d3ab24c278@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /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).