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....@oracle.com>
Reviewed-by: David Sterba <dste...@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. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html