summaryrefslogtreecommitdiff
path: root/include/linux/lightnvm.h
diff options
context:
space:
mode:
authorJavier Gonzalez <javier@javigon.com>2015-11-20 13:47:56 +0100
committerJens Axboe <axboe@fb.com>2015-11-20 08:33:20 -0700
commit0b59733b95f9d7af6bee6e6a4d0d444eb694c514 (patch)
tree8cc6efa06ebc51e8fc15021c46821be456913f23 /include/linux/lightnvm.h
parent47b3115ae7b799be8b77b0f024215ad4f68d6460 (diff)
downloadlwn-0b59733b95f9d7af6bee6e6a4d0d444eb694c514.tar.gz
lwn-0b59733b95f9d7af6bee6e6a4d0d444eb694c514.zip
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>
Diffstat (limited to 'include/linux/lightnvm.h')
-rw-r--r--include/linux/lightnvm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index cbe288acb1de..831a20cf070c 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -213,7 +213,9 @@ struct nvm_lun {
int lun_id;
int chnl_id;
+ unsigned int nr_inuse_blocks; /* Number of used blocks */
unsigned int nr_free_blocks; /* Number of unused blocks */
+ unsigned int nr_bad_blocks; /* Number of bad blocks */
struct nvm_block *blocks;
spinlock_t lock;