diff options
author | Javier González <jg@lightnvm.io> | 2016-05-06 14:03:21 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-05-06 14:51:10 -0400 |
commit | 116f7d4a21fe450efc652c4850eb27cda36c9db0 (patch) | |
tree | fb8ef533ff5d272f5b1ef496f357cc538a5c8204 /drivers/lightnvm | |
parent | 6d5be9590b5e15124e3c8b319c8d7ce01abcf07d (diff) |
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 <javier@cnexlabs.com>
Updated patch description. Was "lightnvm: eliminate redundant variable"
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r-- | drivers/lightnvm/rrpc.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
1264 | sector_t reserved, provisioned; | 1264 | sector_t reserved, provisioned; |
1265 | 1265 | ||
1266 | /* cur, gc, and two emergency blocks for each lun */ | 1266 | /* cur, gc, and two emergency blocks for each lun */ |
1267 | reserved = rrpc->nr_luns * dev->max_pages_per_blk * 4; | 1267 | reserved = rrpc->nr_luns * dev->sec_per_blk * 4; |
1268 | provisioned = rrpc->nr_sects - reserved; | 1268 | provisioned = rrpc->nr_sects - reserved; |
1269 | 1269 | ||
1270 | if (reserved > rrpc->nr_sects) { | 1270 | if (reserved > rrpc->nr_sects) { |