mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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>
This commit is contained in:
parent
3681c85dff
commit
4c9dacb82d
6 changed files with 116 additions and 2 deletions
|
@ -355,6 +355,7 @@ struct nvm_dev {
|
|||
char name[DISK_NAME_LEN];
|
||||
|
||||
struct mutex mlock;
|
||||
spinlock_t lock;
|
||||
};
|
||||
|
||||
static 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 *,
|
|||
typedef struct nvm_lun *(nvmm_get_lun_fn)(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);
|
||||
typedef void (nvmm_put_area_fn)(struct nvm_dev *, sector_t);
|
||||
|
||||
struct nvmm_type {
|
||||
const char *name;
|
||||
unsigned int version[3];
|
||||
|
@ -491,6 +495,10 @@ struct nvmm_type {
|
|||
|
||||
/* Statistics */
|
||||
nvmm_lun_info_print_fn *lun_info_print;
|
||||
|
||||
nvmm_get_area_fn *get_area;
|
||||
nvmm_put_area_fn *put_area;
|
||||
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue