From patchwork Fri May 6 18:03:21 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: 9035161 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 67E42BF29F for ; Fri, 6 May 2016 18:05:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EFE620272 for ; Fri, 6 May 2016 18:05:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E06820274 for ; Fri, 6 May 2016 18:05:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932478AbcEFSEH (ORCPT ); Fri, 6 May 2016 14:04:07 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38511 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932426AbcEFSEB (ORCPT ); Fri, 6 May 2016 14:04:01 -0400 Received: by mail-wm0-f52.google.com with SMTP id g17so89904193wme.1 for ; Fri, 06 May 2016 11:04:01 -0700 (PDT) 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-transfer-encoding; bh=PENbGZiXDV7IRHFl7Q5DXqsGSkBks9mEoSDkOUsg7GI=; b=I8/YJmulKTAeHYl50pxcrXOKsiXlhJa56GuE8DYf2Hncq+oZz28d5pkAR+EimqZiSV 2KrT4EWyar3boPmd23PI6JpO9yfyQbBk1khPa6zfGo12dPjmIVuollQTNi1zo33wuq83 gNrJU5tZTDiunGn+dL09xq7rDmAficuvSgYSM= 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-transfer-encoding; bh=PENbGZiXDV7IRHFl7Q5DXqsGSkBks9mEoSDkOUsg7GI=; b=ehtfEGM8NnzT7XAPjGL8FFRguCcfQoctOJNKjh7qVDKOdaAAbVkdywEUtfoKcmFSnD b76XKuLf9ZKEtHnmjCLCtQSwvz/qiKRg7UR2xzmDm37LHe3I04BlDFrL6HPKu3vyY1oR fHJufqVDqx24KTQY7DJZfspvfL0riErXyzP008CErX6pBBk8jed1ZdPaF/wiE23avaen mDU41FuKuPiCWXuB5CkEFS/90mZzenRB1okfgXyRALrtUCTG1MIib1L1zdbww6BzOii1 bN9yvvCfUxRYRwRItgYzk7YmWutebEMlP2J5wTROYreNephT0v7OYgjvRVN4U3/O6R8f RMyg== X-Gm-Message-State: AOPr4FX9hhAHfOXhHHyVkBmAGiYOQJqHTUcDfwcxeciGhpOyMheo6F8wQrYyiY6U+PRzMA== X-Received: by 10.28.8.193 with SMTP id 184mr11174377wmi.56.1462557840603; Fri, 06 May 2016 11:04:00 -0700 (PDT) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id kz1sm16076559wjc.46.2016.05.06.11.03.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 May 2016 11:04:00 -0700 (PDT) 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?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 28/28] lightnvm: reserved space calculation incorrect Date: Fri, 6 May 2016 20:03:21 +0200 Message-Id: <1462557801-24974-29-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462557801-24974-1-git-send-email-m@bjorling.me> References: <1462557801-24974-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=-8.9 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 From: Javier González The nvm_dev->max_pages_per_blk variable was removed in favor of the new nvm->sec_per_blk variable. The ->max_pages_per_blk variable was still used in rrpc_capacity, reporting the reserved capacity to zero. Replace with ->sec_per_blk to calculate the reserved area again. Signed-off-by: Javier González Updated patch description. Was "lightnvm: eliminate redundant variable" Signed-off-by: Matias Bjørling --- drivers/lightnvm/rrpc.c | 2 +- include/linux/lightnvm.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index 72aca96..2103e97 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -1264,7 +1264,7 @@ static sector_t rrpc_capacity(void *private) sector_t reserved, provisioned; /* cur, gc, and two emergency blocks for each lun */ - reserved = rrpc->nr_luns * dev->max_pages_per_blk * 4; + reserved = rrpc->nr_luns * dev->sec_per_blk * 4; provisioned = rrpc->nr_sects - reserved; if (reserved > rrpc->nr_sects) { diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index b2991c7..ef2c7d2 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -351,7 +351,6 @@ struct nvm_dev { unsigned long total_blocks; unsigned long total_secs; int nr_luns; - unsigned max_pages_per_blk; unsigned long *lun_map; void *dma_pool;