lightnvm: remove struct nvm_dev->total_blocks
authorMatias Bjørling <m@bjorling.me>
Sat, 20 Feb 2016 07:52:42 +0000 (08:52 +0100)
committerJens Axboe <axboe@fb.com>
Thu, 3 Mar 2016 21:46:35 +0000 (14:46 -0700)
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: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/core.c

index 1cb4b331c3e816b4c59614a4672b195f41b32b21..773a55da0e20a4fa9c80475f6cb49db7f4fbdf56 100644 (file)
@@ -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);