diff options
author | David Sterba <dsterba@suse.com> | 2017-05-16 19:10:26 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-06-19 18:26:00 +0200 |
commit | e241ddeb9c6c9df05911fb156baa4fb442b74983 (patch) | |
tree | 0d325463ab6c1bba82b7b27f734eb22a352499cd /fs/btrfs/scrub.c | |
parent | 8fcdac3f208009a2103c11569b25ae2083016a9c (diff) | |
download | linux-stable-e241ddeb9c6c9df05911fb156baa4fb442b74983.tar.gz linux-stable-e241ddeb9c6c9df05911fb156baa4fb442b74983.tar.bz2 linux-stable-e241ddeb9c6c9df05911fb156baa4fb442b74983.zip |
btrfs: scrub: inline helper scrub_free_wr_ctx
The helper scrub_free_wr_ctx is used only once and fits into
scrub_free_ctx as it continues sctx shutdown, no need to keep it
separate.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 2ab36973ad7e..c2d4f25417f2 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -289,7 +289,6 @@ static void scrub_remap_extent(struct btrfs_fs_info *fs_info, u64 *extent_physical, struct btrfs_device **extent_dev, int *extent_mirror_num); -static void scrub_free_wr_ctx(struct scrub_wr_ctx *wr_ctx); static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx, struct scrub_page *spage); static void scrub_wr_submit(struct scrub_ctx *sctx); @@ -640,7 +639,10 @@ static noinline_for_stack void scrub_free_ctx(struct scrub_ctx *sctx) if (!sctx) return; - scrub_free_wr_ctx(&sctx->wr_ctx); + 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) { @@ -4337,14 +4339,6 @@ static void scrub_remap_extent(struct btrfs_fs_info *fs_info, btrfs_put_bbio(bbio); } -static void scrub_free_wr_ctx(struct scrub_wr_ctx *wr_ctx) -{ - mutex_lock(&wr_ctx->wr_lock); - kfree(wr_ctx->wr_curr_bio); - wr_ctx->wr_curr_bio = NULL; - mutex_unlock(&wr_ctx->wr_lock); -} - static int copy_nocow_pages(struct scrub_ctx *sctx, u64 logical, u64 len, int mirror_num, u64 physical_for_dev_replace) { |