[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANe_+UgS7Gh2i=aPQYO4nrLJ4kL-2kkkrj8Q1kUztsWAAPOWDQ@mail.gmail.com>
Date: Wed, 16 Feb 2022 10:50:59 +0000
From: Mark Hemment <markhemm@...glemail.com>
To: Liam Howlett <liam.howlett@...cle.com>
Cc: "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v6 11/71] mm: Add VMA iterator
On Tue, 15 Feb 2022 at 14:43, Liam Howlett <liam.howlett@...cle.com> wrote:
>
> From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
>
> This thin layer of abstraction over the maple tree state is for
> iterating over VMAs. You can go forwards, go backwards or ask where
> the iterator is. Rename the existing vma_next() to __vma_next() --
> it will be removed by the end of this series.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
> Acked-by: Vlastimil Babka <vbabka@...e.cz>
> ---
> include/linux/mm.h | 31 +++++++++++++++++++++++++++++++
> include/linux/mm_types.h | 21 +++++++++++++++++++++
> mm/mmap.c | 10 +++++-----
> 3 files changed, 57 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> +/* The MM code likes to work with exclusive end addresses */
> +#define for_each_vma_range(vmi, vma, end) \
> + while ((vma = vma_find(&vmi, end - 1)) != NULL)
> +
Becareful of operator precedence; parentheses around "end'".
Cheers,
Masrk
Powered by blists - more mailing lists