Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396018 > unrolled thread

[PATCH 28/28] lightnvm: reserved space calculation incorrect

Started byMatias Bjørling <m@bjorling.me>
First post2016-05-06 20:10 +0200
Last post2016-05-06 20:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 28/28] lightnvm: reserved space calculation incorrect Matias Bjørling <m@bjorling.me> - 2016-05-06 20:10 +0200

#1396018 — [PATCH 28/28] lightnvm: reserved space calculation incorrect

FromMatias Bjørling <m@bjorling.me>
Date2016-05-06 20:10 +0200
Subject[PATCH 28/28] lightnvm: reserved space calculation incorrect
Message-ID<rvSmm-1A4-15@gated-at.bofh.it>
From: Javier González <jg@lightnvm.io>

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 <javier@cnexlabs.com>
Updated patch description. Was "lightnvm: eliminate redundant variable"
Signed-off-by: Matias Bjørling <m@bjorling.me>
---
 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;
-- 
2.1.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web