diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2015-07-06 15:09:11 -0700 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-01-18 20:19:02 -0900 |
commit | fb9c24582a12df3c286b9db6f58c9cf08a721739 (patch) | |
tree | 10dac8044ac2751fec361435a877129a25726b89 | |
parent | 327a526a92f704c2c7d1a487040f437731a20fe9 (diff) |
bcache: trivial closures cleanups
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | drivers/md/bcache/closure.c | 5 | ||||
-rw-r--r-- | drivers/md/bcache/closure.h | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c index 958dfa4af001..23d60a60fa90 100644 --- a/drivers/md/bcache/closure.c +++ b/drivers/md/bcache/closure.c @@ -69,8 +69,8 @@ void __closure_wake_up(struct closure_waitlist *wait_list) while (list) { struct llist_node *t = list; - list = llist_next(list); + list = llist_next(list); t->next = reverse; reverse = t; } @@ -159,6 +159,7 @@ static struct dentry *debug; static int debug_seq_show(struct seq_file *f, void *data) { struct closure *cl; + spin_lock_irq(&closure_list_lock); list_for_each_entry(cl, &closure_list, all) { @@ -177,7 +178,7 @@ static int debug_seq_show(struct seq_file *f, void *data) seq_printf(f, " W %pF\n", (void *) cl->waiting_on); - seq_printf(f, "\n"); + seq_puts(f, "\n"); } spin_unlock_irq(&closure_list_lock); diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h index 0cb9523577b0..5a603fc8fec7 100644 --- a/drivers/md/bcache/closure.h +++ b/drivers/md/bcache/closure.h @@ -234,6 +234,7 @@ static inline void set_closure_fn(struct closure *cl, closure_fn *fn, static inline void closure_queue(struct closure *cl) { struct workqueue_struct *wq = cl->wq; + if (wq) { INIT_WORK(&cl->work, cl->work.func); BUG_ON(!queue_work(wq, &cl->work)); |