summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_dquot_buf.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-08-17 14:08:23 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-09-15 20:52:40 -0700
commit9f99c8fe551a056c0929dff13cbce62b6b150156 (patch)
treef32729ce9509c12622359288f6b2660eba8d0331 /fs/xfs/libxfs/xfs_dquot_buf.c
parentccc8e771aa7a80eb047fc263780816ca76dd02a6 (diff)
downloadlinux-9f99c8fe551a056c0929dff13cbce62b6b150156.tar.bz2
xfs: refactor quota timestamp coding
Refactor quota timestamp encoding and decoding into helper functions so that we can add extra behavior in the next patch. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Allison Collins <allison.henderson@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_dquot_buf.c')
-rw-r--r--fs/xfs/libxfs/xfs_dquot_buf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_dquot_buf.c b/fs/xfs/libxfs/xfs_dquot_buf.c
index 5a2db00b9d5f..cf85bad8a894 100644
--- a/fs/xfs/libxfs/xfs_dquot_buf.c
+++ b/fs/xfs/libxfs/xfs_dquot_buf.c
@@ -288,3 +288,21 @@ const struct xfs_buf_ops xfs_dquot_buf_ra_ops = {
.verify_read = xfs_dquot_buf_readahead_verify,
.verify_write = xfs_dquot_buf_write_verify,
};
+
+/* Convert an on-disk timer value into an incore timer value. */
+time64_t
+xfs_dquot_from_disk_ts(
+ struct xfs_disk_dquot *ddq,
+ __be32 dtimer)
+{
+ return be32_to_cpu(dtimer);
+}
+
+/* Convert an incore timer value into an on-disk timer value. */
+__be32
+xfs_dquot_to_disk_ts(
+ struct xfs_dquot *dqp,
+ time64_t timer)
+{
+ return cpu_to_be32(timer);
+}