mbox series

[v3,00/26] xfs: remove xfs_disk_quot from incore dquot

Message ID 159469028734.2914673.17856142063205791176.stgit@magnolia
Headers show
Series xfs: remove xfs_disk_quot from incore dquot | expand


Darrick J. Wong July 14, 2020, 1:31 a.m. UTC
Hi all,

This series replaces q_core (the ondisk quota structure) in the incore
dquot structure with a quota resource control structure containing the
count, reservation, limits, timers, and warnings.  Each dquot gets three
of these resource control structures (blocks, inodes, rt blocks).

Doing this enables us to remove a whole lot of noisy endian conversions
in the quota code, and enables us to refactor a bunch of open-coded
logic to pass around pointers to quota resource control structs.

Note that these cleanups are a prerequisite for the bigtime patchset, as
it depends on incore quota timers being time64_t to take advantage of
the 64-bit time functions in the kernel with fewer places to trip over
the ondisk format.

In v2 we do some more work cleaning up the d_flags/dq_flags mess,
finally add the dquot cluster size to the ondisk format declarations
(because the cluster size actually /does/ affect that), shorten some of
the long names from v1, and fix quota warning count having been broken
for years.

In v3 we separate the incore dquot's dq_flags fields into separate q_type
and q_flags fields, and introduce a new xfs_dqtype_t to make it obvious
when a function operates on a *single* quota type.  This also makes it
easier to validate that outside functions aren't going to screw up the
incore dquot state.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

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


kernel git tree:

xfsprogs git tree:
 fs/xfs/libxfs/xfs_dquot_buf.c   |   26 ++-
 fs/xfs/libxfs/xfs_format.h      |   29 +++
 fs/xfs/libxfs/xfs_quota_defs.h  |   54 ++++--
 fs/xfs/scrub/quota.c            |   86 +++------
 fs/xfs/scrub/repair.c           |   10 +
 fs/xfs/scrub/repair.h           |    4 
 fs/xfs/xfs_buf_item_recover.c   |    8 -
 fs/xfs/xfs_dquot.c              |  368 +++++++++++++++++++++------------------
 fs/xfs/xfs_dquot.h              |  119 ++++++++-----
 fs/xfs/xfs_dquot_item.c         |    8 +
 fs/xfs/xfs_dquot_item_recover.c |   12 +
 fs/xfs/xfs_icache.c             |    4 
 fs/xfs/xfs_iomap.c              |   42 ++--
 fs/xfs/xfs_qm.c                 |  196 ++++++++++-----------
 fs/xfs/xfs_qm.h                 |  104 +++++------
 fs/xfs/xfs_qm_bhv.c             |   22 +-
 fs/xfs/xfs_qm_syscalls.c        |  257 ++++++++++++++-------------
 fs/xfs/xfs_quota.h              |   10 +
 fs/xfs/xfs_quotaops.c           |   26 +--
 fs/xfs/xfs_trace.h              |  172 +++++++++++++++++-
 fs/xfs/xfs_trans_dquot.c        |  349 +++++++++++++++++++------------------
 21 files changed, 1075 insertions(+), 831 deletions(-)


Darrick J. Wong July 14, 2020, 1:43 a.m. UTC | #1
In case anyone was curious, the unreviewed patches in this series are:

4, 5, 6, 7, 8, 10, 24, and 25.

4-8 and 10 are the new ones that arrived because Christoph wanted more
refactoring of flags fields.

24 got comments in v1 and hasn't been looked at since.

25 bumps the warning counter when we go over the soft limit but haven't
gone over the hard limit or the soft warning limit.  I get it, that's
not refactoring per se, but I'm not sure if warnings not working is
deliberate, or merely a sign of how little anyone tests quota