From: David Sterba <dsterba@suse.cz>
To: Liu Bo <bo.li.liu@oracle.com>
Cc: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.cz>
Subject: Re: [PATCH] Btrfs: use helper to get used bytes of space_info
Date: Tue, 14 Feb 2017 16:56:06 +0100 [thread overview]
Message-ID: <20170214155606.GO16928@twin.jikos.cz> (raw)
In-Reply-To: <1487029341-12911-1-git-send-email-bo.li.liu@oracle.com>
On Mon, Feb 13, 2017 at 03:42:21PM -0800, Liu Bo wrote:
> This uses a helper instead of open code around used byte of space_info
> everywhere.
>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
> ---
> fs/btrfs/extent-tree.c | 42 ++++++++++++++++++++----------------------
> 1 file changed, 20 insertions(+), 22 deletions(-)
>
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 097fa4a..b2b0b82 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -4118,6 +4118,15 @@ u64 btrfs_get_alloc_profile(struct btrfs_root *root, int data)
> return ret;
> }
>
> +static u64 btrfs_space_info_used(struct btrfs_space_info *s_info,
> + bool may_used_included)
> +{
> + ASSERT(s_info);
> + return s_info->bytes_used + s_info->bytes_reserved +
> + s_info->bytes_pinned + s_info->bytes_readonly +
> + ((may_used_included) ? s_info->bytes_may_use : 0);
I'd rename may_used_included to 'may_use_included' so it matches bytes_may_use.
next prev parent reply other threads:[~2017-02-14 15:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 23:42 [PATCH] Btrfs: use helper to get used bytes of space_info Liu Bo
2017-02-14 15:56 ` David Sterba [this message]
2017-02-14 19:05 ` Liu Bo
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=20170214155606.GO16928@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=bo.li.liu@oracle.com \
--cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox