Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp34054pxv; Wed, 14 Jul 2021 22:16:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFLeRWiu1UtZ+xVUEvPu3cuXvMmJZXj5ojDUTPgQjhgCuL1aijxNAIf8S2K74SffRGJJwR X-Received: by 2002:aa7:c412:: with SMTP id j18mr3705251edq.119.1626326196343; Wed, 14 Jul 2021 22:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626326196; cv=none; d=google.com; s=arc-20160816; b=LmxwQJNB5klOBkz2Zwiq3c3fVhP+FZbWjAoYhjlW81Y8STP785qzddMrVwHkqzi4nW om+kzXk8Rxco4MZ7gxnoR685vN+jH7ap2LuI7uJkdK/AKI+/ej9EJH2LOJJ1MyCZQWmU AQdxqkiyUYiqQ4YQ6CHT1wxNKeyZcGIhKZAbzWhnvbL0zlDudoUXdDWP/3ZaI2mGawDJ Ifh25tK0fJvcynewxpBMXdWvOP3LdeQzLusYfC6QGBhlIdlN/9vt5yKigUcXt/w9yrki HdkLJ0nAciU9AXE+SNnia2clkhr1toQSFVvFsAsyCKh9F/G6HPtDUDyTUckURNo/rk9H nrUw== 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=FfJ6ZNoiX29Han3ne7JZIAhgvMC58bjKSAKjKwLA6t8=; b=z11c8PVFdJ+cy/nKbfNsJFbddJVitrqv+oSCzmWcwY8dv1q6Bu2rKTNBycGlWQqW/a JDfldeLl5iIaHOCVAp0rbhn9fdWNBf7ImuF3a6R9M93eA4fLaEWLT3okziYrLaoDfv3z OREVb4HmrYG4/qNymYf9b+cj2L/957QunYEDmCGD0LxIB7XkpXP3YHrpUOyI7d++0+Cr ppLJ/QuywJbkRxjQIT2aEXR7vECX1XvTLpFi1nLG4N8otP0JVUYljAPKLePftu1sUFYk WNAcgP96vIwUJ0j0Rkk2E+dkYeCgioi/Mni1Bc98UYs30DU773uI7YrIDty7RBHkzJWu riJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Et6pXsXe; 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 y9si5900138eju.362.2021.07.14.22.16.13; Wed, 14 Jul 2021 22:16:36 -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=Et6pXsXe; 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 S238531AbhGOE5T (ORCPT + 99 others); Thu, 15 Jul 2021 00:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbhGOE5T (ORCPT ); Thu, 15 Jul 2021 00:57:19 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94C94C06175F; Wed, 14 Jul 2021 21:54:26 -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=FfJ6ZNoiX29Han3ne7JZIAhgvMC58bjKSAKjKwLA6t8=; b=Et6pXsXerxU9QQvmuJhKjEA5+9 giU78V/mLazdex17mOh8Ya0X7dyndJ/IPtbjGpSLI7o0DRTt+UnMDPg9m02dG1XArhrGk2h9iCGQ5 nyEV93UF6KdFBKoBdQPaYwxhjiTrfSsaRi1htmnxrHrDRJGOBsejeUyMAMH2T6hLCokob+55dqmmr oUst8CaK7+deb3G8OyQOTikXz1R1Bp4dh+Zi8BWy9kLw8ObLwBSd68AD5FlgOXF7LqGNbH3Jx+gvw 15GIELsfQBboDpdvweojqr92KTJ2IzYPnB9o+HMdBJxFS4dV7A4T+Ic2aLpxEpsSszm6KpYSiJY7U T7qxNOGg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3tMV-002yzZ-Ee; Thu, 15 Jul 2021 04:52:48 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v14 096/138] iomap: Convert iomap_invalidatepage to use a folio Date: Thu, 15 Jul 2021 04:36:22 +0100 Message-Id: <20210715033704.692967-97-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715033704.692967-1-willy@infradead.org> References: <20210715033704.692967-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an address_space operation, so its argument must remain as a struct page, but we can use a folio internally. Signed-off-by: Matthew Wilcox (Oracle) --- fs/iomap/buffered-io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index abb065b50e38..6b41019a51a3 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -478,15 +478,15 @@ 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); + trace_iomap_invalidatepage(folio->mapping->host, offset, len); /* * If we are invalidating the entire page, clear the dirty state from it * and release it to avoid unnecessary buildup of the LRU. */ - if (offset == 0 && len == PAGE_SIZE) { - WARN_ON_ONCE(PageWriteback(page)); - cancel_dirty_page(page); + if (offset == 0 && len == folio_size(folio)) { + WARN_ON_ONCE(folio_test_writeback(folio)); + folio_cancel_dirty(folio); iomap_page_release(folio); } } -- 2.30.2