From: Liu Bo <bo.li.liu@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: use helper to get used bytes of space_info
Date: Tue, 14 Feb 2017 11:05:18 -0800 [thread overview]
Message-ID: <20170214190518.GB31091@localhost.localdomain> (raw)
In-Reply-To: <20170214155606.GO16928@twin.jikos.cz>
On Tue, Feb 14, 2017 at 04:56:06PM +0100, David Sterba wrote:
> 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.
I agree, it sounds better.
Thanks,
-liubo
prev parent reply other threads:[~2017-02-14 19:06 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
2017-02-14 19:05 ` Liu Bo [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=20170214190518.GB31091@localhost.localdomain \
--to=bo.li.liu@oracle.com \
--cc=dsterba@suse.cz \
--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