Re: [PATCH] block: don't use for-inside-for in bio_for_each_segment_all

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 07, 2019 at 03:54:16PM +0800, Ming Lei wrote:
> > OK, will move index check into mp_bvec_advance.
> 
> oops, I recall the above line, because:
> 
> 1) the index check expression is quite straight-forward
> 
> 2) it has been in my todo list to re-use bvec_advance() to re-write
> iterate_bvec()
> given bvec_advance() is much light-weight than for_each_bvec(). If we
> move the index check into bvec_advance(), the helper has to be moved
> to bio.h, then we can't use that for iterate_bvec().

You can always create a tiny wrapper around bvec_advance() that sits
in bio.h.  Which in general is much better style than complex
expressions inside of loops inside of macros..



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux