summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-04-16 20:08:15 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2020-05-06 17:14:16 -0400
commit4be01e936857c77ba0682302bc00f73b039ec926 (patch)
treef6f87b6168abca1e45c5fc8e018f14451c7afdc8
parent9b2540475287237fc542e0b36c7a02d960aec795 (diff)
bcache: optimize continue_at_nobarrier()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--drivers/md/bcache/closure.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h
index eca0d496b686..05aad079bb8a 100644
--- a/drivers/md/bcache/closure.h
+++ b/drivers/md/bcache/closure.h
@@ -245,7 +245,7 @@ static inline void closure_queue(struct closure *cl)
!= offsetof(struct work_struct, func));
if (wq) {
INIT_WORK(&cl->work, cl->work.func);
- BUG_ON(!queue_work(wq, &cl->work));
+ queue_work(wq, &cl->work);
} else
cl->fn(cl);
}
@@ -340,8 +340,13 @@ do { \
*/
#define continue_at_nobarrier(_cl, _fn, _wq) \
do { \
- set_closure_fn(_cl, _fn, _wq); \
- closure_queue(_cl); \
+ closure_set_ip(_cl); \
+ if (_wq) { \
+ INIT_WORK(&(_cl)->work, (void *) _fn); \
+ queue_work((_wq), &(_cl)->work); \
+ } else { \
+ (_fn)(_cl); \
+ } \
} while (0)
/**