lightnvm: remove open/close statistics for gennvm

The responsibility of the media manager is not to keep track of
open/closed blocks. This is better maintained within a target,
that already manages this information on writes.

Remove the statistics and merge the states NVM_BLK_ST_OPEN and
NVM_BLK_ST_CLOSED.

Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Matias Bjørling
2016-07-07 09:54:14 +02:00
committed by Jens Axboe
parent 12624af26e
commit 077d238999
3 changed files with 8 additions and 41 deletions

View File

@@ -269,24 +269,15 @@ struct nvm_lun {
int lun_id;
int chnl_id;
/* It is up to the target to mark blocks as closed. If the target does
* not do it, all blocks are marked as open, and nr_open_blocks
* represents the number of blocks in use
*/
unsigned int nr_open_blocks; /* Number of used, writable blocks */
unsigned int nr_closed_blocks; /* Number of used, read-only blocks */
unsigned int nr_free_blocks; /* Number of unused blocks */
unsigned int nr_bad_blocks; /* Number of bad blocks */
spinlock_t lock;
unsigned int nr_free_blocks; /* Number of unused blocks */
struct nvm_block *blocks;
};
enum {
NVM_BLK_ST_FREE = 0x1, /* Free block */
NVM_BLK_ST_OPEN = 0x2, /* Open block - read-write */
NVM_BLK_ST_CLOSED = 0x4, /* Closed block - read-only */
NVM_BLK_ST_TGT = 0x2, /* Block in use by target */
NVM_BLK_ST_BAD = 0x8, /* Bad block */
};