Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp719286pxv; Thu, 15 Jul 2021 14:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZZF7+QSe+wehDrsbgpweDhKpCEn0VHIK1gWUgSWElOWRKSEOvjf+xsMiYlFzAWbI9Y4Ai X-Received: by 2002:a50:ce51:: with SMTP id k17mr5312890edj.185.1626384157919; Thu, 15 Jul 2021 14:22:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626384157; cv=none; d=google.com; s=arc-20160816; b=HeSReiOxq7il9gpeuUxApi3xJOH7z9m8qLphVcXJLyquFpUlAivVs0v6pWng8dTRzN Fx4k9Au0AIYTWp3TAXnkWdcpUH+VAg5wH9HzieuP6kGu5L09OBE3HHbayRSxO9S99HnO 5Mf247/6fLIgBkrUlP4MW/JmDdju6uO7Lge10lZR9TY8ENUeKMd8rEWmnCcWzx24ktht +qwh2dGRxR6DtrgV9IW2+RM7vln0F+P8xMMpQU169YAbx/IPuCmXVMTBEKEDTAMfNiFH ZCmzpcjfNM/oKmNFDRYx1DhsuuXAA90bN2mFq8Wzi/GlO5FfKcVgsALI2oMVyg86EwiX XuVw== 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=WQjQAvIJQZ3i47mFG9TsBjClBZyMY3KWedG6hUKykiY=; b=b9X8YVtd8BAt2WsM5J/veAJ3jonJmGh2uGOk7mkaUPpMDT4swkdGxEs9v0gOz0cDFr X1XDtsN8l4SWXzuBzPD+MSPWh7ioeyumVN6nf4NTtiKEiaiGgp+jTsiMTPYerUgV+JLi l4fCuy+czGGj1Co3a7O8PAis0IwvzUdSq33MyBB5YmoSHGnjjvDedczJpQUB1+D/vyfM HdxR5uSB0ad10PRNL4t16J7HrLdmuE6Rj+sYDsd6d0uCQVVnkx0XxgBggCDPwecfcGSV db578MnTBGDw9UEc3Pa1qytgs9S4bnklJ8BHf6oEImepWQSE2cPxdkMOfyEfWcSooNzP JNFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O1B0UaIh; 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 o22si9466524edr.231.2021.07.15.14.22.14; Thu, 15 Jul 2021 14:22:37 -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=O1B0UaIh; 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 S230288AbhGOVW5 (ORCPT + 99 others); Thu, 15 Jul 2021 17:22:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:40110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbhGOVW4 (ORCPT ); Thu, 15 Jul 2021 17:22:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E7ADC60D07; Thu, 15 Jul 2021 21:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626384003; bh=BDfVjRBSfQ1ziLLEmDwkrceOcQwLTwt3pBExg/I/12A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O1B0UaIhlWhN8/dZZ6nJQyypDzIu4FGdq96diDOp3qrcEPKgVpmDLtmvo/2BsOrkX fOIsOXZVjU4NPuNBIQqs+at8wpVhGEptm52ASu4o0pabxw1p/xi34Zcy4JLSgFCFOd KmCcibYiEOmLJ2m8kr3iG/NUsfHMKra8zNz5RdI/RbllhJMXLgtykbUJDxSYY5TmB/ zxYHziLtiAd9DltLaqXnNT1m+7vBv02uLC93AUXKakuPfoN4FGYAScBTjZJin2iW4e Uf7jzO8WC1QAaGsYI4znD6ZvcFjSA78cbO4oz0oTf0/8pOlJClhpM9GipZi2DpkA/X xs+BtGjb3clyg== Date: Thu, 15 Jul 2021 14:20:02 -0700 From: "Darrick J. Wong" To: "Matthew Wilcox (Oracle)" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v14 094/138] iomap: Convert iomap_page_release to take a folio Message-ID: <20210715212002.GG22357@magnolia> References: <20210715033704.692967-1-willy@infradead.org> <20210715033704.692967-95-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715033704.692967-95-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 04:36:20AM +0100, Matthew Wilcox (Oracle) wrote: > iomap_page_release() was also assuming that it was being passed a > head page. > > Signed-off-by: Matthew Wilcox (Oracle) Eh, looks pretty straightforward to me... Reviewed-by: Darrick J. Wong --D > --- > 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 c15a0ac52a32..251ec45426aa 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); > + unsigned int nr_blocks = i_blocks_per_folio(folio->mapping->host, > + 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); > } > > @@ -456,6 +456,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); > > @@ -466,7 +468,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); > @@ -474,6 +476,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); > > /* > @@ -483,7 +487,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.30.2 >