summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/closure.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-14 12:22:09 +0200
committerMark Brown <broonie@linaro.org>2013-08-14 12:22:09 +0200
commit3c729b4344456ebd520636563c854090e3dec611 (patch)
tree6caae9f4d4c9f9ae2e033d64486649c6f603a209 /drivers/md/bcache/closure.c
parentspi: s3c64xx: Use dmaengine_prep_slave_single() to prepare DMA transfers (diff)
parentLinux 3.11-rc5 (diff)
downloadlinux-3c729b4344456ebd520636563c854090e3dec611.tar.xz
linux-3c729b4344456ebd520636563c854090e3dec611.zip
Merge tag 'v3.11-rc5' into spi-s3c64xx
Linux 3.11-rc5
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);