Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp738637pxv; Thu, 15 Jul 2021 14:57:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxrduSNP7UKKKuzPoevBYYvvC0xXH5z2fggw7qvGhXQ0dWCs+lD7sacfrQt5dJTE3jO9lR X-Received: by 2002:a02:6d12:: with SMTP id m18mr5756679jac.102.1626386250294; Thu, 15 Jul 2021 14:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626386250; cv=none; d=google.com; s=arc-20160816; b=GwNwdYYewAS6e1Q9ZCdUwpefIhe+mfbfPoulD+VrVaI+lFu9VikyGYh40GsG0NOJkf WDeJMjSHgKG9lQRjJ1mqSGMEYLaN49IeddvqibwLMSZFTsBDK4qWM+sNbEbwi7mXUuio OSQYDicIB0BiRBaX4+EzOGnmTg2cyoN1NsCr7OKMKAWoZhIddWoSzuMWbNoMbCfMQ6lV VlY2sZzPuX+1cJBgRYiwTE0MHWreK+/lcSD2+HaIC4k95vaJy3b2QyYYmL6IfNVZsUZB 7ROyGNF44b1/PbCHyxDfKSHFoSE9ovO7eGp8ymQ4wDpC/y5sPV8BnDjFzGvcNvIVvswF QwrA== 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=OSzA1xNcNxXUOcb6rSg+He/uBuvpRLdnLJxveUEG7ng=; b=OiRnikL9hPQslCeiIKQmkbnHa1uZgZXPYNFy3Iuo/cYPb0Dj2Y8PPA+OL0mI2zy8Ql jR8PxSnn3fzyz5N7yFkXFq1WY+oo5rgbGNhofaonhkM1Bxh/EjTYFL3N1jxdHCHeeqqK DwdlFBMvTodlwSSuUSHO3/Lil3zFtg4NSfTjVtGXbXK7v/+nsxPU2K0BLaGDiIWREeZp LUa+jH1Z9w6w0btbLqI4+GtykDUZ8i4XKsUtzZSFMgy/kQK6yE2a3sBU01F1E8x155Ue UCDkBLP/v8WqmBynU1u7bJ9B3JXSjPFC7n/0Wu8Aqq1UkeHrLhSQL4BMz9zzUyzVGmp8 JHmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W3DFgeuT; 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 e3si8290187iow.52.2021.07.15.14.57.17; Thu, 15 Jul 2021 14:57:30 -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=W3DFgeuT; 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 S231357AbhGOV6H (ORCPT + 99 others); Thu, 15 Jul 2021 17:58:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:46920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbhGOV6F (ORCPT ); Thu, 15 Jul 2021 17:58:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A836260240; Thu, 15 Jul 2021 21:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626386111; bh=IZhXG0pFZmYaSBld/7CAwZc8B7u7L40FuYffUY/p3/c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W3DFgeuTWh5VVOoNJ0gbXPTbjBbFT/EgbckCbMmG8A+gngFuTlO0l2+0gBjrmOs77 q5nBihgxs2PiXv2qpSoCEg+GtXnsXMUtzyp7sRBrgm/MGceXZ5P0ova+s5NY+SOrXd herhQ/ELYwITCcyT7XTabXrmTQIpYULgs3KXhumjLFjJPIkzwr94t/rxleAEshmt/R 749cFi2H7R4ku2B5KGpUzhtRpy0rGSA5aRQIfbqCoBs95X0MPtrZ5bIVCxs50uJM+0 kBJ+K5ZMF1QNRA0zMjKMPf6uTPlDb1QBa+xetSgUrhMdhov9AjBIJKubIUyVFCdR8x NCp0l/GTTpiSw== Date: Thu, 15 Jul 2021 14:55:11 -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 104/138] iomap: Convert iomap_write_end_inline to take a folio Message-ID: <20210715215511.GO22357@magnolia> References: <20210715033704.692967-1-willy@infradead.org> <20210715033704.692967-105-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715033704.692967-105-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 04:36:30AM +0100, Matthew Wilcox (Oracle) wrote: > Inline data only occupies a single page, but using a folio means that > we don't need to call compound_head() in PageUptodate(). > > Signed-off-by: Matthew Wilcox (Oracle) /me isn't the expert on inlinedata, but this looks reasonable to me... Reviewed-by: Darrick J. Wong --D > --- > fs/iomap/buffered-io.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c > index c616ef1feb21..ac33f19325ab 100644 > --- a/fs/iomap/buffered-io.c > +++ b/fs/iomap/buffered-io.c > @@ -662,18 +662,18 @@ static size_t __iomap_write_end(struct inode *inode, loff_t pos, size_t len, > return copied; > } > > -static size_t iomap_write_end_inline(struct inode *inode, struct page *page, > +static size_t iomap_write_end_inline(struct inode *inode, struct folio *folio, > struct iomap *iomap, loff_t pos, size_t copied) > { > void *addr; > > - WARN_ON_ONCE(!PageUptodate(page)); > + WARN_ON_ONCE(!folio_test_uptodate(folio)); > BUG_ON(pos + copied > PAGE_SIZE - offset_in_page(iomap->inline_data)); > > - flush_dcache_page(page); > - addr = kmap_atomic(page); > + flush_dcache_folio(folio); > + addr = kmap_local_folio(folio, 0); > memcpy(iomap->inline_data + pos, addr + pos, copied); > - kunmap_atomic(addr); > + kunmap_local(addr); > > mark_inode_dirty(inode); > return copied; > @@ -690,7 +690,7 @@ static size_t iomap_write_end(struct inode *inode, loff_t pos, size_t len, > size_t ret; > > if (srcmap->type == IOMAP_INLINE) { > - ret = iomap_write_end_inline(inode, page, iomap, pos, copied); > + ret = iomap_write_end_inline(inode, folio, iomap, pos, copied); > } else if (srcmap->flags & IOMAP_F_BUFFER_HEAD) { > ret = block_write_end(NULL, inode->i_mapping, pos, len, copied, > page, NULL); > -- > 2.30.2 >