summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_rtbitmap.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-09-21 09:43:56 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-11-09 19:07:55 -0800
commit7e997b6704c25c7eab3614b8609a3cc5aff35a0a (patch)
tree478d96b3c42506f8fc8598d82f5313c63d3ebf49 /fs/xfs/libxfs/xfs_rtbitmap.h
parent6c572467088de36f537b3085c8d56554f7c505d9 (diff)
xfs: use accessor functions for bitmap words
Create get and set functions for rtbitmap words so that we can redefine the ondisk format with a specific endianness. Note that this requires the definition of a distinct type for ondisk rtbitmap words so that the compiler can perform proper typechecking as we go back and forth. In the upcoming rtgroups feature, we're going to fix the problem that rtwords are written in host endian order, which means we'll need the distinct rtword/rtword_raw types. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_rtbitmap.h')
-rw-r--r--fs/xfs/libxfs/xfs_rtbitmap.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.h b/fs/xfs/libxfs/xfs_rtbitmap.h
index d98ea03752d7..c240d21efb61 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.h
+++ b/fs/xfs/libxfs/xfs_rtbitmap.h
@@ -122,18 +122,18 @@ xfs_rbmblock_to_rtx(
}
/* Return a pointer to a bitmap word within a rt bitmap block buffer. */
-static inline xfs_rtword_t *
+static inline union xfs_rtword_ondisk *
xfs_rbmbuf_wordptr(
void *buf,
unsigned int rbmword)
{
- xfs_rtword_t *wordp = buf;
+ union xfs_rtword_ondisk *wordp = buf;
return &wordp[rbmword];
}
/* Return a pointer to a bitmap word within a rt bitmap block. */
-static inline xfs_rtword_t *
+static inline union xfs_rtword_ondisk *
xfs_rbmblock_wordptr(
struct xfs_buf *bp,
unsigned int rbmword)
@@ -266,6 +266,10 @@ xfs_filblks_t xfs_rtbitmap_blockcount(struct xfs_mount *mp, xfs_rtbxlen_t
rtextents);
unsigned long long xfs_rtbitmap_wordcount(struct xfs_mount *mp,
xfs_rtbxlen_t rtextents);
+xfs_rtword_t xfs_rtbitmap_getword(struct xfs_mount *mp,
+ union xfs_rtword_ondisk *wordptr);
+void xfs_rtbitmap_setword(struct xfs_mount *mp,
+ union xfs_rtword_ondisk *wordptr, xfs_rtword_t incore);
#else /* CONFIG_XFS_RT */
# define xfs_rtfree_extent(t,b,l) (-ENOSYS)
# define xfs_rtfree_blocks(t,rb,rl) (-ENOSYS)