Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4764955pxb; Tue, 2 Nov 2021 15:37:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwls42Ml28XyOqX5bvwugHvm5AG8esCCp9NGlFU2is2mv10h13dkE2reUjTlX6azyyi8d/d X-Received: by 2002:a05:6e02:1543:: with SMTP id j3mr26876933ilu.151.1635892668399; Tue, 02 Nov 2021 15:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635892668; cv=none; d=google.com; s=arc-20160816; b=vjuIURpsvwhCHWZBuML5YsNtygVFN7Va6mSDrhMhUncWOcked+crGGXhEi50nZV+Pb 3ZqqL3NDVxUI7OPSo3z98IPugx84Ev7eUgL228yThVw2jQjF0+kMyPqdQkOXuQkCTG40 sMFdX3gEHCUKVVc/pXuaB7KoLa9OBz7X+uj9nMvcWJlwa1Tda1gT3dhYIOkn93rSx2+i t7lEvBObAK+K2py2pGezUcVGT513Tl70iPbNyM43q/ghJ8Ua01eRlLxsf1N3X7uPzXIj orZUSPrrSKxjdB75DjveWHp12ixsOeuMYFsc6P8G0+ASa1sq8BdFT/91iLTqh+4kS5cM RdEw== 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=MQgN/B+0HQUkj8qR1aTtoqbMuA+SQClnsjJzGiU2TW4=; b=OXFzYA/6+YbOnp+O+19W7GMwstobye9bYnAhfIdodrPbReiMdT0px4WO9ulsA0JHTw Dbedg994kdbbjw3JaMCGHrgs3H83qj9bIYdaegqstqqDUIFHh+MUqxQ4Uqr3krVV6bjn FpV7GB/bseCj50hdccEJSLUD22YZ+U+U2BZ51yN3jUxWJGnenH3VELfgb75+q2BAQkYS F/xWIICK+sBE8INZS2ia0TK+FZvBHYwB+IuG767LGzmKImtsDxD8jtzFAUm3VO20u4o0 7hUAJ6CUkb46sjC77pU4l2sgpjuN3nqVrn9KXqliNRvw9V0rc/Xjb8bQfBYQYhzVtHc+ FHdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=luBl2mwK; 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 v5si518493jas.94.2021.11.02.15.37.34; Tue, 02 Nov 2021 15:37:48 -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=luBl2mwK; 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 S230420AbhKBWjR (ORCPT + 99 others); Tue, 2 Nov 2021 18:39:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:48932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230293AbhKBWjL (ORCPT ); Tue, 2 Nov 2021 18:39:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7E7AB61076; Tue, 2 Nov 2021 22:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635892595; bh=XcL/yji/ofphJmOG1nSJU5SP1NHCrSvT6FBl/FyJizk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=luBl2mwKcdMB8SS422yo7JWvrSuPaOCqUbSO3kqsNO10QaA89Sse5pZZqpmekhBpm xQDADDKd8jjyoZguACL0bLBe+GGxDB9yRQu3fT0Yc8PIT6HjlJU7adIHiUoRoc3MRo hDV08CejoshXzL6dpuesv+SudS+bvBuvTkatOn4jWDMcV5/oI1XuDaB3RYUa8nl3rI Cwm5k9+PDZ1KlUKKHgZhCp1WmhXIhnGIHKnR3hSUFWSM0Ij9rjynnpy66upSXUBS39 v05gDVaKfPzowtYo6lgQDGuasiv1WFsGCCGp/qcxO6JofzGhC2sc+AqhuFtv8CVMgu lNYJwByLoKn0A== Date: Tue, 2 Nov 2021 15:36:35 -0700 From: "Darrick J. Wong" To: "Matthew Wilcox (Oracle)" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig Subject: Re: [PATCH 08/21] iomap: Add iomap_invalidate_folio Message-ID: <20211102223635.GJ24307@magnolia> References: <20211101203929.954622-1-willy@infradead.org> <20211101203929.954622-9-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211101203929.954622-9-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 01, 2021 at 08:39:16PM +0000, Matthew Wilcox (Oracle) wrote: > Keep iomap_invalidatepage around as a wrapper for use in address_space > operations. > > Signed-off-by: Matthew Wilcox (Oracle) Looks ok, Reviewed-by: Darrick J. Wong --D > --- > fs/iomap/buffered-io.c | 20 ++++++++++++-------- > include/linux/iomap.h | 1 + > 2 files changed, 13 insertions(+), 8 deletions(-) > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c > index a6b64a1ad468..e9a60520e769 100644 > --- a/fs/iomap/buffered-io.c > +++ b/fs/iomap/buffered-io.c > @@ -468,23 +468,27 @@ iomap_releasepage(struct page *page, gfp_t gfp_mask) > } > EXPORT_SYMBOL_GPL(iomap_releasepage); > > -void > -iomap_invalidatepage(struct page *page, unsigned int offset, unsigned int len) > +void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t 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're 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); > } > } > +EXPORT_SYMBOL_GPL(iomap_invalidate_folio); > + > +void iomap_invalidatepage(struct page *page, unsigned int offset, > + unsigned int len) > +{ > + iomap_invalidate_folio(page_folio(page), offset, len); > +} > EXPORT_SYMBOL_GPL(iomap_invalidatepage); > > #ifdef CONFIG_MIGRATION > diff --git a/include/linux/iomap.h b/include/linux/iomap.h > index 63f4ea4dac9b..91de58ca09fc 100644 > --- a/include/linux/iomap.h > +++ b/include/linux/iomap.h > @@ -225,6 +225,7 @@ void iomap_readahead(struct readahead_control *, const struct iomap_ops *ops); > int iomap_is_partially_uptodate(struct page *page, unsigned long from, > unsigned long count); > int iomap_releasepage(struct page *page, gfp_t gfp_mask); > +void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len); > void iomap_invalidatepage(struct page *page, unsigned int offset, > unsigned int len); > #ifdef CONFIG_MIGRATION > -- > 2.33.0 >