xfs
[Top] [All Lists]

Re: [PATCH 7/7] xfs: per-filesystem stats counter implementation

To: Bill O'Donnell <billodo@xxxxxxxxxx>
Subject: Re: [PATCH 7/7] xfs: per-filesystem stats counter implementation
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 7 Oct 2015 17:18:05 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1443802960-26662-8-git-send-email-billodo@xxxxxxxxxx>
References: <1443802960-26662-1-git-send-email-billodo@xxxxxxxxxx> <1443802960-26662-8-git-send-email-billodo@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Oct 02, 2015 at 11:22:40AM -0500, Bill O'Donnell wrote:
> This patch modifies the stats counting macros and the callers
> to those macros to properly increment, decrement, and add-to
> the xfs stats counts. The counts for global and per-fs stats
> are correctly advanced, and cleared by writing a "1" to the
> corresponding clear file.
> 
> global counts: /sys/fs/xfs/stats/stats
> per-fs counts: /sys/fs/xfs/sda*/stats/stats
> 
> global clear:  /sys/fs/xfs/stats/stats_clear
> per-fs clear:  /sys/fs/xfs/sda*/stats/stats_clear
> 
> Signed-off-by: Bill O'Donnell <billodo@xxxxxxxxxx>
....
> +#define __XFS_BTREE_STATS_INC(mp, type, stat) \
> +     XFS_STATS_INC(mp, xs_ ## type ## _2_ ## stat)
> +#define XFS_BTREE_STATS_INC(cur, stat)       \
>  do {    \
> +     struct xfs_mount *mp = cur->bc_mp; \

This will cause gcc to throw "shadow definition" warnings in
userspace as the macro will be used in functions that already have a
"mp" variable defined. In general, variables within a macro like
this are given a "__" prefix so such namespace collisions are
unlikely. I'll fix this up manually.

Otherwise looks OK.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>