All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 03/18] xfs: refactor quota expiration timer modification
Date: Mon, 17 Aug 2020 15:59:12 -0700	[thread overview]
Message-ID: <159770515211.3958786.7094290347539609121.stgit@magnolia> (raw)
In-Reply-To: <159770513155.3958786.16108819726679724438.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

Define explicit limits on the range of quota grace period expiration
timeouts and refactor the code that modifies the timeouts into helpers
that clamp the values appropriately.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/xfs_format.h |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)


diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index f2a851e49ec3..829eb1e035a5 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -1198,6 +1198,28 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
 
 #define XFS_DQTYPE_ANY		(XFS_DQTYPE_REC_MASK)
 
+/*
+ * XFS Quota Timers
+ * ================
+ *
+ * Quota grace period expiration timers are an unsigned 32-bit seconds counter;
+ * time zero is the Unix epoch, Jan  1 00:00:01 UTC 1970.  An expiration value
+ * of zero means that the quota limit has not been reached, and therefore no
+ * expiration has been set.
+ */
+
+/*
+ * Smallest possible quota expiration with traditional timestamps, which is
+ * Jan  1 00:00:01 UTC 1970.
+ */
+#define XFS_DQ_TIMEOUT_MIN	((int64_t)1)
+
+/*
+ * Largest possible quota expiration with traditional timestamps, which is
+ * Feb  7 06:28:15 UTC 2106.
+ */
+#define XFS_DQ_TIMEOUT_MAX	((int64_t)U32_MAX)
+
 /*
  * This is the main portion of the on-disk representation of quota information
  * for a user.  We pad this with some more expansion room to construct the on


  parent reply	other threads:[~2020-08-17 23:01 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
2020-08-17 22:58 ` [PATCH 01/18] libxfs: create a real struct timespec64 Darrick J. Wong
2020-08-18 14:19   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 02/18] xfs: explicitly define inode timestamp range Darrick J. Wong
2020-08-18 14:17   ` Amir Goldstein
2020-08-17 22:59 ` Darrick J. Wong [this message]
2020-08-18 14:21   ` [PATCH 03/18] xfs: refactor quota expiration timer modification Amir Goldstein
2020-08-18 15:25     ` Darrick J. Wong
2020-08-18 18:50       ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 04/18] xfs: refactor default quota grace period setting code Darrick J. Wong
2020-08-18 14:23   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 05/18] xfs: remove xfs_timestamp_t Darrick J. Wong
2020-08-18 14:24   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 06/18] xfs: move xfs_log_dinode_to_disk to the log code Darrick J. Wong
2020-08-18 14:26   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 07/18] xfs: refactor inode timestamp coding Darrick J. Wong
2020-08-18 14:28   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 08/18] xfs: convert struct xfs_timestamp to union Darrick J. Wong
2020-08-18 14:29   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 09/18] libxfs: refactor NSEC_PER_SEC Darrick J. Wong
2020-08-18 14:31   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 10/18] xfs: widen ondisk timestamps to deal with y2038 problem Darrick J. Wong
2020-08-18 14:40   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 11/18] xfs: refactor quota timestamp coding Darrick J. Wong
2020-08-18 14:41   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 12/18] xfs: enable bigtime for quota timers Darrick J. Wong
2020-08-17 23:00 ` [PATCH 13/18] xfs: enable big timestamps Darrick J. Wong
2020-08-18 14:42   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 14/18] xfs_db: report bigtime format timestamps Darrick J. Wong
2020-08-18 15:37   ` Darrick J. Wong
2020-08-17 23:00 ` [PATCH 15/18] xfs_db: support printing time limits Darrick J. Wong
2020-08-17 23:00 ` [PATCH 16/18] xfs_db: add bigtime upgrade path Darrick J. Wong
2020-08-18 15:17   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 17/18] xfs_repair: support bigtime Darrick J. Wong
2020-08-18 14:58   ` Amir Goldstein
2020-08-18 15:32     ` Darrick J. Wong
2020-08-17 23:00 ` [PATCH 18/18] mkfs: format bigtime filesystems Darrick J. Wong
2020-08-18 14:45   ` Amir Goldstein
2020-08-18 15:34     ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=159770515211.3958786.7094290347539609121.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.