mbox series

[v5,00/11] xfs: separate dquot type from flags

Message ID 159488191927.3813063.6443979621452250872.stgit@magnolia (mailing list archive)
Headers show
Series xfs: separate dquot type from flags | expand

Message

Darrick J. Wong July 16, 2020, 6:45 a.m. UTC
Hi all,

This series tries to clean up some of the messier parts of dquot flags
handling.  We begin by cleaning up a bunch of dquot flag misuse, so that
now xfs quota functions only take record type information; remove a
bunch of other helper macros that duplicate the "what type is this?"
predicates, and make all the quota type switching logic the same.

We make a fundamental distinction here -- from now on, xfs quota
function only take XFS_DQTYPE_{USER,GROUP,PROJ} as a type parameter.
This means that anything trying to extract the quota record type from an
incore dquot had better use xfs_dquot_type() to extract the type flags.
Right now there's no difference since there are no other type flags, but
this will become important when y2038 timestamps shows up.

Finally, we create a new xfs_dqtype_t to represent all that is an incore
dquot record type, and rename the ondisk d_flags field to d_type to make
the quota type information more self contained.

TLDR: dquot type information is now a separate field, and quota
functions now only take the XFS_DQTYPE flags that signal user, group, or
project quota.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D
---
 fs/xfs/libxfs/xfs_dquot_buf.c   |   25 +++++----
 fs/xfs/libxfs/xfs_format.h      |   13 +++++
 fs/xfs/libxfs/xfs_quota_defs.h  |   25 +++++----
 fs/xfs/scrub/quota.c            |   14 +++--
 fs/xfs/scrub/repair.c           |   10 ++--
 fs/xfs/scrub/repair.h           |    4 +-
 fs/xfs/xfs_buf_item_recover.c   |    9 ++-
 fs/xfs/xfs_dquot.c              |  103 +++++++++++++++++++++------------------
 fs/xfs/xfs_dquot.h              |   73 ++++++++++++++++++----------
 fs/xfs/xfs_dquot_item_recover.c |   12 ++---
 fs/xfs/xfs_icache.c             |    4 +-
 fs/xfs/xfs_iomap.c              |   36 +++++++-------
 fs/xfs/xfs_qm.c                 |   79 +++++++++++++++---------------
 fs/xfs/xfs_qm.h                 |   55 +++++++++------------
 fs/xfs/xfs_qm_bhv.c             |    2 -
 fs/xfs/xfs_qm_syscalls.c        |   17 ++----
 fs/xfs/xfs_quota.h              |   10 ++--
 fs/xfs/xfs_quotaops.c           |    8 ++-
 fs/xfs/xfs_trace.h              |   21 ++++++--
 fs/xfs/xfs_trans_dquot.c        |   34 ++++++++-----
 20 files changed, 302 insertions(+), 252 deletions(-)