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

Johannes Thumshirn
2024-03-26T12:51:23Z

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@intel.com>
> Cc: Chris Mason <clm@fb.com>
> Cc: Josef Bacik <josef@toxicpanda.com>
> Cc: David Sterba <dsterba@suse.com>
> Cc: linux-btrfs@vger.kernel.org
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
>
> [1] https://lore.kernel.org/all/65949f79ef908_8dc68294f2@dwillia2-xfh.jf.intel.com.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@wdc.com>