lightnvm: pblk: encapsulate rb pointer operations
authorJavier González <javier@javigon.com>
Tue, 9 Oct 2018 11:12:09 +0000 (13:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Oct 2018 14:25:08 +0000 (08:25 -0600)
commit40b8657dcc0bbd4a293cac1acd4b0b01c0359416
tree132bc7832c197a44c16c38a59441803027fad974
parentdde4aac20babee040875f76842a31b14b76dd369
lightnvm: pblk: encapsulate rb pointer operations

pblk's read/write buffer is always a power-of-2, thus wrapping up the
buffer can be done with a bit mask. Since this is an implementation
detail internal to the write buffer, make a helper that hides pointer
increment + wrap, and allows to transparently relax this assumption in
the future.

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