Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp113570pxv; Thu, 15 Jul 2021 00:05:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd2CyDauI2I86242XTkwzcsJlUjcIFUmPliEtzgPG0pMD5QTH+iEtGn66ER89Q0SHe6wbS X-Received: by 2002:a17:906:bc8b:: with SMTP id lv11mr3650042ejb.331.1626332734289; Thu, 15 Jul 2021 00:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626332734; cv=none; d=google.com; s=arc-20160816; b=gZZvlngg70S4lTo5I0b+tA8nQkbZDTGIS9mcnSbIZcwb7yMK62aIdu9yCrFCUuIQqc 28xNZOYP3bwoDPwQMEYDTnfOkGQaB2qh2PlpieU3T5A579KaM957S46uL3iZHjZVzbSz mhJKqHg33DbE7V0PSZ7dHFIFltOpEg+F74O1BlnNUBxgyEAv+gJ8hMzFWY8DXn7qxATa FQ9SnOmrO59LXOEPhq3ViEZ6MFiEurNq9OouuO37b32kZzkdC1KYl9ZycyhoCVHTCH4E AMLKQxI3aqmO0lLDe1ttMpRY9bt0a1K3VEx9khYUBUyoBTiV0+qR7jnc2afq58Z/InmC KP3g== 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=+TBu3dsQSGib/JvdjedtN222MCjABnCjiAwlgdbT2YY=; b=ESRloei0w3WCPabcCtPeR1bJXQ2zxUyhP12MV1F5hIdJfM4OjAtgvrs6bT/Tj5ztk2 HfK5C6AFSFKWai1BXy8JijiRKbf/9cPdkH1WGKA3scpXBa+QjHmzaccttrG9jTx5km/U 9EdMSQFp5cpY6LMNkufDQkJ/Pvl+V1U813t2+HsATndutSmfi3xqAWK2jrNsLc8bp58U j5scrzW2WtE5gYoaxqjsQBz9nPgrKf4HynB6KXbl0KPfCxGpshMNBiuXaqfIjg29vrzo Ey0a6TIVRdKrwZ2opnR+CF6tOQCv6tv9jQqtS+o3WHf/QOx6tPxEDtx/gva0dFnyiMpt ymYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lE8VmvNd; 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 m3si6284695edr.6.2021.07.15.00.05.11; Thu, 15 Jul 2021 00:05:34 -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=lE8VmvNd; 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 S236993AbhGOFFZ (ORCPT + 99 others); Thu, 15 Jul 2021 01:05:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233002AbhGOFFY (ORCPT ); Thu, 15 Jul 2021 01:05:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65456C06175F; Wed, 14 Jul 2021 22:02:32 -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=+TBu3dsQSGib/JvdjedtN222MCjABnCjiAwlgdbT2YY=; b=lE8VmvNdrwB6S/ZdOcsq631oFl sbTbqHu27mfxXUDoKk+B0IZfyzeJxkjhEiDVXCCGD0zFsU/hckDQqmicWGSwm+1hShkHT1H38IVmC jH2gAm5+XTIXiL3ommIvl0O/ldcK/m7L5LlIqKxEdcFptaWCOM0XlMfH3eYJDmmmmtpI9ktiijaWf xT2HZSDXm/fJ+Kpf7EU4QuCBUwaiuMy783aprUpB9GLTB7+m10JDQLj9Ug2SUtOCaUcz+vqrB65a+ h2jClrCWUi1OcEGhatiq7jvGO8ZbQVK0xwHzorSScpNxgQWPyoL01TFgQkXzcD/dQxsX+YAQJI026 AieOnykQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3tTv-002zcT-SX; Thu, 15 Jul 2021 05:00:30 +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 104/138] iomap: Convert iomap_write_end_inline to take a folio Date: Thu, 15 Jul 2021 04:36:30 +0100 Message-Id: <20210715033704.692967-105-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 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) --- 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