summaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/pblk.h
diff options
context:
space:
mode:
authorJavier González2018-06-01 15:04:24 +0200
committerJens Axboe2018-06-01 15:43:53 +0200
commita7c9e9109ca1142f33b882615cc5fa048e07f3ea (patch)
treed82d1ed53aa6053714b27c2fcd491fc9c32d0c2f /drivers/lightnvm/pblk.h
parentlightnvm: pblk: check for chunk size before allocating it (diff)
downloadkernel-qcow2-linux-a7c9e9109ca1142f33b882615cc5fa048e07f3ea.tar.gz
kernel-qcow2-linux-a7c9e9109ca1142f33b882615cc5fa048e07f3ea.tar.xz
kernel-qcow2-linux-a7c9e9109ca1142f33b882615cc5fa048e07f3ea.zip
lightnvm: pass flag on graceful teardown to targets
If the namespace is unregistered before the LightNVM target is removed (e.g., on hot unplug) it is too late for the target to store any metadata on the device - any attempt to write to the device will fail. In this case, pass on a "gracefull teardown" flag to the target to let it know when this happens. In the case of pblk, we pad the open line (close all open chunks) to improve data retention. In the event of an ungraceful shutdown, avoid this part and just clean up. 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/pblk.h')
-rw-r--r--drivers/lightnvm/pblk.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
index 97c0dd5f4857..2399db1b479a 100644
--- a/drivers/lightnvm/pblk.h
+++ b/drivers/lightnvm/pblk.h
@@ -771,6 +771,8 @@ void pblk_line_close_meta(struct pblk *pblk, struct pblk_line *line);
void pblk_line_close(struct pblk *pblk, struct pblk_line *line);
void pblk_line_close_ws(struct work_struct *work);
void pblk_pipeline_stop(struct pblk *pblk);
+void __pblk_pipeline_stop(struct pblk *pblk);
+void __pblk_pipeline_flush(struct pblk *pblk);
void pblk_gen_run_ws(struct pblk *pblk, struct pblk_line *line, void *priv,
void (*work)(struct work_struct *), gfp_t gfp_mask,
struct workqueue_struct *wq);
@@ -864,7 +866,7 @@ int pblk_recov_setup_rq(struct pblk *pblk, struct pblk_c_ctx *c_ctx,
#define PBLK_GC_RSV_LINE 1 /* Reserved lines for GC */
int pblk_gc_init(struct pblk *pblk);
-void pblk_gc_exit(struct pblk *pblk);
+void pblk_gc_exit(struct pblk *pblk, bool graceful);
void pblk_gc_should_start(struct pblk *pblk);
void pblk_gc_should_stop(struct pblk *pblk);
void pblk_gc_should_kick(struct pblk *pblk);