From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH 36/51] writeback: implement bdi_for_each_wb() Date: Wed, 1 Jul 2015 22:22:26 -0400 Message-ID: <20150702022226.GH26440@mtj.duckdns.org> References: <1432329245-5844-1-git-send-email-tj@kernel.org> <1432329245-5844-37-git-send-email-tj@kernel.org> <20150701072757.GW7252@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, hch@infradead.org, hannes@cmpxchg.org, linux-fsdevel@vger.kernel.org, vgoyal@redhat.com, lizefan@huawei.com, cgroups@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.cz, clm@fb.com, fengguang.wu@intel.com, david@fromorbit.com, gthelen@google.com, khlebnikov@yandex-team.ru To: Jan Kara Return-path: Content-Disposition: inline In-Reply-To: <20150701072757.GW7252@quack.suse.cz> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Jul 01, 2015 at 09:27:57AM +0200, Jan Kara wrote: > > +#define bdi_for_each_wb(wb_cur, bdi, iter, start_blkcg_id) \ > > + for ((iter)->next_id = (start_blkcg_id); \ > > + ({ (wb_cur) = !(iter)->next_id++ ? &(bdi)->wb : NULL; }); ) > > + > > This looks quite confusing. Won't it be easier to understand as: > > struct wb_iter { > } __attribute__ ((unused)); > > #define bdi_for_each_wb(wb_cur, bdi, iter, start_blkcg_id) \ > if (((wb_cur) = (!start_blkcg_id ? &(bdi)->wb : NULL))) But then break or continue wouldn't work as expected. It can get really confusing when it's wrapped by an outer loop. Thanks. -- tejun -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org