lightnvm: make rrpc_map_page call nvm_get_blk outside locks
authorMatias Bjørling <m@bjorling.me>
Thu, 7 Jul 2016 07:54:20 +0000 (09:54 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 7 Jul 2016 14:51:52 +0000 (08:51 -0600)
commit855cdd2c0bff7dcf9337734dc5749d127ca05086
tree6c08bd87536747d8016248272f607316689b147c
parent41285fad511a2c3746bee7ccb3b2f21b70305c14
lightnvm: make rrpc_map_page call nvm_get_blk outside locks

The nvm_get_blk() function is called with rlun->lock held. This is ok
when the media manager implementation doesn't go out of its atomic
context. However, if a media manager persists its metadata, and
guarantees that the block is given to the target, this is no longer
a viable approach. Therefore, clean up the flow of rrpc_map_page,
and make sure that nvm_get_blk() is called without any locks acquired.

Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/rrpc.c
drivers/lightnvm/rrpc.h