[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YPaog6FqCWY+JQLk@kernel.org>
Date: Tue, 20 Jul 2021 13:42:11 +0300
From: Mike Rapoport <rppt@...nel.org>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-fsdevel@...r.kernel.org, Christoph Hellwig <hch@....de>,
Jeff Layton <jlayton@...nel.org>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Vlastimil Babka <vbabka@...e.cz>,
William Kucharski <william.kucharski@...cle.com>,
David Howells <dhowells@...hat.com>
Subject: Re: [PATCH v14 014/138] mm/filemap: Add folio_next_index()
On Thu, Jul 15, 2021 at 04:35:00AM +0100, Matthew Wilcox (Oracle) wrote:
> This helper returns the page index of the next folio in the file (ie
> the end of this folio, plus one).
>
> No changes to generated code.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
> Reviewed-by: Christoph Hellwig <hch@....de>
> Acked-by: Jeff Layton <jlayton@...nel.org>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> Acked-by: Vlastimil Babka <vbabka@...e.cz>
> Reviewed-by: William Kucharski <william.kucharski@...cle.com>
> Reviewed-by: David Howells <dhowells@...hat.com>
> ---
> include/linux/pagemap.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
Acked-by: Mike Rapoport <rppt@...ux.ibm.com>
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index f7c165b5991f..bd0e7e91bfd4 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -406,6 +406,17 @@ static inline pgoff_t folio_index(struct folio *folio)
> return folio->index;
> }
>
> +/**
> + * folio_next_index - Get the index of the next folio.
> + * @folio: The current folio.
> + *
> + * Return: The index of the folio which follows this folio in the file.
> + */
Maybe note that index is in units of pages?
> +static inline pgoff_t folio_next_index(struct folio *folio)
> +{
> + return folio->index + folio_nr_pages(folio);
> +}
> +
> /**
> * folio_file_page - The page for a particular index.
> * @folio: The folio which contains this index.
> --
> 2.30.2
>
>
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists