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>
This commit is contained in:
committed by
Jens Axboe
parent
dde4aac20b
commit
40b8657dcc
@ -760,6 +760,8 @@ unsigned int pblk_rb_read_commit(struct pblk_rb *rb, unsigned int entries);
|
||||
|
||||
unsigned int pblk_rb_sync_init(struct pblk_rb *rb, unsigned long *flags);
|
||||
unsigned int pblk_rb_sync_advance(struct pblk_rb *rb, unsigned int nr_entries);
|
||||
unsigned int pblk_rb_ptr_wrap(struct pblk_rb *rb, unsigned int p,
|
||||
unsigned int nr_entries);
|
||||
void pblk_rb_sync_end(struct pblk_rb *rb, unsigned long *flags);
|
||||
unsigned int pblk_rb_flush_point_count(struct pblk_rb *rb);
|
||||
|
||||
|
Reference in New Issue
Block a user