Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1694985rdb; Thu, 25 Jan 2024 03:31:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8+4D/ukvEeSSMmtIYytphiikV9f5fWkCStswRz0FxDqN1AKn6LpjVI1Az0H0qC5XJJ9jf X-Received: by 2002:a05:6402:50cf:b0:55a:3639:ef7d with SMTP id h15-20020a05640250cf00b0055a3639ef7dmr564362edb.52.1706182306908; Thu, 25 Jan 2024 03:31:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706182306; cv=pass; d=google.com; s=arc-20160816; b=zOkrcXLj9xgf8/SFVZs8UQ4lcnLrd1D/Ee6w7dM6U59JlyMvADvh4oTf9xbvkRH0vN mx0NAHNDV/FZJoedeX3Vm4YM78KDRX+v6VIIJ4/Y4IyCy1yda59lnM0RYWGCSfYQXb3i vosTK1IqKTJJ0pde6gSvVOfiPWssJxP+bT+3arffsMFt/Q6PwXQkoAhCL/iiKlZNVBgc RzoL0DdFDEMsAn8xlJG0H+sbb8DvLIfqwNu/EJBoaMMPNc1scafI3xT9kmvPiF8QCKa2 fHKcd49cTFLcKh013rcZgdjOmlPErQzCkxSQyO3eDQfmxWC2U0fKXzYogILBUe0z7ouD /FtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VteIp731KUh3YSK1JiCDa6aylLsuTXuUpMz7VQeOhBM=; fh=GhWexFWZOEUuNraer0weGPyvpqqgsUegcDrNVNkjv+Y=; b=E1OE4DDW5JUtapbizK9aiWN6D1/KdpwpMm7A57z6jBhuUZLcOu6diEpbf3zjI/RjAu FaajCWqbNZWzBZSx1pLDPoo88OffeBTGT4eoTtivxqgsgx54tgCjE1xBldSgOQ+1aWxH sGMmxu3v9So0DYnD2y1WH3De8YgF7lkZt0NqN8xdlZGpRYTF8q8LCclcH0s44g3iRaM2 BpFqRpWX95MYPUgXf9iPQ7Te1vIsw7Mw8OT9yOmDBGak0h9NlcVWHreomO2w91JATeRG vrUcJqDP+dnNu2OeLftjdmYXoEtBjrx80szhUby51xYkL6kYEgIvQrZddjhW3oIpErOQ PPCw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=MwDns8za; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-38219-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38219-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i1-20020a05640242c100b005590583beb1si12861479edc.501.2024.01.25.03.31.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 03:31:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38219-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=MwDns8za; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-38219-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38219-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F241D1F2C115 for ; Thu, 25 Jan 2024 09:05:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AACEF45021; Thu, 25 Jan 2024 08:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="MwDns8za" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DF0540BFD; Thu, 25 Jan 2024 08:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706173156; cv=none; b=KJa15u6R12f3H9pmq/ZEMA+rXvr9RSdK4MobgeVtbBJSJ7Lq8T6oZ8bqMqniGjiFYsiuEgMJ73SEZH5DxegF90vtrffjaus3B0nWTrRMUxYSjxv1XCFTLVdKJ4jdAAJVlesQBP06LLt+UMlOydofu1WWhsDxx7uuLb5dvVnXIeM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706173156; c=relaxed/simple; bh=XRsw0HE4sdU9Bt6SzZHTxpFscYBRdEbUKuyq7+81pVQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cwTXFNdBRxhBXu2Xg0yofAIrQhvDp6rd79nFBzVNGjrJgu+1gjV6EVXndDpeu8m2FJsta6EYxc2e/h46+sG9S3zzvH91Ew9Z/+2KOX/d8ybsuDXuzKwW7aJbzeZogM7ygMF1XZX/8Ygm8ATMa232eFBZzOwy8BgeMGyHkZALAAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=MwDns8za; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=VteIp731KUh3YSK1JiCDa6aylLsuTXuUpMz7VQeOhBM=; b=MwDns8za7rOoyeeWAlr3o2HuQV 6MsdXZx1OlD4vY4TVWPSxa5TjcHnxy09D2/JDj47wRd2wEL80LFuC5im3yK7CJXPj2jlucMoHhjYY 5ZfQoIWEjbS3nQGUD167nRpjZ9IYSoNIanwVbuJcTe8tTJhTKK4ufectQpX4R6xdrpv7nl7S3sak0 v3d1Nqpjk+YxJc8FB0tBthiV35NdcgzGgWajgKmp1mRJWvAQd5eTU+gEFmq7Eu6UAAF1itV8yLtxl 6KqrehrsyNRLzDHyou0HEwBNknKvykRNrwdjpWOZZrcDO7qYmxX27CByg2snYSfEFCFJfxeKf9Tkb Pf5DB47w==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rSvZm-007Qa9-3D; Thu, 25 Jan 2024 08:59:11 +0000 From: Christoph Hellwig To: linux-mm@kvack.org Cc: Matthew Wilcox , Jan Kara , David Howells , Brian Foster , Christian Brauner , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/19] iomap: Convert iomap_writepages() to use for_each_writeback_folio() Date: Thu, 25 Jan 2024 09:57:57 +0100 Message-Id: <20240125085758.2393327-19-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240125085758.2393327-1-hch@lst.de> References: <20240125085758.2393327-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html From: Matthew Wilcox This removes one indirect function call per folio, and adds typesafety by not casting through a void pointer. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 093c4515b22a53..58b3661f5eac9e 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1887,9 +1887,8 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc, * regular allocated space. */ static int iomap_do_writepage(struct folio *folio, - struct writeback_control *wbc, void *data) + struct writeback_control *wbc, struct iomap_writepage_ctx *wpc) { - struct iomap_writepage_ctx *wpc = data; struct inode *inode = folio->mapping->host; u64 end_pos, isize; @@ -1986,10 +1985,12 @@ iomap_writepages(struct address_space *mapping, struct writeback_control *wbc, struct iomap_writepage_ctx *wpc, const struct iomap_writeback_ops *ops) { - int ret; + struct folio *folio; + int ret; wpc->ops = ops; - ret = write_cache_pages(mapping, wbc, iomap_do_writepage, wpc); + for_each_writeback_folio(mapping, wbc, folio, ret) + ret = iomap_do_writepage(folio, wbc, wpc); if (!wpc->ioend) return ret; return iomap_submit_ioend(wpc, wpc->ioend, ret); -- 2.39.2