From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE865C07E95 for ; Tue, 20 Jul 2021 10:42:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A4A0F6120C for ; Tue, 20 Jul 2021 10:42:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4A0F6120C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4F7AE6B00C9; Tue, 20 Jul 2021 06:42:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CE5F6B00CA; Tue, 20 Jul 2021 06:42:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36FCE6B00CC; Tue, 20 Jul 2021 06:42:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id 136936B00C9 for ; Tue, 20 Jul 2021 06:42:22 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 96FA4185044D7 for ; Tue, 20 Jul 2021 10:42:20 +0000 (UTC) X-FDA: 78382626840.01.B4EA50D Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf11.hostedemail.com (Postfix) with ESMTP id 4BCBBF000238 for ; Tue, 20 Jul 2021 10:42:20 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 3542D61165; Tue, 20 Jul 2021 10:42:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626777739; bh=xY34TkkfEyN2xJ5ULrS19fyp7oVXqEVk/9Z+3+xxUy4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FM/j2mW74IqGOOGh9MIUoDUhoLC5N1x85PdGTnmFpja9hFAH6P8ns1KvdSh+je1bb P9KPia8HXe4vNuN60JRZrlILhA9Kx1VFdXIfRxvt8nx0j1KLg2aTqn3D8HbbvM7BlM jDPEwo8xAxmwhjrZxY/q7F86nwvdJp8JHcj6nYbjL+32B6MaBKQdzxhPgfQyoQjuL/ NeNkMG//29cro9Cv1AqLVNDrcoF7sBNZowcs+6BpzG6BadYzbexza/jxcOIh9MXJRL JwwZL7D6olSb3oy30nQ/FRVs1Unl9pJZ+Z9xgELMatViPq8PI07CDg67J56xST1yng MBTAvtrkPTRvQ== Date: Tue, 20 Jul 2021 13:42:11 +0300 From: Mike Rapoport To: "Matthew Wilcox (Oracle)" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , Jeff Layton , "Kirill A . Shutemov" , Vlastimil Babka , William Kucharski , David Howells Subject: Re: [PATCH v14 014/138] mm/filemap: Add folio_next_index() Message-ID: References: <20210715033704.692967-1-willy@infradead.org> <20210715033704.692967-15-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715033704.692967-15-willy@infradead.org> Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="FM/j2mW7"; spf=pass (imf11.hostedemail.com: domain of rppt@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4BCBBF000238 X-Stat-Signature: utymwtt9uyw43esgiierky6ra95rrw66 X-HE-Tag: 1626777740-13171 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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) > Reviewed-by: Christoph Hellwig > Acked-by: Jeff Layton > Acked-by: Kirill A. Shutemov > Acked-by: Vlastimil Babka > Reviewed-by: William Kucharski > Reviewed-by: David Howells > --- > include/linux/pagemap.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) Acked-by: Mike Rapoport > 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.