Re: [PATCH 15/26] range: Add range_overlaps()

From: Johannes Thumshirn
Date: Tue Mar 26 2024 - 08:51:36 EST


On 25.03.24 04:51, Ira Weiny wrote:
> Code to support CXL Dynamic Capacity devices will have extent ranges
> which need to be compared for intersection not a subset as is being
> checked in range_contains().
>
> range_overlaps() is defined in btrfs with a different meaning from what
> is required in the standard range code. Dan Williams pointed this out
> in [1]. Adjust the btrfs call according to his suggestion there.
>
> Then add a generic range_overlaps().
>
> Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
> Cc: Chris Mason <clm@xxxxxx>
> Cc: Josef Bacik <josef@xxxxxxxxxxxxxx>
> Cc: David Sterba <dsterba@xxxxxxxx>
> Cc: linux-btrfs@xxxxxxxxxxxxxxx
> Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
>
> [1] https://lore.kernel.org/all/65949f79ef908_8dc68294f2@xxxxxxxxxxxxxxxxxxxxxxxxx.notmuch/
> ---
> fs/btrfs/ordered-data.c | 10 +++++-----
> include/linux/range.h | 7 +++++++
> 2 files changed, 12 insertions(+), 5 deletions(-)

For fs/btrfs/ordered-data.c:
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>