Re: [PATCH 05/10] btrfs-progs: adjust function btrfs_lookup_first_block_group_kernel

Qu Wenruo
2019-12-05T07:41:02Z

[-- Attachment #1.1: Type: text/plain, Size: 1249 bytes --]

On 2019/12/5 下午12:29, damenly.su@gmail.com wrote:
> From: Su Yue <Damenly_Su@gmx.com>
>
> The are different behavior of btrfs_lookup_first_block_group() and
> btrfs_lookup_first_block_group_kernel(). Unify the latter' behavior.
>
> Signed-off-by: Su Yue <Damenly_Su@gmx.com>

Is it possible to modify the specific callers in btrfs-progs to make
them use the kernel behavior other than re-inventing some new behavior?

Thanks,
Qu

> ---
> extent-tree.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/extent-tree.c b/extent-tree.c
> index 1d8535049eaf..274dfe540b1f 100644
> --- a/extent-tree.c
> +++ b/extent-tree.c
> @@ -243,12 +243,13 @@ static struct btrfs_block_group_cache *block_group_cache_tree_search(
> }
>
> /*
> - * Return the block group that starts at or after bytenr
> + * Return the block group that contains @bytenr, otherwise return the next one
> + * that starts after @bytenr
> */
> struct btrfs_block_group_cache *btrfs_lookup_first_block_group_kernel(
> struct btrfs_fs_info *info, u64 bytenr)
> {
> - return block_group_cache_tree_search(info, bytenr, 0);
> + return block_group_cache_tree_search(info, bytenr, 2);
> }
>
> /*
>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]