From: Javier González Date: Fri, 6 May 2016 18:03:21 +0000 (+0200) Subject: lightnvm: reserved space calculation incorrect X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=116f7d4a21fe450efc652c4850eb27cda36c9db0;p=linux-beck.git lightnvm: reserved space calculation incorrect 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 Signed-off-by: Jens Axboe --- diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index 72aca96f467b..2103e97a974f 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 b2991c724640..ef2c7d2e76c4 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;