Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0de2415b authored by Wenwei Tao's avatar Wenwei Tao Committed by Jens Axboe
Browse files

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: default avatarWenwei Tao <ww.tao0320@gmail.com>
Signed-off-by: default avatarMatias Bjørling <m@bjorling.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent f98d9ca1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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");