]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: introduce XFS_MAX_FILEOFF
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 14 Mar 2020 02:59:57 +0000 (22:59 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Sat, 14 Mar 2020 02:59:57 +0000 (22:59 -0400)
Source kernel commit: a5084865524dee1fe8ea1fee17c60b4369ad4f5e

Introduce a new #define for the maximum supported file block offset.
We'll use this in the next patch to make it more obvious that we're
doing some operation for all possible inode fork mappings after a given
offset.  We can't use ULLONG_MAX here because bunmapi uses that to
detect when it's done.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_format.h

index e856e54c755acfcb98494c3a37f311a6884903b7..3dcc1ed5cdfb6b4531721f895a7736aa489ab249 100644 (file)
@@ -1540,6 +1540,13 @@ typedef struct xfs_bmdr_block {
 #define BMBT_BLOCKCOUNT_BITLEN 21
 
 #define BMBT_STARTOFF_MASK     ((1ULL << BMBT_STARTOFF_BITLEN) - 1)
+#define BMBT_BLOCKCOUNT_MASK   ((1ULL << BMBT_BLOCKCOUNT_BITLEN) - 1)
+
+/*
+ * bmbt records have a file offset (block) field that is 54 bits wide, so this
+ * is the largest xfs_fileoff_t that we ever expect to see.
+ */
+#define XFS_MAX_FILEOFF                (BMBT_STARTOFF_MASK + BMBT_BLOCKCOUNT_MASK)
 
 typedef struct xfs_bmbt_rec {
        __be64                  l0, l1;