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=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 00087C43457 for ; Thu, 15 Oct 2020 09:51:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56C7A22265 for ; Thu, 15 Oct 2020 09:51:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BWzZnL2Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56C7A22265 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 69F44940012; Thu, 15 Oct 2020 05:51:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64FFC94000C; Thu, 15 Oct 2020 05:51:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 56552940012; Thu, 15 Oct 2020 05:51:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0020.hostedemail.com [216.40.44.20]) by kanga.kvack.org (Postfix) with ESMTP id 2999B94000C for ; Thu, 15 Oct 2020 05:51:02 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B62998249980 for ; Thu, 15 Oct 2020 09:51:01 +0000 (UTC) X-FDA: 77373691122.13.chain75_0311f8327213 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 975C818140B69 for ; Thu, 15 Oct 2020 09:51:01 +0000 (UTC) X-HE-Tag: chain75_0311f8327213 X-Filterd-Recvd-Size: 2985 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 15 Oct 2020 09:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=guRr2sUyuNye8RHMu+leAsFkrCOr1xJH+9OoZsxpg/c=; b=BWzZnL2ZCgjHk1D10k3yXEnUCn j864aWyaoTwKxdIPtbVRGCiQ43wG9UekS9IwaOTc0uZBnZofKHm68KSXZa9oJOvrGQEspb/GkN1va 0fN5cFMmsNgvcdkW9EmLw7T/dcLAvIFqM8YjrGqjdmryDkaMkPLteoNpKhQqiU0e9lji3uBIOCoU6 aG92NZGKSd5HAQIVE/P789PFuDNXJ+bSV5n0aZpcOl/+Wmzup7IY7bNAfs9CtMv54Qykzu5Jt7l3w htnaY+eoe2q9sCcxP1+Xjl1YyL4UfiUlWrZRtmGqXTJZXgusUOKnxnXM2oB1MvDocSseafvSgz+ZL Wycpqwdw==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSzuU-0006F2-PX; Thu, 15 Oct 2020 09:50:59 +0000 Date: Thu, 15 Oct 2020 10:50:58 +0100 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 04/14] iomap: Support THPs in iomap_adjust_read_range Message-ID: <20201015095058.GB23441@infradead.org> References: <20201014030357.21898-1-willy@infradead.org> <20201014030357.21898-5-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201014030357.21898-5-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html 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 Wed, Oct 14, 2020 at 04:03:47AM +0100, Matthew Wilcox (Oracle) wrote: > Pass the struct page instead of the iomap_page so we can determine the > size of the page. Use offset_in_thp() instead of offset_in_page() and > use thp_size() instead of PAGE_SIZE. Convert the arguments to be size_t > instead of unsigned int, in case pages ever get larger than 2^31 bytes. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > fs/iomap/buffered-io.c | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c > index 935468d79d9d..95ac66731297 100644 > --- a/fs/iomap/buffered-io.c > +++ b/fs/iomap/buffered-io.c > @@ -82,16 +82,16 @@ iomap_page_release(struct page *page) > /* > * Calculate the range inside the page that we actually need to read. > */ > -static void > -iomap_adjust_read_range(struct inode *inode, struct iomap_page *iop, > - loff_t *pos, loff_t length, unsigned *offp, unsigned *lenp) > +static void iomap_adjust_read_range(struct inode *inode, struct page *page, > + loff_t *pos, loff_t length, size_t *offp, size_t *lenp) Can you please stop the pointless reformatting?