From patchwork Sat Feb 20 07:52:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 8365901 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C1C5A9F38B for ; Sat, 20 Feb 2016 07:54:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDE8520513 for ; Sat, 20 Feb 2016 07:54:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F4E920511 for ; Sat, 20 Feb 2016 07:54:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424927AbcBTHxJ (ORCPT ); Sat, 20 Feb 2016 02:53:09 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:33875 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758129AbcBTHw4 (ORCPT ); Sat, 20 Feb 2016 02:52:56 -0500 Received: by mail-wm0-f50.google.com with SMTP id b205so95051146wmb.1 for ; Fri, 19 Feb 2016 23:52:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=EJ34DqEwxkHm+XQpSZlgUx8NkDu+RuVfMgA7yv0wkG4=; b=VmHmJeW/2bc6v7K1/LNQT03/TZxF4Oda3Wi5cVy8N/HgvfwtAZdBTvB5c1cEdDbiB+ dJL5CAusOcJG9m2przEy+G/a0xLIFt3VcXW+EcvQl+dOSuujGkOX/u2YKXdcVEFwRCn/ 2cDM5Ve1i5AQySTDKYE5KUScItSDqOkm4O2Yc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=EJ34DqEwxkHm+XQpSZlgUx8NkDu+RuVfMgA7yv0wkG4=; b=Ic2N9oxBMsu5WLadcQnIKQElq4UrcKzTjREgwxtVAyzdrmkApzV9F66vFITWFODWYb 1dGH8HstknDmBBZYZtQ1bybUzSLO9xVyji+Yh6SG306VJNxi2xQjuCXBh4+CRi3CraO8 JyvTOYLb6YYfuFoqaJMAou/k/QrCjSIkPzb5fIbx4MfNmWbdmSHtwr9lLbFztLHa3bcK XNaehFvymSvnV6aHKZyYR4CJCZrtBWJrNoHE1ty8ri9QlGZ3PdebGwnrsouF6DIdfkeQ 8uvJIDwbmJqGIUyXyCuaHq24cpm2NMErZvfxJ1H3Ia9G/+G3uIOKi6xmd8igA3XI+SRi O1YQ== X-Gm-Message-State: AG10YOSV+Lhr7bjN8qsbE6bfda0EKSbrXDY/8ER3ROLiqrlePNerx3W5iDOwp7R/cyOVOg== X-Received: by 10.28.9.71 with SMTP id 68mr1318832wmj.33.1455954775150; Fri, 19 Feb 2016 23:52:55 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id h132sm10904633wmf.9.2016.02.19.23.52.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Feb 2016 23:52:54 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 3/4] lightnvm: remove struct nvm_dev->total_blocks Date: Sat, 20 Feb 2016 08:52:42 +0100 Message-Id: <1455954763-7880-4-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455954763-7880-1-git-send-email-m@bjorling.me> References: <1455954763-7880-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);