summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/btree.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-12-10 13:24:26 -0800
committerKent Overstreet <kmo@daterainc.com>2014-01-08 13:05:07 -0800
commitb0f32a56f27eb0df4124dbfc8eb6f09f423eed99 (patch)
tree5c4faa7b7720196777d63a2fdfa63ff6b716c651 /drivers/md/bcache/btree.c
parent5775e2133dfa0dc1f4c7f233e2144d32cb516f54 (diff)
downloadlinux-stable-b0f32a56f27eb0df4124dbfc8eb6f09f423eed99.tar.gz
linux-stable-b0f32a56f27eb0df4124dbfc8eb6f09f423eed99.tar.bz2
linux-stable-b0f32a56f27eb0df4124dbfc8eb6f09f423eed99.zip
bcache: Minor btree cache fix
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/btree.c')
-rw-r--r--drivers/md/bcache/btree.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 946ecd3b048b..aaa87b3be9ef 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -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++) {
+ if (list_empty(&c->btree_cache))
+ goto out;
+
b = list_first_entry(&c->btree_cache, struct btree, list);
list_rotate_left(&c->btree_cache);