From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from victor.provo.novell.com ([137.65.250.26]:45447 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751049AbeBIHov (ORCPT ); Fri, 9 Feb 2018 02:44:51 -0500 From: Qu Wenruo To: linux-btrfs@vger.kernel.org, dsterba@suse.cz Subject: [PATCH v2 05/10] btrfs-progs: volumes: Allow find_free_dev_extent() to return maximum hole size Date: Fri, 9 Feb 2018 15:44:23 +0800 Message-Id: <20180209074428.29187-7-wqu@suse.com> In-Reply-To: <20180209074428.29187-1-wqu@suse.com> References: <20180209074428.29187-1-wqu@suse.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: 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 --- 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); } 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; } -- 2.16.1