summaryrefslogtreecommitdiff
path: root/drivers/lightnvm/rrpc.c
diff options
context:
space:
mode:
authorWenwei Tao <ww.tao0320@gmail.com>2016-07-07 09:54:07 +0200
committerJens Axboe <axboe@fb.com>2016-07-07 08:51:52 -0600
commit0de2415bb730ee26ce4c90778696d3559f4312c5 (patch)
treeac387b41c21c9bad29f4f44de73e9f127c88e5c3 /drivers/lightnvm/rrpc.c
parentf98d9ca17fbddd82980bc20abfabd5b405ecade4 (diff)
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 <ww.tao0320@gmail.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm/rrpc.c')
-rw-r--r--drivers/lightnvm/rrpc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index de86d72dcdf0..736e66968bc6 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -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");