On Wed, Jul 01, 2020 at 04:19:10PM -0700, Darrick J. Wong wrote: > On Thu, Jul 02, 2020 at 08:50:53AM +1000, Dave Chinner wrote: > > On Tue, Jun 30, 2020 at 08:42:16AM -0700, Darrick J. Wong wrote: > > > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > > > > > Use the incore dq_flags to figure out the dquot type. This is the first > > > step towards removing xfs_disk_dquot from the incore dquot. > > > > > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > > --- > > > fs/xfs/libxfs/xfs_quota_defs.h | 2 ++ > > > fs/xfs/scrub/quota.c | 4 ---- > > > fs/xfs/xfs_dquot.c | 33 +++++++++++++++++++++++++++++++-- > > > fs/xfs/xfs_dquot.h | 2 ++ > > > fs/xfs/xfs_dquot_item.c | 6 ++++-- > > > fs/xfs/xfs_qm.c | 4 ++-- > > > fs/xfs/xfs_qm.h | 2 +- > > > fs/xfs/xfs_qm_syscalls.c | 9 +++------ > > > 8 files changed, 45 insertions(+), 17 deletions(-) > > > > > > > > > diff --git a/fs/xfs/libxfs/xfs_quota_defs.h b/fs/xfs/libxfs/xfs_quota_defs.h > > > index 56d9dd787e7b..459023b0a304 100644 > > > --- a/fs/xfs/libxfs/xfs_quota_defs.h > > > +++ b/fs/xfs/libxfs/xfs_quota_defs.h > > > @@ -29,6 +29,8 @@ typedef uint16_t xfs_qwarncnt_t; > > > > > > #define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROUP) > > > > > > +#define XFS_DQ_ONDISK (XFS_DQ_ALLTYPES) > > > > That's used as an on-disk flags mask. Perhaps XFS_DQF_ONDISK_MASK? > > Well, based on Christoph's suggestions I broke the incore dquot flags > (XFS_DQ_*) apart from the ondisk dquot flags (XFS_DQFLAG_*). Not sure > if that's really better, but at least the namespaces are separate now. Sure, but the point I was trying to make is that "XFS_DQ_ONDISK" doesn't actually indicate what part of the on-disk dquot it refers to. We use the phrase "on-disk dquot" to refer to the entire on-disk dquot, not a subset of flags in a flags field in the on-disk dquot. Hence the name of this variable needs to be more specific as to what it applies to in the on-disk dquot... Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx