From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] btrfs: Move free_pages_out label in inline extent handling branch in compress_file_range
Date: Tue, 2 Jul 2019 12:39:55 +0800 [thread overview]
Message-ID: <e69a9a0c-7c0e-36dc-7f9e-697a83e5523b@oracle.com> (raw)
In-Reply-To: <20190701165055.15483-2-nborisov@suse.com>
On 2/7/19 12:50 AM, Nikolay Borisov wrote:
> This label is only executed if compress_file_range fails to create an
> inline extent. So move its code in the semantically related inline
> extent handling branch. No functional changes.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Looks good.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
> ---
> fs/btrfs/inode.c | 18 ++++++++----------
> 1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 3b0bf5ea9eb6..072a300f8487 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -600,7 +600,14 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
> PAGE_SET_WRITEBACK |
> page_error_op |
> PAGE_END_WRITEBACK);
> - goto free_pages_out;
> +
> + for (i = 0; i < nr_pages; i++) {
> + WARN_ON(pages[i]->mapping);
> + put_page(pages[i]);
> + }
> + kfree(pages);
> +
> + return 0;
> }
> }
>
> @@ -678,15 +685,6 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
> compressed_extents += 1;
>
> return compressed_extents;
> -
> -free_pages_out:
> - for (i = 0; i < nr_pages; i++) {
> - WARN_ON(pages[i]->mapping);
> - put_page(pages[i]);
> - }
> - kfree(pages);
> -
> - return 0;
> }
>
> static void free_async_extent_pages(struct async_extent *async_extent)
>
next prev parent reply other threads:[~2019-07-02 4:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-01 16:50 [PATCH 1/2] btrfs: Return number of compressed extents directly in compress_file_range Nikolay Borisov
2019-07-01 16:50 ` [PATCH 2/2] btrfs: Move free_pages_out label in inline extent handling branch " Nikolay Borisov
2019-07-02 2:20 ` Qu Wenruo
2019-07-02 4:39 ` Anand Jain [this message]
2019-07-02 2:20 ` [PATCH 1/2] btrfs: Return number of compressed extents directly " Qu Wenruo
2019-07-02 4:40 ` Anand Jain
-- strict thread matches above, loose matches on Subject: below --
2019-07-17 11:41 Nikolay Borisov
2019-07-17 11:41 ` [PATCH 2/2] btrfs: Move free_pages_out label in inline extent handling branch " Nikolay Borisov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e69a9a0c-7c0e-36dc-7f9e-697a83e5523b@oracle.com \
--to=anand.jain@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox