summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-05-16 19:10:29 +0200
committerDavid Sterba <dsterba@suse.com>2017-06-19 18:26:00 +0200
commit4e2814ef04080fae123edf8fcef555f5a424e7ba (patch)
tree47235cbf6990f4f85094c673bd8432ef43524e16 /fs/btrfs
parentbtrfs: scrub: inline helper scrub_free_wr_ctx (diff)
downloadlinux-4e2814ef04080fae123edf8fcef555f5a424e7ba.tar.xz
linux-4e2814ef04080fae123edf8fcef555f5a424e7ba.zip
btrfs: scrub: simplify cleanup of wr_ctx in scrub_free_ctx
We don't need to take the mutex and zero out wr_cur_bio, as this is called after the scrub finished. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/scrub.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index c2d4f25417f2..ffe785ec5298 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -639,11 +639,6 @@ static noinline_for_stack void scrub_free_ctx(struct scrub_ctx *sctx)
if (!sctx)
return;
- mutex_lock(&sctx->wr_ctx.wr_lock);
- kfree(sctx->wr_ctx.wr_curr_bio);
- sctx->wr_ctx.wr_curr_bio = NULL;
- mutex_unlock(&sctx->wr_ctx.wr_lock);
-
/* this can happen when scrub is cancelled */
if (sctx->curr != -1) {
struct scrub_bio *sbio = sctx->bios[sctx->curr];
@@ -663,6 +658,7 @@ static noinline_for_stack void scrub_free_ctx(struct scrub_ctx *sctx)
kfree(sbio);
}
+ kfree(sctx->wr_ctx.wr_curr_bio);
scrub_free_csums(sctx);
kfree(sctx);
}