summaryrefslogtreecommitdiff
path: root/drivers/lightnvm
diff options
context:
space:
mode:
authorMatias Bjørling <m@bjorling.me>2016-02-20 10:52:42 +0300
committerJens Axboe <axboe@fb.com>2016-03-04 00:46:35 +0300
commited2a92a6b4b8453a0c3a20da641ec79e4b3d7ca4 (patch)
treeaafd1639c001a5cbd83041c4b19b1bc17a0b4bb9 /drivers/lightnvm
parent4ece44af733ff63a7cd12aaa8c85afb6d9fdc664 (diff)
downloadlinux-ed2a92a6b4b8453a0c3a20da641ec79e4b3d7ca4.tar.xz
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: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r--drivers/lightnvm/core.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 1cb4b331c3e8..773a55da0e20 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -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);