Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1526617

[PATCH 7/8] lightnvm: introduce max_phys_sects helper function

From "Javier González" <jg@lightnvm.io>
Newsgroups linux.kernel
Subject [PATCH 7/8] lightnvm: introduce max_phys_sects helper function
Date 2016-11-21 13:20 +0100
Message-ID <sFVJM-15x-23@gated-at.bofh.it> (permalink)
References <sFVJL-15x-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/lightnvm/core.c  | 8 ++++++++
 include/linux/lightnvm.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 69f261e..3d8eaac 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;
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index b3ca603..44780ef 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -529,6 +529,7 @@ extern void nvm_unregister(struct nvm_dev *);
 extern int nvm_set_bb_tbl(struct nvm_dev *dev, struct ppa_addr *ppas,
 							int nr_ppas, int type);
 
+extern int nvm_max_phys_sects(struct nvm_tgt_dev *);
 extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *);
 extern void nvm_generic_to_addr_mode(struct nvm_dev *, struct nvm_rq *);
 extern void nvm_addr_to_generic_mode(struct nvm_dev *, struct nvm_rq *);
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] lightnvm: simplify media manager V2 "Javier González" <jg@lightnvm.io> - 2016-11-21 13:20 +0100
  [PATCH 2/8] lightnvm: remove get_lun operation on gennvm "Javier González" <jg@lightnvm.io> - 2016-11-21 13:20 +0100
  [PATCH 6/8] lightnvm: introduce helpers for generic ops in rrpc "Javier González" <jg@lightnvm.io> - 2016-11-21 13:20 +0100
  [PATCH 8/8] lightnvm: use target nvm on target-specific ops. "Javier González" <jg@lightnvm.io> - 2016-11-21 13:20 +0100
  [PATCH 7/8] lightnvm: introduce max_phys_sects helper function "Javier González" <jg@lightnvm.io> - 2016-11-21 13:20 +0100
  [PATCH 3/8] lightnvm: remove debug lun statistics from gennvm "Javier González" <jg@lightnvm.io> - 2016-11-21 13:20 +0100
  [PATCH 4/8] lightnvm: eliminate nvm_block abstraction on mm "Javier González" <jg@lightnvm.io> - 2016-11-21 13:20 +0100
  [PATCH 5/8] lightnvm: eliminate nvm_lun abstraction in mm "Javier González" <jg@lightnvm.io> - 2016-11-21 13:20 +0100
  Re: [PATCH 0/8] lightnvm: simplify media manager V2 Matias Bjørling <mb@lightnvm.io> - 2016-11-23 13:10 +0100
    Re: [PATCH 0/8] lightnvm: simplify media manager V2 Javier González <jg@lightnvm.io> - 2016-11-23 13:20 +0100

csiph-web