Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp113875rdb; Thu, 21 Dec 2023 04:34:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsii5xDV+fFiowIKhx9xy41fCWvQfxjuBJ2VRHopfExzGJyeCGxARZP08289yUi7y97uaW X-Received: by 2002:a17:902:ced2:b0:1d3:e8a5:7562 with SMTP id d18-20020a170902ced200b001d3e8a57562mr4485137plg.96.1703162039952; Thu, 21 Dec 2023 04:33:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703162039; cv=none; d=google.com; s=arc-20160816; b=Hh1RmWnDB6V6PFkT77FZd7RQZHn33iPIH35JDMwbYTluXq5OD8VG7V30OruZP6lY6v 1m3CoyehRH29wB+Tx9VauVhkcUzjhCz7/CrKRhnAFzOC10BFDDH/pHuTZqlNWZQ3GZjh eJW9GRCQ2WdJ0KpBA7Pa/Mo5EN0OjL8FX9BtaJu+SKpdJ3L6v9uGOuprICqlvJNXMRUh cjIy1fayDmjyQEO6GKF4zsX1JFDSYS+/K4FHwNts9cHUZRS+LR+5E7Q45JVXZr7wJgHH HZyCg8KcmNA0iULlfiiwIwmWP0gjjh2ukjvWneGCRaHsWfae8gR6vD5RUxKdyvsDq7oS u4AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=yL1k7aPBdFuikd6gTcTDOHjclLMX1P1DfZ3srqjMT4s=; fh=3T/uzv0xyCZLLhq6yN0VP/iWDb5rAjk7q7jsl6ANsZ0=; b=jQUxAjBaeSNFd3sZIdpTXTVcSP3lp9e3g1islwyX9al/ZQnRtg2fkl0xhy5EeUJmhv kyD+H5OwJ0vncP0a3aTxPvQ/fWKCZhS/vPtxv57mRXW0/oGzpcwL2oFDD/muOYIZl/wJ YTCJUtawKLlZWdgsq9WMCH2jdOlH3jGQ8+4gJxMRpWlZKUPF/tfp9dITcLXwP0SjA3av hsYTMsq18cNk+W1qI0FEzoDL2xELNDFpC8QhBFQpH1qS8Z+Yrly+Pv29LsV8g1VoK2+j 464EUPX5IuZyNtLXamvEqxoelwHUlpdnRVNONDPrJrlweaIbktvWk9egvMw/vJMgwuTM nJaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8337-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8337-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id jc11-20020a17090325cb00b001d3ed1548b4si1363043plb.476.2023.12.21.04.33.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:33:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8337-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8337-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8337-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 B3D92B25B5C for ; Thu, 21 Dec 2023 12:30:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 895C9745CA; Thu, 21 Dec 2023 12:29:16 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 DB6256F601; Thu, 21 Dec 2023 12:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id AD52568B05; Thu, 21 Dec 2023 13:29:10 +0100 (CET) Date: Thu, 21 Dec 2023 13:29:10 +0100 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , linux-mm@kvack.org, "Matthew Wilcox (Oracle)" , Jan Kara , David Howells , Brian Foster , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 15/17] writeback: Add for_each_writeback_folio() Message-ID: <20231221122910.GF17956@lst.de> References: <20231218153553.807799-1-hch@lst.de> <20231218153553.807799-16-hch@lst.de> <20231221115149.ke74ddapwb7q6fdz@quack3> 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: <20231221115149.ke74ddapwb7q6fdz@quack3> User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Dec 21, 2023 at 12:51:49PM +0100, Jan Kara wrote: > On Mon 18-12-23 16:35:51, Christoph Hellwig wrote: > > From: "Matthew Wilcox (Oracle)" > > > > Wrap up the iterator with a nice bit of syntactic sugar. Now the > > caller doesn't need to know about wbc->err and can just return error, > > not knowing that the iterator took care of storing errors correctly. > > > > Signed-off-by: Matthew Wilcox (Oracle) > > Signed-off-by: Christoph Hellwig > > Not sure if the trick with 'error' variable isn't a bit too clever for us > ;) We'll see how many bugs it will cause in the future... It's a bit too much syntactic sugar for my taste, but if we want a magic for macro I can't really see a good way around it. I personally wouldn't mind a version where the writeback_get_folio moves out of writeback_iter_init and the pattern would look more like: writeback_iter_init(mapping, wbc); while ((folio = writeback_iter_next(mapping, wbc, folio))) { wbc->err = } return wbc->err;