aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/lightnvm.h
diff options
context:
space:
mode:
authorMatias Bjørling <mb@lightnvm.io>2018-10-09 07:11:36 -0400
committerJens Axboe <axboe@kernel.dk>2018-10-09 10:25:06 -0400
commitaff3fb18f957de93e629c7d3d2c4ef1f360aa511 (patch)
tree9a4d00e5ebdbad312cf5dc4ce3379097010ecb03 /include/linux/lightnvm.h
parentd8adaa3b86324c6186d0adf74bc256bdacfffdb6 (diff)
lightnvm: move bad block and chunk state logic to core
pblk implements two data paths for recovery line state. One for 1.2 and another for 2.0, instead of having pblk implement these, combine them in the core to reduce complexity and make available to other targets. The new interface will adhere to the 2.0 chunk definition, including managing open chunks with an active write pointer. To provide this interface, a 1.2 device recovers the state of the chunks by manually detecting if a chunk is either free/open/close/offline, and if open, scanning the flash pages sequentially to find the next writeable page. This process takes on average ~10 seconds on a device with 64 dies, 1024 blocks and 60us read access time. The process can be parallelized but is left out for maintenance simplicity, as the 1.2 specification is deprecated. For 2.0 devices, the logic is maintained internally in the drive and retrieved through the 2.0 interface. Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/lightnvm.h')
-rw-r--r--include/linux/lightnvm.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index f4a84694e5e2..0106984400bc 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -86,8 +86,8 @@ struct nvm_chk_meta;
86typedef int (nvm_id_fn)(struct nvm_dev *); 86typedef int (nvm_id_fn)(struct nvm_dev *);
87typedef int (nvm_op_bb_tbl_fn)(struct nvm_dev *, struct ppa_addr, u8 *); 87typedef int (nvm_op_bb_tbl_fn)(struct nvm_dev *, struct ppa_addr, u8 *);
88typedef int (nvm_op_set_bb_fn)(struct nvm_dev *, struct ppa_addr *, int, int); 88typedef int (nvm_op_set_bb_fn)(struct nvm_dev *, struct ppa_addr *, int, int);
89typedef int (nvm_get_chk_meta_fn)(struct nvm_dev *, struct nvm_chk_meta *, 89typedef int (nvm_get_chk_meta_fn)(struct nvm_dev *, sector_t, int,
90 sector_t, int); 90 struct nvm_chk_meta *);
91typedef int (nvm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *); 91typedef int (nvm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *);
92typedef int (nvm_submit_io_sync_fn)(struct nvm_dev *, struct nvm_rq *); 92typedef int (nvm_submit_io_sync_fn)(struct nvm_dev *, struct nvm_rq *);
93typedef void *(nvm_create_dma_pool_fn)(struct nvm_dev *, char *); 93typedef void *(nvm_create_dma_pool_fn)(struct nvm_dev *, char *);
@@ -532,18 +532,13 @@ extern struct nvm_dev *nvm_alloc_dev(int);
532extern int nvm_register(struct nvm_dev *); 532extern int nvm_register(struct nvm_dev *);
533extern void nvm_unregister(struct nvm_dev *); 533extern void nvm_unregister(struct nvm_dev *);
534 534
535 535extern int nvm_get_chunk_meta(struct nvm_tgt_dev *, struct ppa_addr,
536extern int nvm_get_chunk_meta(struct nvm_tgt_dev *tgt_dev, 536 int, struct nvm_chk_meta *);
537 struct nvm_chk_meta *meta, struct ppa_addr ppa, 537extern int nvm_set_chunk_meta(struct nvm_tgt_dev *, struct ppa_addr *,
538 int nchks);
539
540extern int nvm_set_tgt_bb_tbl(struct nvm_tgt_dev *, struct ppa_addr *,
541 int, int); 538 int, int);
542extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *); 539extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *);
543extern int nvm_submit_io_sync(struct nvm_tgt_dev *, struct nvm_rq *); 540extern int nvm_submit_io_sync(struct nvm_tgt_dev *, struct nvm_rq *);
544extern void nvm_end_io(struct nvm_rq *); 541extern void nvm_end_io(struct nvm_rq *);
545extern int nvm_bb_tbl_fold(struct nvm_dev *, u8 *, int);
546extern int nvm_get_tgt_bb_tbl(struct nvm_tgt_dev *, struct ppa_addr, u8 *);
547 542
548#else /* CONFIG_NVM */ 543#else /* CONFIG_NVM */
549struct nvm_dev_ops; 544struct nvm_dev_ops;