lightnvm: keep track of block counts
authorJavier Gonzalez <javier@javigon.com>
Fri, 20 Nov 2015 12:47:56 +0000 (13:47 +0100)
committerJens Axboe <axboe@fb.com>
Fri, 20 Nov 2015 15:33:20 +0000 (08:33 -0700)
commit0b59733b95f9d7af6bee6e6a4d0d444eb694c514
tree8cc6efa06ebc51e8fc15021c46821be456913f23
parent47b3115ae7b799be8b77b0f024215ad4f68d6460
lightnvm: keep track of block counts

Maintain number of in use blocks, free blocks, and bad blocks in a per
lun basis. This allows the upper layers to get information about the
state of each lun.

Also, account for blocks reserved to the device on the free block count.
nr_free_blocks matches now the actual number of blocks on the free list
when the device is booted.

Signed-off-by: Javier Gonzalez <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/gennvm.c
include/linux/lightnvm.h