public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lightnvm: expose mark_blk through core
@ 2016-05-10  7:25 Javier González
  2016-05-23  8:32 ` Matias Bjørling
  0 siblings, 1 reply; 2+ messages in thread
From: Javier González @ 2016-05-10  7:25 UTC (permalink / raw)
  To: mb; +Cc: linux-kernel, linux-block, Javier González

Expose mark_blk through the core LightNVM operations to hid the media
manager, as we do for the rest of the block operations. This is
necessary for targets to mark a growing bad block as bad before
returning it to the media manager.

Signed-off-by: Javier González <javier@cnexlabs.com>
---
 drivers/lightnvm/core.c  | 6 ++++++
 include/linux/lightnvm.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 160c1a6..13993c9 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -210,6 +210,12 @@ void nvm_put_blk(struct nvm_dev *dev, struct nvm_block *blk)
 }
 EXPORT_SYMBOL(nvm_put_blk);
 
+void nvm_mark_blk(struct nvm_dev *dev, struct ppa_addr ppa, int type)
+{
+	return dev->mt->mark_blk(dev, ppa, type);
+}
+EXPORT_SYMBOL(nvm_mark_blk);
+
 int nvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
 {
 	return dev->mt->submit_io(dev, rqd);
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index ef2c7d2..9c56148 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -532,6 +532,8 @@ extern int nvm_register(struct request_queue *, char *,
 						struct nvm_dev_ops *);
 extern void nvm_unregister(char *);
 
+void nvm_mark_blk(struct nvm_dev *dev, struct ppa_addr ppa, int type);
+
 extern int nvm_submit_io(struct nvm_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.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lightnvm: expose mark_blk through core
  2016-05-10  7:25 [PATCH] lightnvm: expose mark_blk through core Javier González
@ 2016-05-23  8:32 ` Matias Bjørling
  0 siblings, 0 replies; 2+ messages in thread
From: Matias Bjørling @ 2016-05-23  8:32 UTC (permalink / raw)
  To: Javier González; +Cc: linux-kernel, linux-block, Javier González

On 05/10/2016 09:25 AM, Javier González wrote:
> Expose mark_blk through the core LightNVM operations to hid the media
> manager, as we do for the rest of the block operations. This is
> necessary for targets to mark a growing bad block as bad before
> returning it to the media manager.
>
> Signed-off-by: Javier González <javier@cnexlabs.com>
> ---
>   drivers/lightnvm/core.c  | 6 ++++++
>   include/linux/lightnvm.h | 2 ++
>   2 files changed, 8 insertions(+)
>
> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> index 160c1a6..13993c9 100644
> --- a/drivers/lightnvm/core.c
> +++ b/drivers/lightnvm/core.c
> @@ -210,6 +210,12 @@ void nvm_put_blk(struct nvm_dev *dev, struct nvm_block *blk)
>   }
>   EXPORT_SYMBOL(nvm_put_blk);
>
> +void nvm_mark_blk(struct nvm_dev *dev, struct ppa_addr ppa, int type)
> +{
> +	return dev->mt->mark_blk(dev, ppa, type);
> +}
> +EXPORT_SYMBOL(nvm_mark_blk);
> +
>   int nvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
>   {
>   	return dev->mt->submit_io(dev, rqd);
> diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
> index ef2c7d2..9c56148 100644
> --- a/include/linux/lightnvm.h
> +++ b/include/linux/lightnvm.h
> @@ -532,6 +532,8 @@ extern int nvm_register(struct request_queue *, char *,
>   						struct nvm_dev_ops *);
>   extern void nvm_unregister(char *);
>
> +void nvm_mark_blk(struct nvm_dev *dev, struct ppa_addr ppa, int type);
> +
>   extern int nvm_submit_io(struct nvm_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 *);
>

Thanks Javier. Applied for 4.8. I updated the description a bit.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-23  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10  7:25 [PATCH] lightnvm: expose mark_blk through core Javier González
2016-05-23  8:32 ` Matias Bjørling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox