Blame SOURCES/xfsprogs-5.8.0-xfs_quota-display-warning-limits-when-printing-quota.patch

34753f
From 387a96e12a937c1b2ee29a0f2c52245d6a283078 Mon Sep 17 00:00:00 2001
34753f
From: "Darrick J. Wong" <darrick.wong@oracle.com>
34753f
Date: Mon, 24 Aug 2020 13:23:32 -0400
34753f
Subject: [PATCH] xfs_quota: display warning limits when printing quota type
34753f
 information
34753f
34753f
We should dump the default warning limits when we're printing quota
34753f
information.
34753f
34753f
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
34753f
Reviewed-by: Christoph Hellwig <hch@lst.de>
34753f
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
34753f
---
34753f
 quota/state.c | 14 ++++++++++++++
34753f
 1 file changed, 14 insertions(+)
34753f
34753f
diff --git a/quota/state.c b/quota/state.c
34753f
index 7a595fc6..1627181d 100644
34753f
--- a/quota/state.c
34753f
+++ b/quota/state.c
34753f
@@ -130,6 +130,16 @@ state_timelimit(
34753f
 		time_to_string(timelimit, VERBOSE_FLAG | ABSOLUTE_FLAG));
34753f
 }
34753f
 
34753f
+static void
34753f
+state_warnlimit(
34753f
+	FILE		*fp,
34753f
+	uint		form,
34753f
+	uint16_t	warnlimit)
34753f
+{
34753f
+	fprintf(fp, _("%s max warnings: %u\n"),
34753f
+		form_to_string(form), warnlimit);
34753f
+}
34753f
+
34753f
 /*
34753f
  * fs_quota_stat holds a subset of fs_quota_statv; this copies
34753f
  * the smaller into the larger, leaving any not-present fields
34753f
@@ -218,7 +228,11 @@ state_quotafile_mount(
34753f
 				sv.qs_flags & XFS_QUOTA_PDQ_ENFD);
34753f
 
34753f
 	state_timelimit(fp, XFS_BLOCK_QUOTA, sv.qs_btimelimit);
34753f
+	state_warnlimit(fp, XFS_BLOCK_QUOTA, sv.qs_bwarnlimit);
34753f
+
34753f
 	state_timelimit(fp, XFS_INODE_QUOTA, sv.qs_itimelimit);
34753f
+	state_warnlimit(fp, XFS_INODE_QUOTA, sv.qs_iwarnlimit);
34753f
+
34753f
 	state_timelimit(fp, XFS_RTBLOCK_QUOTA, sv.qs_rtbtimelimit);
34753f
 }
34753f
 
34753f
-- 
34753f
2.31.1
34753f