lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230515202650.3psyybdg64ptmx6i@revolver>
Date:   Mon, 15 May 2023 16:26:50 -0400
From:   "Liam R. Howlett" <Liam.Howlett@...cle.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     maple-tree@...ts.infradead.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 28/35] maple_tree: Add mas_next_range() and
 mas_find_range() interfaces

* Andrew Morton <akpm@...ux-foundation.org> [230512 19:09]:
> On Fri, 12 May 2023 14:20:29 -0400 "Liam R. Howlett" <Liam.Howlett@...cle.com> wrote:
> 
> > Some users of the maple tree may want to move to the next range in the
> > tree, even if it stores a NULL.  This family of function provides that
> > functionality by advancing one slot at a time and returning the result,
> > while mas_contiguous() will iterate over the range and stop on
> > encountering the first NULL.
> > 
> > ...
> >  
> > +/**
> > + * mas_contiguous() - Iterate over a contiguous range of the maple tree.
> > + * @__mas: Maple Tree operation state (maple_state)
> > + * @__entry: Entry retrieved from the tree
> > + * @__max: maximum index to retrieve from the tree
> > + *
> > + * When returned, mas->index and mas->last will hold the entire range of the
> > + * entry.  The loop will terminate on the first NULL encountered.
> > + *
> > + * Note: may return the zero entry.
> > + */
> > +#define mas_contiguous(__mas, __entry, __max) \
> > +	while (((__entry) = mas_find_range((__mas), (__max))) != NULL)
> >  
> 
> I can's say I'm a fan of this.  The name doesn't imply that this is a
> looping construct.  I can't say much more because mas_contiguous() has
> no users..

I got a little ahead of myself with that.  I will drop it.

My hope is to introduce it to simplify the cases where users are
iterating over VMAs and want them contiguous.

I'll come up with a better name when I re-introduce it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ