lightnvm: specify target's logical address area

We can create more than one target on a lightnvm
device by specifying its begin lun and end lun.

But only specify the physical address area is not
enough, we need to get the corresponding non-
intersection logical address area division from
the backend device's logcial address space.
Otherwise the targets on the device might use
the same logical addresses cause incorrect
information in the device's l2p table.

Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Wenwei Tao
2016-03-03 15:06:37 +01:00
committed by Jens Axboe
parent 3681c85dff
commit 4c9dacb82d
6 changed files with 116 additions and 2 deletions

View File

@@ -466,6 +466,7 @@ static int nvm_core_init(struct nvm_dev *dev)
dev->total_secs = dev->nr_luns * dev->sec_per_lun;
INIT_LIST_HEAD(&dev->online_targets);
mutex_init(&dev->mlock);
spin_lock_init(&dev->lock);
return 0;
}