summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/alloc.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-12-02 20:03:06 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2016-12-02 20:03:06 -0900
commit50706f36b51a721791124f4d7348252d4d6d3458 (patch)
treedaec72695a0e6c2387d3d88dc04a11940852367c /drivers/md/bcache/alloc.c
parent548f0f7b68212e51ab9f137313dfa58eb0bdbc64 (diff)
bcache: allow __bch_write() to fragment io more than twice without slowpath loop
Diffstat (limited to 'drivers/md/bcache/alloc.c')
-rw-r--r--drivers/md/bcache/alloc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
index ebd7e909114c..7bc41a3a21b1 100644
--- a/drivers/md/bcache/alloc.c
+++ b/drivers/md/bcache/alloc.c
@@ -1810,7 +1810,11 @@ void bch_open_buckets_init(struct cache_set *c)
bch_prio_timer_init(c, READ);
bch_prio_timer_init(c, WRITE);
- for (i = 0; i < ARRAY_SIZE(c->open_buckets); i++) {
+ /* open bucket 0 is a sentinal NULL: */
+ mutex_init(&c->open_buckets[0].lock);
+ INIT_LIST_HEAD(&c->open_buckets[0].list);
+
+ for (i = 1; i < ARRAY_SIZE(c->open_buckets); i++) {
mutex_init(&c->open_buckets[i].lock);
c->open_buckets_nr_free++;
list_add(&c->open_buckets[i].list, &c->open_buckets_free);