Re: [PATCH] block: Limit number of items taken from the I/O scheduler in one go

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

 



On 2/7/20 10:45 AM, Salman Qazi wrote:
If I were to write this as a for-loop, it will look like this:

for (i = 0; i == 0 || (run_again && i < 2); i++) {
/* another level of 8 character wide indentation */
     run_again = false;
    /* a bunch of code that possibly sets run_again to true
}

if (run_again)
     blk_mq_run_hw_queue(hctx, true);

That's not what I meant. What I meant is a loop that iterates at most two times and also to break out of the loop if run_again == false.

BTW, I share your concern about the additional indentation by eight positions. How about avoiding deeper indentation by introducing a new function?

Thanks,

Bart.



[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