lkml.org 
[lkml]   [2020]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] block: Limit number of items taken from the I/O scheduler in one go
From
Date
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.

\
 
 \ /
  Last update: 2020-02-07 21:19    [W:0.097 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site