Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3441971pxb; Mon, 1 Nov 2021 13:56:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzhRja5AfEcwMnNmhhIrRVKAow/tIbQvo/LObLnTq3b6Va+s/dGDXNzLxK2DM7GDTW0NXj X-Received: by 2002:a05:6402:4246:: with SMTP id g6mr8070300edb.112.1635800172428; Mon, 01 Nov 2021 13:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635800172; cv=none; d=google.com; s=arc-20160816; b=PD2Nfp0dBxm38N1gJiEewf1rBM462y3x4wxUcWI2dLSIWmVWBsDJ3eFnKehSr36mC1 6sD74p17xQUkPO0NCR0dIRSnCl7OEfRgfdQ57KvYFuo3a6acRdjMGnySUaaa3USaSp9z Yhd1DHDt0J4XvO+xyqsnJ8+G0Hx4PT5/3ya4U09ysBEXgdtvP/53Q4Q8kOQNaKJc+IBG l0+d827defq5MPZdN5gfyAfwIchBZVwaHHn9mLMZXR1A0FtAw/8eeVRMLrv3VW+MVXEN xhuzwKKnLcdmllW5CbX/GATMx1YnUXjG8kUE9+jsqkLqnSCE7JgnlF6oI3n1REEypLmd PdDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=t87jKZsrDuqY3K77jLbQIbUND30IkeMub+USzTY+ZF4=; b=TzH3PHAyf38xGq8RlFHvft4HUVNYBoijtLFrc5Tnnb7Kp2MpDDE6vRxdRg6iUCaHcR 11z6WK74qU2afqyHba7GHw7VzeqPGJ92yN6mK1/Rx0Y0VkYhdKYCRgsfNXFeabYkgNPa GhlOhzO9omN0UMa1K5pi9XAnnV7/c0jn2alAPi3rf4K+6UEyZkKI3VMDGxPJ9c+bpt7D j6MsutzCn8E3rw3dEcKrYeE7sdopuxJ4OAZeV23O/bAwMrZ2j57qIKCpW9+0c0E2rm9p gp2+0WDwqpvTc3Aljqe5ctlEKVovi56ByYkyLf5R6P8jgEWxtYVj7azJEoPIqK5l0CoF h1vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nwPgmoWp; 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 hv17si9134776ejc.360.2021.11.01.13.55.48; Mon, 01 Nov 2021 13:56:12 -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=@infradead.org header.s=casper.20170209 header.b=nwPgmoWp; 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 S230487AbhKAU40 (ORCPT + 99 others); Mon, 1 Nov 2021 16:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbhKAU4Y (ORCPT ); Mon, 1 Nov 2021 16:56:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D165CC061714; Mon, 1 Nov 2021 13:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=t87jKZsrDuqY3K77jLbQIbUND30IkeMub+USzTY+ZF4=; b=nwPgmoWpQSLyF2GyXAsA66NKx4 eFN7OHxshBvyc/VnBozjYdnqDbj5rNOeo3TzJ3fGGrHxdoyNnJuHA4V3NFHoQ9Untp7Qm2xx3TlSx VEEOBStVJsU5ZJI5XzH+ceLULWFXbphIYUC5DvcYq7dri9j/1CYLd6tDkybyTAn+2lag/YIRqQKFq NosCARytHhFiCxalTdpNKe6CfFpO1eJ4zTMUnz+gCCjFeJG+8BdA1A1XaxEBuA0NCIl3loJQJxOb8 oHwPqsgW27ixhZShRWSTuX6pyDZglfa0O1xabvpXbiYzaAmnITxp2j62iC2bf4MKOktiSu1YJLrQ8 1No8I1Yw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mheFA-0040fl-Ni; Mon, 01 Nov 2021 20:49:51 +0000 From: "Matthew Wilcox (Oracle)" To: "Darrick J. Wong" Cc: "Matthew Wilcox (Oracle)" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Christoph Hellwig Subject: [PATCH 06/21] iomap: Convert iomap_page_release to take a folio Date: Mon, 1 Nov 2021 20:39:14 +0000 Message-Id: <20211101203929.954622-7-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101203929.954622-1-willy@infradead.org> References: <20211101203929.954622-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org iomap_page_release() was also assuming that it was being passed a head page. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index d96c00c1e9e3..b8984f39d8b0 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -59,18 +59,18 @@ iomap_page_create(struct inode *inode, struct folio *folio) return iop; } -static void -iomap_page_release(struct page *page) +static void iomap_page_release(struct folio *folio) { - struct iomap_page *iop = detach_page_private(page); - unsigned int nr_blocks = i_blocks_per_page(page->mapping->host, page); + struct iomap_page *iop = folio_detach_private(folio); + struct inode *inode = folio->mapping->host; + unsigned int nr_blocks = i_blocks_per_folio(inode, folio); if (!iop) return; WARN_ON_ONCE(atomic_read(&iop->read_bytes_pending)); WARN_ON_ONCE(atomic_read(&iop->write_bytes_pending)); WARN_ON_ONCE(bitmap_full(iop->uptodate, nr_blocks) != - PageUptodate(page)); + folio_test_uptodate(folio)); kfree(iop); } @@ -451,6 +451,8 @@ EXPORT_SYMBOL_GPL(iomap_is_partially_uptodate); int iomap_releasepage(struct page *page, gfp_t gfp_mask) { + struct folio *folio = page_folio(page); + trace_iomap_releasepage(page->mapping->host, page_offset(page), PAGE_SIZE); @@ -461,7 +463,7 @@ iomap_releasepage(struct page *page, gfp_t gfp_mask) */ if (PageDirty(page) || PageWriteback(page)) return 0; - iomap_page_release(page); + iomap_page_release(folio); return 1; } EXPORT_SYMBOL_GPL(iomap_releasepage); @@ -469,6 +471,8 @@ EXPORT_SYMBOL_GPL(iomap_releasepage); void iomap_invalidatepage(struct page *page, unsigned int offset, unsigned int len) { + struct folio *folio = page_folio(page); + trace_iomap_invalidatepage(page->mapping->host, offset, len); /* @@ -478,7 +482,7 @@ iomap_invalidatepage(struct page *page, unsigned int offset, unsigned int len) if (offset == 0 && len == PAGE_SIZE) { WARN_ON_ONCE(PageWriteback(page)); cancel_dirty_page(page); - iomap_page_release(page); + iomap_page_release(folio); } } EXPORT_SYMBOL_GPL(iomap_invalidatepage); -- 2.33.0