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

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