Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp860593pxj; Fri, 14 May 2021 18:54:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfrTCVc7lWp3AE+Xp3UEGOWiInfdXms4AvN3+6FwGAxuII3NPu7cWsSzMMKKAsPuNdWaLk X-Received: by 2002:a17:907:2628:: with SMTP id aq8mr50855423ejc.64.1621043645702; Fri, 14 May 2021 18:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621043645; cv=none; d=google.com; s=arc-20160816; b=jMNGU9NJqIDIdus9ysmIOWojdb3/weCDC+Ty5eFXqvP2Jec/6nJ7wmrMNSsUAsWM7s /pu1vKi4ZswTfLeGKftojx/kgyLZChiPQJQP7p+z8SJMlJ4m1K3nm2uo+uaAqSgr5QOx +4C2xpe6BNSNHclj+1VMeykAVsXTaBaQCy1ulvc6rZW5/Mw99CulGfzTlR3RMEtWJutl 0skxzv8X4GPwrs4N3JedT5I3aV6Tgn1mmE9lhTA19PZflGPveEgx+KI9209RPbhDnaCx 07VpEO0FjcH2V8bTPGwR9hLNtGGSv9aGRooTEM3JWVefj7otF/cahK/vsNWmwqTgz14c urow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=mEX6xHewprpN7BoLCD0ZSgU699oT1d5QrWIuCajGN3M=; b=p2Lgr8bvyyFkUFfR/fgh9DeBpu/CZ+7MAA/GXNRBLt7tHVcgGJU6wC0WTp1GBcLwhM /txHqGakVYRBhYRToKGjRm8+DGsj/u/caCOXj5Jpp/IvUchyNqkxOQFXxr6lPClcTuBN ZtD27gh4nw8noaia4Fg+s+NGgc84//iFAOZmOdBW8dwVwpY4RuSU7ZixzMRQLOOkTiWw 08TsCY1zFVw36BHY+HxY09SDu1UK82A8LaWr1BKjhFl3+SH0jQ3InRKUL89Jd4ZtA2Jv ePX3eLHdohEPLBP/fZ3FWrACvxDy8SLeydAZ/mN+ubtjruPaJZPLQcJRtH4vZAKxVRJX GBJA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u22si7339027edi.118.2021.05.14.18.53.41; Fri, 14 May 2021 18:54:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235066AbhENRIh (ORCPT + 99 others); Fri, 14 May 2021 13:08:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:39774 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235049AbhENRIg (ORCPT ); Fri, 14 May 2021 13:08:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0DA23B061; Fri, 14 May 2021 17:07:24 +0000 (UTC) Subject: Re: [PATCH v10 13/33] mm/filemap: Add folio_next_index To: "Matthew Wilcox (Oracle)" , akpm@linux-foundation.org Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Jeff Layton References: <20210511214735.1836149-1-willy@infradead.org> <20210511214735.1836149-14-willy@infradead.org> From: Vlastimil Babka Message-ID: <92518dfb-5624-62d7-9998-305587fc561c@suse.cz> Date: Fri, 14 May 2021 19:07:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210511214735.1836149-14-willy@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/11/21 11:47 PM, 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). > > Signed-off-by: Matthew Wilcox (Oracle) > Reviewed-by: Christoph Hellwig > Acked-by: Jeff Layton Acked-by: Vlastimil Babka > --- > include/linux/pagemap.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h > index 8eaeffccfd38..3b82252d12fc 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. > + */ > +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. >