diff options
| author | Darrick J. Wong <[email protected]> | 2024-11-04 04:19:24 +0000 |
|---|---|---|
| committer | Darrick J. Wong <[email protected]> | 2024-11-05 21:38:41 +0000 |
| commit | a2c28367396a85f2d9cfb22acfcedcff08dd1c3c (patch) | |
| tree | b20a0bf81cf9b73dc83afe66c6edb7593191b2ec /fs/xfs/libxfs/xfs_rtbitmap.h | |
| parent | xfs: encode the rtbitmap in big endian format (diff) | |
| download | kernel-a2c28367396a85f2d9cfb22acfcedcff08dd1c3c.tar.gz kernel-a2c28367396a85f2d9cfb22acfcedcff08dd1c3c.zip | |
xfs: encode the rtsummary in big endian format
Currently, the ondisk realtime summary file counters are accessed in
units of 32-bit words. There's no endian translation of the contents of
this file, which means that the Bad Things Happen(tm) if you go from
(say) x86 to powerpc. Since we have a new feature flag, let's take the
opportunity to enforce an endianness on the file. Encode the summary
information in big endian format, like most of the rest of the
filesystem.
Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'fs/xfs/libxfs/xfs_rtbitmap.h')
| -rw-r--r-- | fs/xfs/libxfs/xfs_rtbitmap.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.h b/fs/xfs/libxfs/xfs_rtbitmap.h index f9c0d2415901..7be76490a318 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.h +++ b/fs/xfs/libxfs/xfs_rtbitmap.h @@ -300,6 +300,8 @@ xfs_suminfo_get( { union xfs_suminfo_raw *info = xfs_rsumblock_infoptr(args, index); + if (xfs_has_rtgroups(args->mp)) + return be32_to_cpu(info->rtg); return info->old; } @@ -312,6 +314,11 @@ xfs_suminfo_add( { union xfs_suminfo_raw *info = xfs_rsumblock_infoptr(args, index); + if (xfs_has_rtgroups(args->mp)) { + be32_add_cpu(&info->rtg, delta); + return be32_to_cpu(info->rtg); + } + info->old += delta; return info->old; } |
