mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Matias Bjørling" <m@bjorling.me>
To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com
Cc: "Matias Bjørling" <m@bjorling.me>
Subject: [PATCH 3/4] lightnvm: remove struct nvm_dev->total_blocks
Date: Sat, 20 Feb 2016 08:52:42 +0100	[thread overview]
Message-ID: <1455954763-7880-4-git-send-email-m@bjorling.me> (raw)
In-Reply-To: <1455954763-7880-1-git-send-email-m@bjorling.me>

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>
---
 drivers/lightnvm/core.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 2f1e16c..0d1fb6b 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);
 
-- 
2.5.0

  parent reply	other threads:[~2016-02-20  7:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-20  7:52 [PATCH 0/4] LightNVM patches for 4.5-rc Matias Bjørling
2016-02-20  7:52 ` [PATCH 1/4] lightnvm: update closed list outside of intr context Matias Bjørling
2016-02-20  7:52 ` [PATCH 2/4] lightnvm: rename ->nr_pages to ->nr_sects Matias Bjørling
2016-02-20  7:52 ` Matias Bjørling [this message]
2016-02-20  7:52 ` [PATCH 4/4] lightnvm: generalize rrpc ppa calculations Matias Bjørling
2016-02-26 18:21 ` [PATCH 0/4] LightNVM patches for 4.5-rc Matias Bjorling
2016-02-26 18:30   ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455954763-7880-4-git-send-email-m@bjorling.me \
    --to=m@bjorling.me \
    --cc=axboe@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®