summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/closure.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-22 11:09:03 +0100
committerMark Brown <broonie@linaro.org>2013-08-22 11:09:03 +0100
commit64393c6e647c8a791243063d282c787b46721be7 (patch)
tree89ca12bd5d52e8df24d2bc13a36d30479a4e825d /drivers/md/bcache/closure.c
parenta2388a498ad2f85be01aca29e364abf427d9b53c (diff)
parent741a509f34d8d702f70d0ad99b8152c57d76961e (diff)
Merge remote-tracking branch 'asoc/topic/ac97' into asoc-fsl
Diffstat (limited to 'drivers/md/bcache/closure.c')
-rw-r--r--drivers/md/bcache/closure.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c
index bd05a9a8c7cf..9aba2017f0d1 100644
--- a/drivers/md/bcache/closure.c
+++ b/drivers/md/bcache/closure.c
@@ -66,16 +66,18 @@ static inline void closure_put_after_sub(struct closure *cl, int flags)
} else {
struct closure *parent = cl->parent;
struct closure_waitlist *wait = closure_waitlist(cl);
+ closure_fn *destructor = cl->fn;
closure_debug_destroy(cl);
+ smp_mb();
atomic_set(&cl->remaining, -1);
if (wait)
closure_wake_up(wait);
- if (cl->fn)
- cl->fn(cl);
+ if (destructor)
+ destructor(cl);
if (parent)
closure_put(parent);