From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.cz
Subject: Re: [PATCH v2 1/2] btrfs: Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index()
Date: Wed, 31 Jan 2018 16:20:54 +0100 [thread overview]
Message-ID: <20180131152054.GD18553@twin.jikos.cz> (raw)
In-Reply-To: <20180130102046.10586-1-wqu@suse.com>
On Tue, Jan 30, 2018 at 06:20:45PM +0800, Qu Wenruo wrote:
> Function __get_raid_index() is used to convert block group flags into
> raid index, which can be used to get various info directly from
> btrfs_raid_array[].
>
> Refactor this function a little:
>
> 1) Rename to btrfs_bg_flags_to_raid_index()
> Double underline prefix is normally for internal functions, while the
> function is used by both extent-tree and volumes.
>
> Although the name is a little longer, but it should explain its usage
> quite well.
>
> 2) Move it to volumes.h and make it static inline
> Just several if-else branches, really no need to define it as a normal
> function.
>
> This also makes later code re-use between kernel and btrfs-progs
> easier.
>
> 3) Remove function get_block_group_index()
> Really no need to do such a simple thing as an exported function.
Agreed on this kind of cleanups. Patches added to next, thanks.
prev parent reply other threads:[~2018-01-31 15:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 10:20 [PATCH v2 1/2] btrfs: Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index() Qu Wenruo
2018-01-30 10:20 ` [PATCH v2 2/2] btrfs: Refactor parameter of BTRFS_MAX_DEVS() from root to fs_info Qu Wenruo
2018-01-31 15:20 ` David Sterba [this message]
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=20180131152054.GD18553@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@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;
as well as URLs for NNTP newsgroup(s).