Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4434652pxv; Tue, 20 Jul 2021 03:48:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrjt3cqKGWMqesLaCiJeH3GxBe9lYWfi6pFRCT9TqTGLHpOihQr1AuagX7YV449CvMFC6a X-Received: by 2002:a92:cb0f:: with SMTP id s15mr21150979ilo.11.1626778134937; Tue, 20 Jul 2021 03:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626778134; cv=none; d=google.com; s=arc-20160816; b=eVZ5Em9P386hWgNXqnUvPLdib87FvQaH59IpVn/IK7iszX1IbNjRPk/gcL4pBIx+NP Yle1LWDkEJazZEOQ5nuVcd2/9mxh11+bjXMO/ANGkNtpwYF+Oc2acryIq2oDW7pCmWHz ULtaYS/lVG4ggPqeJ7acy3FK+I/MIIo0b0kodK2nHMGzzoQ4LKU3tseE4UBJo2BrbFBQ Xv434Q+vqwo3AXmEiEEL2DKXvjP2xw/VVTupaq33aDDJQpjpLMZQWyc2edH+xR1eQmFV z1mPuwINNF+a6k0t4LDorqWWSoYhf3ZXNanyMBmF3lkw52tpJD9/t6ANHWm9I4KFkHNr XakA== 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=WzNcl2bh8Eddludqa/rC+u2RYfKSKwrYq8x4J18zR6k=; b=01B8bgEQCGTbTRBkPNF6tJGTXUazAaDvcZicejW5Xv7J6JfpDNj2FmC69EieW4aMAe v7WTYRQ75Xa8nOKvdTnKpxGkxBLWE5g0WlUt8zXa19rhxhRelts0VOBLvoype68WkYr4 EZWd4vmLM0jThZm3TFSJzFFH7Q9divn9GYUD9wrUQblSsHfQRkH9ZMepqHtrcrqyZ9jb tRu31NZly7oTzcxVDnQX6S+u61WZa1phNfeZtWGmkuJvGXWWEl3Ffh9YnqWOqpKblXcj AWtsXEzu01L82DGi9WZHjkyp6qzMcGkIeLf6H35AUw8RDFkC5EGtqmq6NIa8JCrCwuCj zt5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bBcCzgAM; 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 n1si24946892ilt.39.2021.07.20.03.48.44; Tue, 20 Jul 2021 03:48:54 -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=bBcCzgAM; 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 S236206AbhGTKHJ (ORCPT + 99 others); Tue, 20 Jul 2021 06:07:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:34362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234146AbhGTKCO (ORCPT ); Tue, 20 Jul 2021 06:02:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6AE51611CE; Tue, 20 Jul 2021 10:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626777772; bh=z5E+2FUBOVAySTqfuxw0l4m0gqoXHnhMGtKhrkfnNGM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bBcCzgAMeR76urzgsIt6GN86Gsn0+YUmx2Rkts7GyOOXjlzV3DS1K23B4tYe6yn0l C8y7HrBH5FNLz/qGOK7dmlg33Or7M41RqEk1oddwuHMV4VchjlyvolOiSALA/i8iaP Tu1Btjs6YXpskMVAMbd3hBr4TSLyB1zwd0hYTL9A/1gzYfwkMgdQSa1B0SzGdN0wLq TQ3Kf+FDa4m/rZCv64vDl15nGy4cmCJoCheukehthAUnXRhEmT9Tq+HoDzkMg2NbEY by6zkebT0kxssXQwVDILeI2hNngt6g35d1PsmuB9yQQY88vZNHGnXQ/0QN5EQxHdRi ZyvnNdI+tZrHQ== Date: Tue, 20 Jul 2021 13:42:45 +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 015/138] mm/filemap: Add folio_pos() and folio_file_pos() Message-ID: References: <20210715033704.692967-1-willy@infradead.org> <20210715033704.692967-16-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715033704.692967-16-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 04:35:01AM +0100, Matthew Wilcox (Oracle) wrote: > These are just wrappers around page_offset() and page_file_offset() > respectively. No change 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 | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h > index bd0e7e91bfd4..aa71fa82d6be 100644 > --- a/include/linux/pagemap.h > +++ b/include/linux/pagemap.h > @@ -562,6 +562,27 @@ static inline loff_t page_file_offset(struct page *page) > return ((loff_t)page_index(page)) << PAGE_SHIFT; > } > > +/** > + * folio_pos - Returns the byte position of this folio in its file. > + * @folio: The folio. kerneldoc will warn about missing description of return value. > + */ > +static inline loff_t folio_pos(struct folio *folio) > +{ > + return page_offset(&folio->page); > +} > + > +/** > + * folio_file_pos - Returns the byte position of this folio in its file. > + * @folio: The folio. > + * > + * This differs from folio_pos() for folios which belong to a swap file. > + * NFS is the only filesystem today which needs to use folio_file_pos(). ditto > + */ > +static inline loff_t folio_file_pos(struct folio *folio) > +{ > + return page_file_offset(&folio->page); > +} > + > extern pgoff_t linear_hugepage_index(struct vm_area_struct *vma, > unsigned long address); > > -- > 2.30.2 > > -- Sincerely yours, Mike.