diff options
author | Javier González <javier@cnexlabs.com> | 2018-03-29 18:05:17 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-03-29 19:29:09 -0400 |
commit | a294c199455187d124b0760fa8f86c13cdaa4b25 (patch) | |
tree | 15df9cbb23f8fd0286db1f2671498f73914233ab /drivers/lightnvm | |
parent | 7100d50a7e58a6884368001e2b1a32b7169c072c (diff) |
lightnvm: implement get log report chunk helpers
The 2.0 spec provides a report chunk log page that can be retrieved
using the stangard nvme get log page. This replaces the dedicated
get/put bad block table in 1.2.
This patch implements the helper functions to allow targets retrieve the
chunk metadata using get log page. It makes nvme_get_log_ext available
outside of nvme core so that we can use it form lightnvm.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r-- | drivers/lightnvm/core.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 77901bf17416..63171cdce270 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c | |||
@@ -712,6 +712,17 @@ static void nvm_free_rqd_ppalist(struct nvm_tgt_dev *tgt_dev, | |||
712 | nvm_dev_dma_free(tgt_dev->parent, rqd->ppa_list, rqd->dma_ppa_list); | 712 | nvm_dev_dma_free(tgt_dev->parent, rqd->ppa_list, rqd->dma_ppa_list); |
713 | } | 713 | } |
714 | 714 | ||
715 | int nvm_get_chunk_meta(struct nvm_tgt_dev *tgt_dev, struct nvm_chk_meta *meta, | ||
716 | struct ppa_addr ppa, int nchks) | ||
717 | { | ||
718 | struct nvm_dev *dev = tgt_dev->parent; | ||
719 | |||
720 | nvm_ppa_tgt_to_dev(tgt_dev, &ppa, 1); | ||
721 | |||
722 | return dev->ops->get_chk_meta(tgt_dev->parent, meta, | ||
723 | (sector_t)ppa.ppa, nchks); | ||
724 | } | ||
725 | EXPORT_SYMBOL(nvm_get_chunk_meta); | ||
715 | 726 | ||
716 | int nvm_set_tgt_bb_tbl(struct nvm_tgt_dev *tgt_dev, struct ppa_addr *ppas, | 727 | int nvm_set_tgt_bb_tbl(struct nvm_tgt_dev *tgt_dev, struct ppa_addr *ppas, |
717 | int nr_ppas, int type) | 728 | int nr_ppas, int type) |