@@ -748,10 +748,12 @@ union xfs_rtword_ondisk {
/*
* Realtime summary counts are accessed by the word, which is currently
- * stored in host-endian format.
+ * stored in host-endian format. Starting with the realtime groups feature,
+ * the words are stored in be32 ondisk.
*/
union xfs_suminfo_ondisk {
__u32 raw;
+ __be32 rtg;
};
/*
@@ -558,6 +558,9 @@ xfs_suminfo_get(
struct xfs_mount *mp,
union xfs_suminfo_ondisk *infoptr)
{
+ if (xfs_has_rtgroups(mp))
+ return be32_to_cpu(infoptr->rtg);
+
return infoptr->raw;
}
@@ -567,7 +570,10 @@ xfs_suminfo_add(
union xfs_suminfo_ondisk *infoptr,
int delta)
{
- infoptr->raw += delta;
+ if (xfs_has_rtgroups(mp))
+ be32_add_cpu(&infoptr->rtg, delta);
+ else
+ infoptr->raw += delta;
}
/*