lightnvm: pblk: use rqd->end_io for completion
authorJavier González <javier@cnexlabs.com>
Fri, 13 Oct 2017 12:46:21 +0000 (14:46 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Oct 2017 14:34:57 +0000 (08:34 -0600)
For consistency with the rest of pblk, use rqd->end_io to point to the
function taking care of ending the request on the completion path.

Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-core.c
drivers/lightnvm/pblk-read.c

index 0de3875211b17432094c96ae456647b7fb864211..08d166ac4f3c0bbf6aba94c5ba6616d1640d0325 100644 (file)
@@ -261,13 +261,6 @@ void pblk_write_should_kick(struct pblk *pblk)
                pblk_write_kick(pblk);
 }
 
-void pblk_end_bio_sync(struct bio *bio)
-{
-       struct completion *waiting = bio->bi_private;
-
-       complete(waiting);
-}
-
 void pblk_end_io_sync(struct nvm_rq *rqd)
 {
        struct completion *waiting = rqd->private;
index d7c90c303540ff3e264920fa9676653f732eda2f..0299fc08291d746ee664cdb49ed0712183dbf4d0 100644 (file)
@@ -170,13 +170,12 @@ static int pblk_fill_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd,
 
        new_bio->bi_iter.bi_sector = 0; /* internal bio */
        bio_set_op_attrs(new_bio, REQ_OP_READ, 0);
-       new_bio->bi_private = &wait;
-       new_bio->bi_end_io = pblk_end_bio_sync;
 
        rqd->bio = new_bio;
        rqd->nr_ppas = nr_holes;
        rqd->flags = pblk_set_read_mode(pblk, PBLK_READ_RANDOM);
-       rqd->end_io = NULL;
+       rqd->end_io = pblk_end_io_sync;
+       rqd->private = &wait;
 
        if (unlikely(nr_secs > 1 && nr_holes == 1)) {
                ppa_ptr = rqd->ppa_list;