summaryrefslogtreecommitdiff
path: root/drivers/lightnvm/pblk-write.c
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2017-06-26 12:57:21 +0300
committerJens Axboe <axboe@kernel.dk>2017-06-27 01:27:39 +0300
commitf680f19aa6dbbbabf499250d49f18a426b14f1c2 (patch)
tree78dbe23eb94ec0680ed1f5ece1bec7916d124a23 /drivers/lightnvm/pblk-write.c
parentf9c101523da75cd483b95f04c21242bb83960d93 (diff)
downloadlinux-f680f19aa6dbbbabf499250d49f18a426b14f1c2.tar.xz
lightnvm: pblk: simplify meta. memory allocation
smeta size will always be suitable for a kmalloc allocation. Simplify the code and leave the vmalloc fallback only for emeta, where the pblk configuration has an impact. 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>
Diffstat (limited to 'drivers/lightnvm/pblk-write.c')
-rw-r--r--drivers/lightnvm/pblk-write.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/lightnvm/pblk-write.c b/drivers/lightnvm/pblk-write.c
index a29a34786ac5..3db2cbe5b788 100644
--- a/drivers/lightnvm/pblk-write.c
+++ b/drivers/lightnvm/pblk-write.c
@@ -442,7 +442,8 @@ fail_rollback:
list_add(&meta_line->list, &meta_line->list);
spin_unlock(&l_mg->close_lock);
fail_free_bio:
- bio_put(bio);
+ if (likely(l_mg->emeta_alloc_type == PBLK_VMALLOC_META))
+ bio_put(bio);
fail_free_rqd:
pblk_free_rqd(pblk, rqd, READ);
return ret;