lightnvm: move target mgmt into media mgr

To enable persistent block management to easily control creation and
removal of targets, we move target management into the media
manager. The LightNVM core continues to maintain which target types are
registered, while the media manager now keeps track of its initialized
targets.

Two new callbacks for the media manager are introduced. create_tgt and
remove_tgt. Note that remove_tgt returns 0 on successfully removing a
target, and returns 1 if the target was not found.

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:16 +02:00
committed by Jens Axboe
parent 5e60edb7dc
commit b76eb20bb0
4 changed files with 207 additions and 160 deletions

View File

@@ -40,6 +40,9 @@ struct gen_dev {
int nr_luns;
struct gen_lun *luns;
struct list_head area_list;
struct mutex lock;
struct list_head targets;
};
struct gen_area {