diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-02-19 17:02:19 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-03-03 18:47:45 -0800 |
commit | 147319caa9bf2f3525fe91cf83e2e6f726199e15 (patch) | |
tree | 11a416ebaace8cbf65b1999995930897a85248a5 /fs/xfs/xfs_ondisk.h | |
parent | b1611a3870d8411a119308e5126376ca2d309298 (diff) |
xfs: explicitly define inode timestamp range
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_ondisk.h')
-rw-r--r-- | fs/xfs/xfs_ondisk.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/xfs_ondisk.h b/fs/xfs/xfs_ondisk.h index acb9b737fe6b..48a64fa49f91 100644 --- a/fs/xfs/xfs_ondisk.h +++ b/fs/xfs/xfs_ondisk.h @@ -15,6 +15,18 @@ "XFS: offsetof(" #structname ", " #member ") is wrong, " \ "expected " #off) +#define XFS_CHECK_VALUE(value, expected) \ + BUILD_BUG_ON_MSG((value) != (expected), \ + "XFS: value of " #value " is wrong, expected " #expected) + +static inline void __init +xfs_check_limits(void) +{ + /* make sure timestamp limits are correct */ + XFS_CHECK_VALUE(XFS_INO_TIME_MIN, -2147483648LL); + XFS_CHECK_VALUE(XFS_INO_TIME_MAX, 2147483647LL); +} + static inline void __init xfs_check_ondisk_structs(void) { |