Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed2a92a6 authored by Matias Bjørling's avatar Matias Bjørling Committed by Jens Axboe
Browse files

lightnvm: remove struct nvm_dev->total_blocks



The struct nvm_dev->total_blocks was only used for calculating total
sectors. Remove and instead calculate total sectors from the number of
luns and its sectors.

Signed-off-by: default avatarMatias Bjørling <m@bjorling.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 4ece44af
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -463,11 +463,7 @@ static int nvm_core_init(struct nvm_dev *dev)
	dev->sec_per_lun = dev->sec_per_blk * dev->blks_per_lun;
	dev->nr_luns = dev->luns_per_chnl * dev->nr_chnls;

	dev->total_blocks = dev->nr_planes *
				dev->blks_per_lun *
				dev->luns_per_chnl *
				dev->nr_chnls;
	dev->total_secs = dev->total_blocks * dev->sec_per_blk;
	dev->total_secs = dev->nr_luns * dev->sec_per_lun;
	INIT_LIST_HEAD(&dev->online_targets);
	mutex_init(&dev->mlock);