From: Zhao Lei <zhaolei@cn.fujitsu.com>
To: "'Sean Fu'" <fxinrong@gmail.com>, <dsterba@suse.com>
Cc: <clm@fb.com>, <anand.jain@oracle.com>, <fdmanana@suse.com>,
<linux-kernel@vger.kernel.org>, <linux-btrfs@vger.kernel.org>
Subject: RE: [PATCH v2] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.
Date: Tue, 6 Sep 2016 13:19:39 +0800 [thread overview]
Message-ID: <005301d207fe$447ebd50$cd7c37f0$@cn.fujitsu.com> (raw)
In-Reply-To: <1473133858-12230-1-git-send-email-fxinrong@gmail.com>
Hi, Sean Fu
> -----Original Message-----
> From: Sean Fu [mailto:fxinrong@gmail.com]
> Sent: Tuesday, September 06, 2016 11:51 AM
> To: dsterba@suse.com
> Cc: clm@fb.com; anand.jain@oracle.com; fdmanana@suse.com;
> zhaolei@cn.fujitsu.com; linux-kernel@vger.kernel.org;
> linux-btrfs@vger.kernel.org; Sean Fu <fxinrong@gmail.com>
> Subject: [PATCH v2] Btrfs: remove unnecessary code of chunk_root assignment
> in btrfs_read_chunk_tree.
>
> The input argument root is already set with "fs_info->chunk_root".
> "chunk_root = fs_info->chunk_root = btrfs_alloc_root(fs_info)" in caller
> "open_ctree".
> "root->fs_info = fs_info” in "btrfs_alloc_root".
>
> Signed-off-by: Sean Fu <fxinrong@gmail.com>
> ---
> Changes in v2:
> - Renaming root to chunk_root to make it clear.
>
> fs/btrfs/volumes.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 366b335..eb3d04a 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -6591,7 +6591,7 @@ out_short_read:
> return -EIO;
> }
>
> -int btrfs_read_chunk_tree(struct btrfs_root *root)
> +int btrfs_read_chunk_tree(struct btrfs_root *chunk_root)
Maybe you also need to modify function body to make it
pass compile, and the header file also need to be modified.
BTW, Qu Wenruo give us a better way in reply, we
can use fs_info directly.
Thanks
Zhaolei
> {
> struct btrfs_path *path;
> struct extent_buffer *leaf;
> @@ -6600,8 +6600,6 @@ int btrfs_read_chunk_tree(struct btrfs_root *root)
> int ret;
> int slot;
>
> - root = root->fs_info->chunk_root;
> -
> path = btrfs_alloc_path();
> if (!path)
> return -ENOMEM;
> --
> 2.6.2
>
next parent reply other threads:[~2016-09-06 5:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1473133858-12230-1-git-send-email-fxinrong@gmail.com>
2016-09-06 5:19 ` Zhao Lei [this message]
2016-09-07 1:41 ` [PATCH v2] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree Sean Fu
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='005301d207fe$447ebd50$cd7c37f0$@cn.fujitsu.com' \
--to=zhaolei@cn.fujitsu.com \
--cc=anand.jain@oracle.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=fxinrong@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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.