]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: convert rt bitmap extent lengths to xfs_rtbxlen_t
authorDarrick J. Wong <djwong@kernel.org>
Mon, 12 Feb 2024 14:15:20 +0000 (15:15 +0100)
committerCarlos Maiolino <cem@kernel.org>
Thu, 15 Feb 2024 11:56:43 +0000 (12:56 +0100)
Source kernel commit: f29c3e745dc253bf9d9d06ddc36af1a534ba1dd0

XFS uses xfs_rtblock_t for many different uses, which makes it much more
difficult to perform a unit analysis on the codebase.  One of these
(ab)uses is when we need to store the length of a free space extent as
stored in the realtime bitmap.  Because there can be up to 2^64 realtime
extents in a filesystem, we need a new type that is larger than
xfs_rtxlen_t for callers that are querying the bitmap directly.  This
means scrub and growfs.

Create this type as "xfs_rtbxlen_t" and use it to store 64-bit rtx
lengths.  'b' stands for 'bitmap' or 'big'; reader's choice.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_format.h
libxfs/xfs_rtbitmap.h
libxfs/xfs_types.h

index 371dc07233e059a95545629107d409f21653dbe4..20acb8573d7a284018971a33638ba7c390dce449 100644 (file)
@@ -98,7 +98,7 @@ typedef struct xfs_sb {
        uint32_t        sb_blocksize;   /* logical block size, bytes */
        xfs_rfsblock_t  sb_dblocks;     /* number of data blocks */
        xfs_rfsblock_t  sb_rblocks;     /* number of realtime blocks */
-       xfs_rtblock_t   sb_rextents;    /* number of realtime extents */
+       xfs_rtbxlen_t   sb_rextents;    /* number of realtime extents */
        uuid_t          sb_uuid;        /* user-visible file system unique id */
        xfs_fsblock_t   sb_logstart;    /* starting block of log if internal */
        xfs_ino_t       sb_rootino;     /* root inode number */
index e2ea6d31c38b1cd7bf2a7d6a5c6ba706eb1f1fd8..b0a81fb8dbda2ff12386453176942b0483b8d98f 100644 (file)
@@ -13,7 +13,7 @@
  */
 struct xfs_rtalloc_rec {
        xfs_rtblock_t           ar_startext;
-       xfs_rtblock_t           ar_extcount;
+       xfs_rtbxlen_t           ar_extcount;
 };
 
 typedef int (*xfs_rtalloc_query_range_fn)(
index 713cb70311efaf839ae9df87c0c2e2b89edd50df..9af98a97523946d897bbc2d80bab5bbc94db2a20 100644 (file)
@@ -32,6 +32,7 @@ typedef uint64_t      xfs_rfsblock_t; /* blockno in filesystem (raw) */
 typedef uint64_t       xfs_rtblock_t;  /* extent (block) in realtime area */
 typedef uint64_t       xfs_fileoff_t;  /* block number in a file */
 typedef uint64_t       xfs_filblks_t;  /* number of blocks in a file */
+typedef uint64_t       xfs_rtbxlen_t;  /* rtbitmap extent length in rtextents */
 
 typedef int64_t                xfs_srtblock_t; /* signed version of xfs_rtblock_t */