]> git.karo-electronics.de Git - karo-tx-linux.git/commit
lightnvm: manage open and closed blocks separately
authorJavier González <jg@lightnvm.io>
Tue, 12 Jan 2016 06:49:33 +0000 (07:49 +0100)
committerJens Axboe <axboe@fb.com>
Tue, 12 Jan 2016 15:21:17 +0000 (08:21 -0700)
commitff0e498bfa185fad5e86c4c7a2db4f9648d2344f
tree52cf32454a651b0f90e81987353dc1ce0fbad5a7
parentb5d4acd4cbf5029a2616084d9e9f392046d53a37
lightnvm: manage open and closed blocks separately

LightNVM targets need to know the state of the flash block when doing
flash optimizations. An example is implementing a write buffer to
respect the flash page size. Currently, block state is not accounted
for; the media manager only differentiates among free, bad and in-use
blocks.

This patch adds the logic in the generic media manager to enable
targets manage blocks into open and close separately, and it implements
such management in rrpc. It also adds a set of flags to describe the
state of the block (open, closed, free, bad).

In order to avoid taking two locks (nvm_lun and rrpc_lun) consecutively,
we introduce lockless get_/put_block primitives so that the open and
close list locks and future common logic is handled within the nvm_lun
lock.

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>
drivers/lightnvm/core.c
drivers/lightnvm/gennvm.c
drivers/lightnvm/rrpc.c
drivers/lightnvm/rrpc.h
include/linux/lightnvm.h