mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
lightnvm: break the loop when rqd is not null
Break the loop when rqd is not null to reduce an unnecessary schedule. Signed-off-by: Wenwei Tao <[email protected]> Signed-off-by: Matias Bjørling <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
f98d9ca17f
commit
0de2415bb7
1 changed files with 5 additions and 2 deletions
|
|
@ -96,10 +96,13 @@ static void rrpc_discard(struct rrpc *rrpc, struct bio *bio)
|
|||
sector_t len = bio->bi_iter.bi_size / RRPC_EXPOSED_PAGE_SIZE;
|
||||
struct nvm_rq *rqd;
|
||||
|
||||
do {
|
||||
while (1) {
|
||||
rqd = rrpc_inflight_laddr_acquire(rrpc, slba, len);
|
||||
if (rqd)
|
||||
break;
|
||||
|
||||
schedule();
|
||||
} while (!rqd);
|
||||
}
|
||||
|
||||
if (IS_ERR(rqd)) {
|
||||
pr_err("rrpc: unable to acquire inflight IO\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue