Skip to content

Commit f29c3e7

Browse files
author
Darrick J. Wong
committed
xfs: convert rt bitmap extent lengths to xfs_rtbxlen_t
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>
1 parent 03f4de3 commit f29c3e7

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

fs/xfs/libxfs/xfs_format.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ typedef struct xfs_sb {
9898
uint32_t sb_blocksize; /* logical block size, bytes */
9999
xfs_rfsblock_t sb_dblocks; /* number of data blocks */
100100
xfs_rfsblock_t sb_rblocks; /* number of realtime blocks */
101-
xfs_rtblock_t sb_rextents; /* number of realtime extents */
101+
xfs_rtbxlen_t sb_rextents; /* number of realtime extents */
102102
uuid_t sb_uuid; /* user-visible file system unique id */
103103
xfs_fsblock_t sb_logstart; /* starting block of log if internal */
104104
xfs_ino_t sb_rootino; /* root inode number */

fs/xfs/libxfs/xfs_rtbitmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
struct xfs_rtalloc_rec {
1515
xfs_rtblock_t ar_startext;
16-
xfs_rtblock_t ar_extcount;
16+
xfs_rtbxlen_t ar_extcount;
1717
};
1818

1919
typedef int (*xfs_rtalloc_query_range_fn)(

fs/xfs/libxfs/xfs_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ typedef uint64_t xfs_rfsblock_t; /* blockno in filesystem (raw) */
3232
typedef uint64_t xfs_rtblock_t; /* extent (block) in realtime area */
3333
typedef uint64_t xfs_fileoff_t; /* block number in a file */
3434
typedef uint64_t xfs_filblks_t; /* number of blocks in a file */
35+
typedef uint64_t xfs_rtbxlen_t; /* rtbitmap extent length in rtextents */
3536

3637
typedef int64_t xfs_srtblock_t; /* signed version of xfs_rtblock_t */
3738

fs/xfs/scrub/trace.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,8 @@ TRACE_EVENT(xfarray_sort_stats,
10371037
#ifdef CONFIG_XFS_RT
10381038
TRACE_EVENT(xchk_rtsum_record_free,
10391039
TP_PROTO(struct xfs_mount *mp, xfs_rtblock_t start,
1040-
uint64_t len, unsigned int log, loff_t pos, xfs_suminfo_t v),
1040+
xfs_rtbxlen_t len, unsigned int log, loff_t pos,
1041+
xfs_suminfo_t v),
10411042
TP_ARGS(mp, start, len, log, pos, v),
10421043
TP_STRUCT__entry(
10431044
__field(dev_t, dev)

0 commit comments

Comments
 (0)