lkml.org 
[lkml]   [2015]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 36/51] writeback: implement bdi_for_each_wb()
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


\
 
 \ /
  Last update: 2015-07-02 04:41    [W:0.121 / U:0.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site