OSDN Git Service

lightnvm: pblk: move ring buffer alloc/free rb init
authorJavier González <javier@javigon.com>
Tue, 9 Oct 2018 11:12:10 +0000 (13:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Oct 2018 14:25:08 +0000 (08:25 -0600)
commit9bd1f875c047a8a619a3e5233c1eb23eace02f31
tree8037785267158bf0eaa7d1fc7cd1596862ca69f4
parent40b8657dcc0bbd4a293cac1acd4b0b01c0359416
lightnvm: pblk: move ring buffer alloc/free rb init

pblk's read/write buffer currently takes a buffer and its size and uses
it to create the metadata around it to use it as a ring buffer. This
puts the responsibility of allocating/freeing ring buffer memory on the
ring buffer user. Instead, move it inside of the ring buffer helpers
(pblk-rb.c). This simplifies creation/destruction routines.

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/pblk-init.c
drivers/lightnvm/pblk-rb.c
drivers/lightnvm/pblk.h