summaryrefslogtreecommitdiffstats
path: root/include/linux/lightnvm.h
diff options
context:
space:
mode:
authorWenwei Tao <ww.tao0320@gmail.com>2016-03-03 09:06:37 -0500
committerJens Axboe <axboe@fb.com>2016-03-18 21:10:37 -0400
commit4c9dacb82d5aa36aa2568df60d897f2eb3d8819b (patch)
treebd8e6a81aed966d79e50fc5cee3273c88a1a52ce /include/linux/lightnvm.h
parent3681c85dffda70e551dead31c8d102bd69033fe8 (diff)
lightnvm: specify target's logical address area
We can create more than one target on a lightnvm device by specifying its begin lun and end lun. But only specify the physical address area is not enough, we need to get the corresponding non- intersection logical address area division from the backend device's logcial address space. Otherwise the targets on the device might use the same logical addresses cause incorrect information in the device's l2p table. Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com> 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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index c3c43184a787..b466bd9f2cf8 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -355,6 +355,7 @@ struct nvm_dev {
355 char name[DISK_NAME_LEN]; 355 char name[DISK_NAME_LEN];
356 356
357 struct mutex mlock; 357 struct mutex mlock;
358 spinlock_t lock;
358}; 359};
359 360
360static inline struct ppa_addr generic_to_dev_addr(struct nvm_dev *dev, 361static inline struct ppa_addr generic_to_dev_addr(struct nvm_dev *dev,
@@ -467,6 +468,9 @@ typedef int (nvmm_erase_blk_fn)(struct nvm_dev *, struct nvm_block *,
467typedef struct nvm_lun *(nvmm_get_lun_fn)(struct nvm_dev *, int); 468typedef struct nvm_lun *(nvmm_get_lun_fn)(struct nvm_dev *, int);
468typedef void (nvmm_lun_info_print_fn)(struct nvm_dev *); 469typedef void (nvmm_lun_info_print_fn)(struct nvm_dev *);
469 470
471typedef int (nvmm_get_area_fn)(struct nvm_dev *, sector_t *, sector_t);
472typedef void (nvmm_put_area_fn)(struct nvm_dev *, sector_t);
473
470struct nvmm_type { 474struct nvmm_type {
471 const char *name; 475 const char *name;
472 unsigned int version[3]; 476 unsigned int version[3];
@@ -491,6 +495,10 @@ struct nvmm_type {
491 495
492 /* Statistics */ 496 /* Statistics */
493 nvmm_lun_info_print_fn *lun_info_print; 497 nvmm_lun_info_print_fn *lun_info_print;
498
499 nvmm_get_area_fn *get_area;
500 nvmm_put_area_fn *put_area;
501
494 struct list_head list; 502 struct list_head list;
495}; 503};
496 504