]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
xfs: use offsetof() in place of offset macros for __xfsstats
authorCarlos Maiolino <cmaiolino@redhat.com>
Thu, 18 Oct 2018 06:21:39 +0000 (17:21 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 18 Oct 2018 06:21:39 +0000 (17:21 +1100)
commit26ca39015ef210d728df53d66c1ae85e8b48b2f3
tree7008ec8f6605d864c0bc7c7449ddb2139ae98b95
parent41657e5507b13e963be906d5d874f4f02374fd5c
xfs: use offsetof() in place of offset macros for __xfsstats

Most offset macro mess is used in xfs_stats_format() only, and we can
simply get the right offsets using offsetof(), instead of several macros
to mark the offsets inside __xfsstats structure.

Replace all XFSSTAT_END_* macros by a single helper macro to get the
right offset into __xfsstats, and use this helper in xfs_stats_format()
directly.

The quota stats code, still looks a bit cleaner when using XFSSTAT_*
macros, so, this patch also defines XFSSTAT_START_XQMSTAT and
XFSSTAT_END_XQMSTAT locally to that code. This also should prevent
offset mistakes when updates are done into __xfsstats.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_stats.c
fs/xfs/xfs_stats.h