bcache: Minor btree cache fix
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
This commit is contained in:
parent
5775e2133d
commit
b0f32a56f2
1 changed files with 3 additions and 7 deletions
|
@ -714,14 +714,10 @@ static unsigned long bch_mca_scan(struct shrinker *shrink,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Can happen right when we first start up, before we've read in any
|
|
||||||
* btree nodes
|
|
||||||
*/
|
|
||||||
if (list_empty(&c->btree_cache))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
for (i = 0; (nr--) && i < c->bucket_cache_used; i++) {
|
for (i = 0; (nr--) && i < c->bucket_cache_used; i++) {
|
||||||
|
if (list_empty(&c->btree_cache))
|
||||||
|
goto out;
|
||||||
|
|
||||||
b = list_first_entry(&c->btree_cache, struct btree, list);
|
b = list_first_entry(&c->btree_cache, struct btree, list);
|
||||||
list_rotate_left(&c->btree_cache);
|
list_rotate_left(&c->btree_cache);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue