summaryrefslogtreecommitdiff
path: root/drivers/lightnvm/core.c
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2016-11-28 22:39:12 +0100
committerJens Axboe <axboe@fb.com>2016-11-29 12:12:51 -0700
commita279006afa3377493c4240395c70430f2a9b0d2b (patch)
tree62ee298ab61bd4a06d35f6d303ddfc526032882b /drivers/lightnvm/core.c
parent959e911b31981b52ed3f3d6e351b107bcb9163ef (diff)
lightnvm: introduce max_phys_sects helper function
Target devices do not have access to the device driver operations. Introduce a helper function that exposes the max. number of physical sectors supported by the underlying device. Signed-off-by: Javier González <javier@cnexlabs.com> 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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 69f261e650bc..3d8eaac99ba8 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -203,6 +203,14 @@ int nvm_set_bb_tbl(struct nvm_dev *dev, struct ppa_addr *ppas, int nr_ppas,
}
EXPORT_SYMBOL(nvm_set_bb_tbl);
+int nvm_max_phys_sects(struct nvm_tgt_dev *tgt_dev)
+{
+ struct nvm_dev *dev = tgt_dev->parent;
+
+ return dev->ops->max_phys_sect;
+}
+EXPORT_SYMBOL(nvm_max_phys_sects);
+
int nvm_submit_io(struct nvm_tgt_dev *tgt_dev, struct nvm_rq *rqd)
{
struct nvm_dev *dev = tgt_dev->parent;