summaryrefslogtreecommitdiffstats
path: root/include/linux/lightnvm.h
diff options
context:
space:
mode:
authorWenwei Tao <ww.tao0320@gmail.com>2016-03-03 15:06:38 +0100
committerJens Axboe <axboe@fb.com>2016-03-18 18:10:38 -0700
commitda1e284919b0b99c5bf0618b6c98cbaf2c17e62e (patch)
treeef1d8fe8821376dd57fbd4d3319a747841df38e6 /include/linux/lightnvm.h
parent4c9dacb82d5aa36aa2568df60d897f2eb3d8819b (diff)
downloadlinux-0-day-da1e284919b0b99c5bf0618b6c98cbaf2c17e62e.tar.gz
linux-0-day-da1e284919b0b99c5bf0618b6c98cbaf2c17e62e.tar.xz
lightnvm: add a bitmap of luns
Add a bitmap of luns to indicate the status of luns: inuse/available. When create targets do the necessary check to avoid allocating luns that are already allocated. Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com> Freed dev->lun_map if nvm_core_init later failed in the init process. Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/lightnvm.h')
-rw-r--r--include/linux/lightnvm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index b466bd9f2cf8a..0ee2c2c78ffd5 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -346,6 +346,7 @@ struct nvm_dev {
int nr_luns;
unsigned max_pages_per_blk;
+ unsigned long *lun_map;
void *ppalist_pool;
struct nvm_id identity;
@@ -466,6 +467,8 @@ typedef int (nvmm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *);
typedef int (nvmm_erase_blk_fn)(struct nvm_dev *, struct nvm_block *,
unsigned long);
typedef struct nvm_lun *(nvmm_get_lun_fn)(struct nvm_dev *, int);
+typedef int (nvmm_reserve_lun)(struct nvm_dev *, int);
+typedef void (nvmm_release_lun)(struct nvm_dev *, int);
typedef void (nvmm_lun_info_print_fn)(struct nvm_dev *);
typedef int (nvmm_get_area_fn)(struct nvm_dev *, sector_t *, sector_t);
@@ -492,6 +495,8 @@ struct nvmm_type {
/* Configuration management */
nvmm_get_lun_fn *get_lun;
+ nvmm_reserve_lun *reserve_lun;
+ nvmm_release_lun *release_lun;
/* Statistics */
nvmm_lun_info_print_fn *lun_info_print;