Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp915941rdb; Tue, 30 Jan 2024 02:29:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJMPu/be5Se+1gpvsRFnB9A0haDJw3oZy38RfXuLeCxfN0fBp/ycZWmBUVpQ3sjQYxowWc X-Received: by 2002:a05:6830:1691:b0:6dc:3c65:2a70 with SMTP id k17-20020a056830169100b006dc3c652a70mr8795025otr.65.1706610549617; Tue, 30 Jan 2024 02:29:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706610549; cv=pass; d=google.com; s=arc-20160816; b=BBIwSPU6Ocjf7i3g7yHItQDj/y8WWKZUYqbGeQtvfdbJ3MdC+FSAXV4Qf1+5iAx+VH 5gv7UqQSR5KoL7G9/KbRGhA4iYwQBsDALNXdfg0QLgT+t/3cMzB7eaMveNkGi8Nd1iwc +0dU9F8dlzOKF45OwopApjetvxyCxT0lXSOZkqe7HjcjP19QG+t5J8+e042ZNKOxHVFi Z1C+XPDbV3rwF0q1wwqmOr/4Fifh6fZawQZH71dPHpDVupD+NOCpzVmsRClAT7p0fFhw dEdd+Do2Pb36hH1rvnhcNVsXvSHnmcaWeeS3B1p+Md+YfgtMyeCXEPRGLZHivGLXFz2A n2zw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=ypvJnXvVjmaayelrbx9cC9PI4eHdK+C4dtVzpiZqLQ4=; fh=qJe2Ru0BINmuzn0QcmQBcqI6KS2UnK5WWFWVuHLt3H0=; b=t3EvxdAZkWcD5q7oVpH3P4RMQqnYjwSXWxyqHoLbU/MFo2pHPAlhYnwNF7+zkMrt5H +lChuiJU2l5/nlN0VOSoJYQIyVW0E/5oSHILyIQQVBh9jecRpGUOKwsYxM4HPDPJey6E TlMVqFBd4nMx5cdcOXwec9pVGJ2FoD1d/ieaniO0dIuk28DiwqSA2GTnR34+ShGytfNq yBHaD9cPNbLu+eXT6bHIA9ZjmYLXZUSh2BHJp9k1H045RNRCy+yIMba7jxa2bDXpIJF+ 6p2scQXo0DYbgtm/yCD+XPZ+5S2qCUIeUbowBuilXvha/UoC+A6b9GxGn9JaDQjBH4Fz YHyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=vVZFDbYX; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="n/MERs5t"; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=vVZFDbYX; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-44347-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44347-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k129-20020a632487000000b005c67029a131si7238691pgk.220.2024.01.30.02.29.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:29:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44347-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=vVZFDbYX; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="n/MERs5t"; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=vVZFDbYX; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-44347-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44347-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 222B3B228B6 for ; Tue, 30 Jan 2024 10:05:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B219679F6; Tue, 30 Jan 2024 10:03:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="vVZFDbYX"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="n/MERs5t"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="vVZFDbYX"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="n/MERs5t" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D2E8679E8; Tue, 30 Jan 2024 10:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608991; cv=none; b=YRh9vZWAAHFzXowcNDI0b5Js6FzuBVtEZ/tSqlxyENay1Wd07phzrwlog0NkeAl0I6EFda0/RDEoAnw0tHPmKohGg08BiuB78IZALgBOKOWB9Kp24mxy53eSM2t/V1rPe2SZmnJ9ujnN/oM06co2HiNyQyqf/9IbIAS0s+eeubc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608991; c=relaxed/simple; bh=IkKzQEXnXlwjhWZFN3oqHoe3HVv0pAR2z5vY4PVRLYg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MmBXAxkIqLap/Ad+V0hMIqf0WdC6/sDudtXtRmt4zIptrIyB+abma8toyuMdk33u51TTs9f6RrfuPlh1OQFivdskdjpmVq9PbLHT8rvFDwE+YETnKCRK1qNkbGL0Kn1aUyMkqYJTp4nEBhH6GW4kxbGsbi08MZxqULEpnYOGzjQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=vVZFDbYX; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=n/MERs5t; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=vVZFDbYX; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=n/MERs5t; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9C9FD1F83F; Tue, 30 Jan 2024 10:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706608987; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ypvJnXvVjmaayelrbx9cC9PI4eHdK+C4dtVzpiZqLQ4=; b=vVZFDbYX2wN/3NIyMU5Mb/zYfjArt0R1NdLgrRwS3sMURrlNf2A37D82b9XAdKCmjs7wF4 wpLrRvpwHJSu4lLfIrm8JehI8cFJpQhC9lhShY4VVrSTceLWFs21FtoUAvS1Mlnv7uaNi3 qIJoFKAwnNja2OGNOKTCpSfrNzvvIa8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706608987; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ypvJnXvVjmaayelrbx9cC9PI4eHdK+C4dtVzpiZqLQ4=; b=n/MERs5tRa7fMRqwi43Nhw143nMxUdTx1DsOb2d1LYDAMF2UgoTh1FS8GACB9h52YQ43a7 w6raW35bJ59zKIAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706608987; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ypvJnXvVjmaayelrbx9cC9PI4eHdK+C4dtVzpiZqLQ4=; b=vVZFDbYX2wN/3NIyMU5Mb/zYfjArt0R1NdLgrRwS3sMURrlNf2A37D82b9XAdKCmjs7wF4 wpLrRvpwHJSu4lLfIrm8JehI8cFJpQhC9lhShY4VVrSTceLWFs21FtoUAvS1Mlnv7uaNi3 qIJoFKAwnNja2OGNOKTCpSfrNzvvIa8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706608987; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ypvJnXvVjmaayelrbx9cC9PI4eHdK+C4dtVzpiZqLQ4=; b=n/MERs5tRa7fMRqwi43Nhw143nMxUdTx1DsOb2d1LYDAMF2UgoTh1FS8GACB9h52YQ43a7 w6raW35bJ59zKIAA== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 7DABC13462; Tue, 30 Jan 2024 10:03:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id Z7anHlvJuGXocgAAn2gu4w (envelope-from ); Tue, 30 Jan 2024 10:03:07 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 1C92CA0807; Tue, 30 Jan 2024 11:03:07 +0100 (CET) Date: Tue, 30 Jan 2024 11:03:07 +0100 From: Jan Kara To: Christoph Hellwig Cc: linux-mm@kvack.org, 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: Re: [PATCH 18/19] iomap: Convert iomap_writepages() to use for_each_writeback_folio() Message-ID: <20240130100307.5ub22s5ajanqstp6@quack3> References: <20240125085758.2393327-1-hch@lst.de> <20240125085758.2393327-19-hch@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240125085758.2393327-19-hch@lst.de> X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=vVZFDbYX; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="n/MERs5t" X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.01 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[11]; DBL_BLOCKED_OPENRESOLVER(0.00)[lst.de:email,suse.cz:dkim,suse.cz:email,infradead.org:email,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Score: -4.01 X-Rspamd-Queue-Id: 9C9FD1F83F X-Spam-Flag: NO On Thu 25-01-24 09:57:57, Christoph Hellwig wrote: > 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 Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > 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 > -- Jan Kara SUSE Labs, CR