1
0
Fork 0

bcache: fix inaccurate result of unused buckets

To get the amount of unused buckets in sysfs_priority_stats, the code
count the buckets which GC_SECTORS_USED is zero. It's correct and should
not be overwritten by the count of buckets which prio is zero.

Signed-off-by: Guoju Fang <fangguoju@gmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
hifive-unleashed-5.2
Guoju Fang 2019-04-25 00:48:27 +08:00 committed by Jens Axboe
parent 1568ee7e3c
commit 4e0c04ec3a
1 changed files with 0 additions and 2 deletions

View File

@ -996,8 +996,6 @@ SHOW(__bch_cache)
!cached[n - 1])
--n;
unused = ca->sb.nbuckets - n;
while (cached < p + n &&
*cached == BTREE_PRIO)
cached++, n--;