]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: pass flag on graceful teardown to targets
authorJavier González <javier@javigon.com>
Fri, 1 Jun 2018 13:04:24 +0000 (15:04 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 1 Jun 2018 13:43:53 +0000 (07:43 -0600)
commitf0dc8be6ea4743f21fe1eb53d48a6b359474f77c
treed82d1ed53aa6053714b27c2fcd491fc9c32d0c2f
parent6b70f03ce741d43168d18eed33d29eb0c131eb72
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>
drivers/lightnvm/core.c
drivers/lightnvm/pblk-core.c
drivers/lightnvm/pblk-gc.c
drivers/lightnvm/pblk-init.c
drivers/lightnvm/pblk.h
include/linux/lightnvm.h