summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_qm.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-01 10:45:58 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-12-15 17:28:54 -0800
commit158889325271e338dcd8ec534cb1ccf09e332378 (patch)
tree705ca1598f92cfe8562d1d7977e689d7e0c5e94b /fs/xfs/xfs_qm.h
parentf0dd6e0dedb0fe8b42c0847b9727ec1399557f55 (diff)
xfs: track quota updates during live quotacheck
Create a shadow dqtrx system in the quotacheck code that hooks the regular dquot counter update code. This will be the means to keep our copy of the dquot counters up to date while the scan runs in real time. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_qm.h')
-rw-r--r--fs/xfs/xfs_qm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h
index 5bb12717ea28..731bfc1ffdb8 100644
--- a/fs/xfs/xfs_qm.h
+++ b/fs/xfs/xfs_qm.h
@@ -69,6 +69,10 @@ struct xfs_quotainfo {
/* Minimum and maximum quota expiration timestamp values. */
time64_t qi_expiry_min;
time64_t qi_expiry_max;
+
+ /* online quotacheck stuff */
+ struct xfs_hook_chain qi_mod_ino_dqtrx_hooks;
+ struct xfs_hook_chain qi_apply_dqtrx_hooks;
};
static inline struct radix_tree_root *
@@ -105,6 +109,17 @@ xfs_quota_inode(struct xfs_mount *mp, xfs_dqtype_t type)
return NULL;
}
+/*
+ * Parameters for tracking dqtrx changes on behalf of an inode. The hook
+ * function arg parameter is the field being updated.
+ */
+struct xfs_mod_ino_dqtrx_params {
+ struct xfs_trans *tp;
+ struct xfs_inode *ip;
+ struct xfs_dquot *dqp;
+ int64_t delta;
+};
+
extern void xfs_trans_mod_dquot(struct xfs_trans *tp, struct xfs_dquot *dqp,
uint field, int64_t delta);
extern void xfs_trans_dqjoin(struct xfs_trans *, struct xfs_dquot *);