Blame SOURCES/xfsprogs-5.10.0-xfs-refactor-default-quota-grace-period-setting-code.patch

f49185
From abc0f20536e3bc1505f575f452c55585c34f6e06 Mon Sep 17 00:00:00 2001
f49185
From: "Darrick J. Wong" <darrick.wong@oracle.com>
f49185
Date: Tue, 10 Nov 2020 15:11:43 -0500
f49185
Subject: [PATCH] xfs: refactor default quota grace period setting code
f49185
f49185
Source kernel commit: ccc8e771aa7a80eb047fc263780816ca76dd02a6
f49185
f49185
Refactor the code that sets the default quota grace period into a helper
f49185
function so that we can override the ondisk behavior later.
f49185
f49185
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
f49185
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
f49185
Reviewed-by: Christoph Hellwig <hch@lst.de>
f49185
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
f49185
Reviewed-by: Dave Chinner <dchinner@redhat.com>
f49185
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
f49185
---
f49185
f49185
diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
f49185
index c67bd61..8858341 100644
f49185
--- a/libxfs/xfs_format.h
f49185
+++ b/libxfs/xfs_format.h
f49185
@@ -1190,6 +1190,11 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
f49185
  * been reached, and therefore no expiration has been set.  Therefore, the
f49185
  * ondisk min and max defined here can be used directly to constrain the incore
f49185
  * quota expiration timestamps on a Unix system.
f49185
+ *
f49185
+ * The grace period for each quota type is stored in the root dquot (id = 0)
f49185
+ * and is applied to a non-root dquot when it exceeds the soft or hard limits.
f49185
+ * The length of quota grace periods are unsigned 32-bit quantities measured in
f49185
+ * units of seconds.  A value of zero means to use the default period.
f49185
  */
f49185
 
f49185
 /*
f49185
@@ -1204,6 +1209,14 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
f49185
  */
f49185
 #define XFS_DQ_LEGACY_EXPIRY_MAX	((int64_t)U32_MAX)
f49185
 
f49185
+/*
f49185
+ * Default quota grace periods, ranging from zero (use the compiled defaults)
f49185
+ * to ~136 years.  These are applied to a non-root dquot that has exceeded
f49185
+ * either limit.
f49185
+ */
f49185
+#define XFS_DQ_GRACE_MIN		((int64_t)0)
f49185
+#define XFS_DQ_GRACE_MAX		((int64_t)U32_MAX)
f49185
+
f49185
 /*
f49185
  * This is the main portion of the on-disk representation of quota
f49185
  * information for a user. This is the q_core of the xfs_dquot_t that