summaryrefslogtreecommitdiff
path: root/drivers/lightnvm/pblk-init.c
diff options
context:
space:
mode:
authorJavier González <javier@javigon.com>2018-10-09 14:12:01 +0300
committerJens Axboe <axboe@kernel.dk>2018-10-09 17:25:07 +0300
commit090ee26fd51270cc3bd54a0efbc716ede320ad27 (patch)
treeb5f64b5f0b285e7a391b8defcf826395d6ba1fbb /drivers/lightnvm/pblk-init.c
parent7325b4bbe5952e3e939f15de812f2ee0c0d33ca9 (diff)
downloadlinux-090ee26fd51270cc3bd54a0efbc716ede320ad27.tar.xz
lightnvm: use internal allocation for chunk log page
The lightnvm subsystem provides helpers to retrieve chunk metadata, where the target needs to provide a buffer to store the metadata. An implicit assumption is that this buffer is contiguous and can be used to retrieve the data from the device. If the device exposes too many chunks, then kmalloc might fail, thus failing instance creation. This patch removes this assumption by implementing an internal buffer in the lightnvm subsystem to retrieve chunk metadata. Targets can then use virtual memory allocations. Since this is a target API change, adapt pblk accordingly. Signed-off-by: Javier González <javier@cnexlabs.com> Reviewed-by: Hans Holmberg <hans.holmberg@cnexlabs.com> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-init.c')
-rw-r--r--drivers/lightnvm/pblk-init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index fb66bc84d5ca..7ef8249108f0 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -1039,7 +1039,7 @@ static int pblk_lines_init(struct pblk *pblk)
pblk_set_provision(pblk, nr_free_chks);
- kfree(chunk_meta);
+ vfree(chunk_meta);
return 0;
fail_free_lines: