aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/btree.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bcache/btree.c')
-rw-r--r--drivers/md/bcache/btree.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 01b1b7e23cf2..beb32551da78 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -93,8 +93,6 @@
93#define PTR_HASH(c, k) \ 93#define PTR_HASH(c, k) \
94 (((k)->ptr[0] >> c->bucket_bits) | PTR_GEN(k, 0)) 94 (((k)->ptr[0] >> c->bucket_bits) | PTR_GEN(k, 0))
95 95
96static struct workqueue_struct *btree_io_wq;
97
98#define insert_lock(s, b) ((b)->level <= (s)->lock) 96#define insert_lock(s, b) ((b)->level <= (s)->lock)
99 97
100/* 98/*
@@ -362,8 +360,7 @@ static void __btree_node_write_done(struct closure *cl)
362 btree_complete_write(b, w); 360 btree_complete_write(b, w);
363 361
364 if (btree_node_dirty(b)) 362 if (btree_node_dirty(b))
365 queue_delayed_work(btree_io_wq, &b->work, 363 schedule_delayed_work(&b->work, 30 * HZ);
366 msecs_to_jiffies(30000));
367 364
368 closure_return_with_destructor(cl, btree_node_write_unlock); 365 closure_return_with_destructor(cl, btree_node_write_unlock);
369} 366}
@@ -535,7 +532,7 @@ static void bch_btree_leaf_dirty(struct btree *b, atomic_t *journal_ref)
535 BUG_ON(!i->keys); 532 BUG_ON(!i->keys);
536 533
537 if (!btree_node_dirty(b)) 534 if (!btree_node_dirty(b))
538 queue_delayed_work(btree_io_wq, &b->work, 30 * HZ); 535 schedule_delayed_work(&b->work, 30 * HZ);
539 536
540 set_btree_node_dirty(b); 537 set_btree_node_dirty(b);
541 538
@@ -2446,18 +2443,3 @@ void bch_keybuf_init(struct keybuf *buf)
2446 spin_lock_init(&buf->lock); 2443 spin_lock_init(&buf->lock);
2447 array_allocator_init(&buf->freelist); 2444 array_allocator_init(&buf->freelist);
2448} 2445}
2449
2450void bch_btree_exit(void)
2451{
2452 if (btree_io_wq)
2453 destroy_workqueue(btree_io_wq);
2454}
2455
2456int __init bch_btree_init(void)
2457{
2458 btree_io_wq = create_singlethread_workqueue("bch_btree_io");
2459 if (!btree_io_wq)
2460 return -ENOMEM;
2461
2462 return 0;
2463}