summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_rtbitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs/xfs_rtbitmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_rtbitmap.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
index be5c793da46c..b74261abd238 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -466,6 +466,23 @@ xfs_rtfind_forw(
return 0;
}
+inline xfs_suminfo_t
+xfs_suminfo_get(
+ struct xfs_mount *mp,
+ union xfs_suminfo_ondisk *infoptr)
+{
+ return infoptr->raw;
+}
+
+inline void
+xfs_suminfo_add(
+ struct xfs_mount *mp,
+ union xfs_suminfo_ondisk *infoptr,
+ int delta)
+{
+ infoptr->raw += delta;
+}
+
/*
* Read and/or modify the summary information for a given extent size,
* bitmap block combination.
@@ -490,7 +507,7 @@ xfs_rtmodify_summary_int(
int error; /* error value */
xfs_fileoff_t sb; /* summary fsblock */
xfs_rtsumoff_t so; /* index into the summary file */
- xfs_suminfo_t *sp; /* pointer to returned data */
+ union xfs_suminfo_ondisk *sp; /* pointer to returned data */
unsigned int infoword;
/*
@@ -533,17 +550,17 @@ xfs_rtmodify_summary_int(
if (delta) {
uint first = (uint)((char *)sp - (char *)bp->b_addr);
- *sp += delta;
+ xfs_suminfo_add(mp, sp, delta);
if (mp->m_rsum_cache) {
- if (*sp == 0 && log == mp->m_rsum_cache[bbno])
+ if (sp->raw == 0 && log == mp->m_rsum_cache[bbno])
mp->m_rsum_cache[bbno]++;
- if (*sp != 0 && log < mp->m_rsum_cache[bbno])
+ if (sp->raw != 0 && log < mp->m_rsum_cache[bbno])
mp->m_rsum_cache[bbno] = log;
}
xfs_trans_log_buf(tp, bp, first, first + sizeof(*sp) - 1);
}
if (sum)
- *sum = *sp;
+ *sum = xfs_suminfo_get(mp, sp);
return 0;
}