lightnvm: pblk: remove unnecessary indirection
authorJavier González <javier@javigon.com>
Fri, 1 Jun 2018 13:04:21 +0000 (15:04 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 1 Jun 2018 13:43:53 +0000 (07:43 -0600)
Call nvm_submit_io directly and remove an unnecessary indirection on the
read path.

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

index 5adfc4739cfddd1ddb3ecc2294e61f536b82b5ba..38f89a84ce5eb14af7bf676226e749df1b808881 100644 (file)
@@ -102,16 +102,6 @@ next:
 #endif
 }
 
-static int pblk_submit_read_io(struct pblk *pblk, struct nvm_rq *rqd)
-{
-       int err;
-
-       err = pblk_submit_io(pblk, rqd);
-       if (err)
-               return NVM_IO_ERR;
-
-       return NVM_IO_OK;
-}
 
 static void pblk_read_check_seq(struct pblk *pblk, struct nvm_rq *rqd,
                                sector_t blba)
@@ -485,9 +475,9 @@ int pblk_submit_read(struct pblk *pblk, struct bio *bio)
                rqd->bio = int_bio;
                r_ctx->private = bio;
 
-               ret = pblk_submit_read_io(pblk, rqd);
-               if (ret) {
+               if (pblk_submit_io(pblk, rqd)) {
                        pr_err("pblk: read IO submission failed\n");
+                       ret = NVM_IO_ERR;
                        if (int_bio)
                                bio_put(int_bio);
                        goto fail_end_io;