lightnvm: remove gen_lun abstraction

The gen_lun abstraction in the generic media manager was conceived on
the assumption that a single target would instantiated on top of it.
This has complicated target design to implement multi-instances. Remove
this abstraction and move its logic to nvm_lun, which manages physical
lun geometry and operations.

Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Javier González 2016-11-28 22:39:04 +01:00 committed by Jens Axboe
parent 98379a12c5
commit de93434fcf
3 changed files with 53 additions and 58 deletions

View file

@ -275,7 +275,17 @@ struct nvm_lun {
spinlock_t lock;
/* lun block lists */
struct list_head used_list; /* In-use blocks */
struct list_head free_list; /* Not used blocks i.e. released
* and ready for use
*/
struct list_head bb_list; /* Bad blocks. Mutually exclusive with
* free_list and used_list
*/
unsigned int nr_free_blocks; /* Number of unused blocks */
int reserved_blocks;
struct nvm_block *blocks;
};