提交 116f7d4a 编写于 作者: J Javier González 提交者: Jens Axboe

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: NJavier González <javier@cnexlabs.com>
Updated patch description. Was "lightnvm: eliminate redundant variable"
Signed-off-by: NMatias Bjørling <m@bjorling.me>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 6d5be959
...@@ -1264,7 +1264,7 @@ static sector_t rrpc_capacity(void *private) ...@@ -1264,7 +1264,7 @@ static sector_t rrpc_capacity(void *private)
sector_t reserved, provisioned; sector_t reserved, provisioned;
/* cur, gc, and two emergency blocks for each lun */ /* 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; provisioned = rrpc->nr_sects - reserved;
if (reserved > rrpc->nr_sects) { if (reserved > rrpc->nr_sects) {
......
...@@ -351,7 +351,6 @@ struct nvm_dev { ...@@ -351,7 +351,6 @@ struct nvm_dev {
unsigned long total_blocks; unsigned long total_blocks;
unsigned long total_secs; unsigned long total_secs;
int nr_luns; int nr_luns;
unsigned max_pages_per_blk;
unsigned long *lun_map; unsigned long *lun_map;
void *dma_pool; void *dma_pool;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册