From: Josh Triplett <josh@joshtriplett.org>
To: Rashika Kheria <rashika.kheria@gmail.com>
Cc: opw-kernel@googlegroups.com, linux-btrfs@vger.kernel.org,
Zach Brown <zab@redhat.com>
Subject: Re: [OPW kernel] [PATCH v3] btrfs: Add helper function for free_root_pointers()
Date: Sat, 2 Nov 2013 09:59:04 -0700 [thread overview]
Message-ID: <20131102165904.GH15704@leaf> (raw)
In-Reply-To: <1383167720-24201-1-git-send-email-rashika.kheria@gmail.com>
On Thu, Oct 31, 2013 at 02:45:20AM +0530, Rashika Kheria wrote:
> The function free_root_pointers() in disk-io.h contains redundant code.
> Therefore, this patch adds a helper function free_root_extent_buffers()
> to free_root_pointers() to eliminate redundancy.
>
> Reviewed-by: Zach Brown <zab@redhat.com>
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
(In general, the Reviewed-by goes after the Signed-off-by.)
One minor nit:
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -2012,50 +2012,28 @@ static void btrfs_stop_all_workers(struct btrfs_fs_info *fs_info)
> btrfs_stop_workers(&fs_info->qgroup_rescan_workers);
> }
>
> +static void free_root_extent_buffers(struct btrfs_root *root)
> +{
> + if (root) {
> + free_extent_buffer(root->node);
> + free_extent_buffer(root->commit_root);
> + root->node = NULL;
> + root->commit_root = NULL;
> + }
> +}
I'd tend to write this with an early return if (!root). In this case it
doesn't matter much, but it's a good habit to get into for larger
functions with deeper indentation.
- Josh Triplett
next prev parent reply other threads:[~2013-11-02 16:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20131030204834.GA20844@gmail.com>
2013-10-30 21:15 ` [PATCH v3] btrfs: Add helper function for free_root_pointers() Rashika Kheria
2013-11-02 16:59 ` Josh Triplett [this message]
2013-11-02 18:24 ` [PATCH v4] " Rashika Kheria
2013-11-02 20:39 ` Josef Back
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=20131102165904.GH15704@leaf \
--to=josh@joshtriplett.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=opw-kernel@googlegroups.com \
--cc=rashika.kheria@gmail.com \
--cc=zab@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.