diff options
author | Javier González <jg@lightnvm.io> | 2016-11-29 00:39:11 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-29 22:12:51 +0300 |
commit | 959e911b31981b52ed3f3d6e351b107bcb9163ef (patch) | |
tree | 52f99be3c1f8fb556f3314b702547929d2f0559b /drivers/lightnvm/core.c | |
parent | 8e53624d44c1de31b1b0d4f500703669418a4c67 (diff) | |
download | linux-959e911b31981b52ed3f3d6e351b107bcb9163ef.tar.xz |
lightnvm: introduce helpers for generic ops in rrpc
Avoid calling media manager and device-specific operations directly from
rrpc. Create helper functions on lightnvm's core instead.
Signed-off-by: Javier González <javier@cnexlabs.com>
Made it work with null_blk as well.
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm/core.c')
-rw-r--r-- | drivers/lightnvm/core.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 23d582f82219..69f261e650bc 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -219,6 +219,28 @@ int nvm_erase_blk(struct nvm_tgt_dev *tgt_dev, struct ppa_addr *p, int flags) } EXPORT_SYMBOL(nvm_erase_blk); +int nvm_get_l2p_tbl(struct nvm_dev *dev, u64 slba, u32 nlb, + nvm_l2p_update_fn *update_l2p, void *priv) +{ + if (!dev->ops->get_l2p_tbl) + return 0; + + return dev->ops->get_l2p_tbl(dev, slba, nlb, update_l2p, priv); +} +EXPORT_SYMBOL(nvm_get_l2p_tbl); + +int nvm_get_area(struct nvm_dev *dev, sector_t *lba, sector_t len) +{ + return dev->mt->get_area(dev, lba, len); +} +EXPORT_SYMBOL(nvm_get_area); + +void nvm_put_area(struct nvm_dev *dev, sector_t lba) +{ + dev->mt->put_area(dev, lba); +} +EXPORT_SYMBOL(nvm_put_area); + void nvm_addr_to_generic_mode(struct nvm_dev *dev, struct nvm_rq *rqd) { int i; |