Skip to content

Commit

Permalink
lightnvm: pblk: remove unnecessary checks
Browse files Browse the repository at this point in the history
Remove unnecessary checks when freeing dma memory in the completion
path.

Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Javier González authored and Jens Axboe committed Jul 7, 2017
1 parent 3eaa11e commit 56c7641
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/lightnvm/pblk-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ static unsigned long pblk_end_w_bio(struct pblk *pblk, struct nvm_rq *rqd,

ret = pblk_rb_sync_advance(&pblk->rwb, c_ctx->nr_valid);

if (rqd->meta_list)
nvm_dev_dma_free(dev->parent, rqd->meta_list,
rqd->dma_meta_list);
nvm_dev_dma_free(dev->parent, rqd->meta_list, rqd->dma_meta_list);

bio_put(rqd->bio);
pblk_free_rqd(pblk, rqd, WRITE);
Expand Down Expand Up @@ -224,9 +222,6 @@ static int pblk_alloc_w_rq(struct pblk *pblk, struct nvm_rq *rqd,
if (!rqd->meta_list)
return -ENOMEM;

if (unlikely(nr_secs == 1))
return 0;

rqd->ppa_list = rqd->meta_list + pblk_dma_meta_size;
rqd->dma_ppa_list = rqd->dma_meta_list + pblk_dma_meta_size;

Expand Down

0 comments on commit 56c7641

Please sign in to comment.