Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4433828pxv; Tue, 20 Jul 2021 03:47:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtM0YvkfprOnOD+hGX2XBs0+y7K7YEqCQRFqFGqenCnxpgQW2CWszFnBFihvY74BaYkFfP X-Received: by 2002:a5d:840c:: with SMTP id i12mr21837863ion.185.1626778052848; Tue, 20 Jul 2021 03:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626778052; cv=none; d=google.com; s=arc-20160816; b=whYC1XhpBR0kQtf8LR4hml0ZS46M4d+I21WBMA94eeVLDFFWra0Ntlxz4g4jygTn0w 9hoG/H7Cf09vij3d6mZedhwUzBawIOfklXnKU9flEazLMmAq0TaF6fnT2ZDqa7cyf7ro C34MMKTcD4jTpJl4YuiWtAiFHrCYCedFUOEWjahGbrvI6ujtSPmy1QvpfVIXDSJQM154 vR97a8wdljgMvdZVnj1u9KMp2G2SGde6654bT19ZhMnEAWeXfGBRDI9a7xhsClsaW72x C9JuA/gECnm6aUWRYkQv3wTVGSwb4q08kLnrmAXkygmSzcWevL4wEKAEnA1kMz2lMqce 29/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m9/0P0ABZ6wgcHS1Rg10ZeHvffSvNp0XdYEc2JTOskc=; b=MkKmbWuT08hXhH10DJt5oD+m+VKXtAk/3vrHhql9BQB4NgsKQ9xAG6Aq1b3Z0/6S0A XG5/kwe16MifyS4dRAYCovO7TrrO9b7dMpt5PxooXTSAq1ooN3LVSbhzG8mokXAhKX5r co8EVekit5JN6UysYYogB4VopkVAqmB3L25BwQwuIFDCuStzwi8Ko9TzbUvTdshh1EjB CVC4BwqInSNFe+esoguSfJjII/NVDGOvAD8hmF6j+7QTV6ut6nerQFGPO0Gt8KEPS7Jy I/yfTa4e/fo5CV0dIiQkhGXWfea48mHbE74tST9Q4KbFxqGowT9qO4loh2ZvThrkV28z ER+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FM/j2mW7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si22167454ilg.116.2021.07.20.03.47.14; Tue, 20 Jul 2021 03:47:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FM/j2mW7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235991AbhGTKEm (ORCPT + 99 others); Tue, 20 Jul 2021 06:04:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:34100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237417AbhGTKBl (ORCPT ); Tue, 20 Jul 2021 06:01:41 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.