Re: [PATCH] maple_tree: document that "last" in mtree_insert_range() is inclusive

From: SeongJae Park

Date: Sat May 09 2026 - 11:39:07 EST


On Sat, 9 May 2026 09:31:13 +0100 Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:

> On Fri, May 08, 2026 at 05:59:46PM -0700, SeongJae Park wrote:
> > > > * @first: The start of the range
> > > > * @last: The end of the range (inclusive)
> > >
> > >
> > > I like this.
> >
> > +1. I'm also wondering if it make sense to add '(inclusive)' for 'first', too.
>
> I can't think of a situation in computing where we use an
> exclusive-first. Pure mathematics, yes, we might want to express a
> range as (1,2) to exclude both 1 and 2 but include 1+epsilon for all
> epsilon > 0. Maybe I don't work with floating point numbers enough,
> but I've never seen a kernel programmer make an off-by-one with the
> start of a range. End-of-the-range is all too common.

Makes sense, thank you for sharing your thought for my silly question!


Thanks,
SJ