aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_recover.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@sgi.com>2005-11-01 23:11:25 -0500
committerNathan Scott <nathans@sgi.com>2005-11-01 23:11:25 -0500
commit16259e7d952e26e949cc2c8c68b74f34b293935d (patch)
treea016791ecb67761236d32b9915efa9a92f6f3767 /fs/xfs/xfs_log_recover.c
parente2ed81fbbb7c76e0a1b3e2f1b5a7414f4d66a559 (diff)
[XFS] Endianess annotations for various allocator data structures
SGI-PV: 943272 SGI-Modid: xfs-linux:xfs-kern:201006a Signed-off-by: Christoph Hellwig <hch@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r--fs/xfs/xfs_log_recover.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 63268984762a..8ab7df768063 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -3160,13 +3160,12 @@ xlog_recover_clear_agi_bucket(
3160 } 3160 }
3161 3161
3162 agi = XFS_BUF_TO_AGI(agibp); 3162 agi = XFS_BUF_TO_AGI(agibp);
3163 if (INT_GET(agi->agi_magicnum, ARCH_CONVERT) != XFS_AGI_MAGIC) { 3163 if (be32_to_cpu(agi->agi_magicnum) != XFS_AGI_MAGIC) {
3164 xfs_trans_cancel(tp, XFS_TRANS_ABORT); 3164 xfs_trans_cancel(tp, XFS_TRANS_ABORT);
3165 return; 3165 return;
3166 } 3166 }
3167 ASSERT(INT_GET(agi->agi_magicnum, ARCH_CONVERT) == XFS_AGI_MAGIC);
3168 3167
3169 INT_SET(agi->agi_unlinked[bucket], ARCH_CONVERT, NULLAGINO); 3168 agi->agi_unlinked[bucket] = cpu_to_be32(NULLAGINO);
3170 offset = offsetof(xfs_agi_t, agi_unlinked) + 3169 offset = offsetof(xfs_agi_t, agi_unlinked) +
3171 (sizeof(xfs_agino_t) * bucket); 3170 (sizeof(xfs_agino_t) * bucket);
3172 xfs_trans_log_buf(tp, agibp, offset, 3171 xfs_trans_log_buf(tp, agibp, offset,
@@ -3225,12 +3224,11 @@ xlog_recover_process_iunlinks(
3225 XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp))); 3224 XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)));
3226 } 3225 }
3227 agi = XFS_BUF_TO_AGI(agibp); 3226 agi = XFS_BUF_TO_AGI(agibp);
3228 ASSERT(XFS_AGI_MAGIC == 3227 ASSERT(XFS_AGI_MAGIC == be32_to_cpu(agi->agi_magicnum));
3229 INT_GET(agi->agi_magicnum, ARCH_CONVERT));
3230 3228
3231 for (bucket = 0; bucket < XFS_AGI_UNLINKED_BUCKETS; bucket++) { 3229 for (bucket = 0; bucket < XFS_AGI_UNLINKED_BUCKETS; bucket++) {
3232 3230
3233 agino = INT_GET(agi->agi_unlinked[bucket], ARCH_CONVERT); 3231 agino = be32_to_cpu(agi->agi_unlinked[bucket]);
3234 while (agino != NULLAGINO) { 3232 while (agino != NULLAGINO) {
3235 3233
3236 /* 3234 /*
@@ -3318,8 +3316,8 @@ xlog_recover_process_iunlinks(
3318 XFS_AGI_DADDR(mp))); 3316 XFS_AGI_DADDR(mp)));
3319 } 3317 }
3320 agi = XFS_BUF_TO_AGI(agibp); 3318 agi = XFS_BUF_TO_AGI(agibp);
3321 ASSERT(XFS_AGI_MAGIC == INT_GET( 3319 ASSERT(XFS_AGI_MAGIC == be32_to_cpu(
3322 agi->agi_magicnum, ARCH_CONVERT)); 3320 agi->agi_magicnum));
3323 } 3321 }
3324 } 3322 }
3325 3323
@@ -4022,14 +4020,12 @@ xlog_recover_check_summary(
4022 mp, agfbp, agfdaddr); 4020 mp, agfbp, agfdaddr);
4023 } 4021 }
4024 agfp = XFS_BUF_TO_AGF(agfbp); 4022 agfp = XFS_BUF_TO_AGF(agfbp);
4025 ASSERT(XFS_AGF_MAGIC == 4023 ASSERT(XFS_AGF_MAGIC == be32_to_cpu(agfp->agf_magicnum));
4026 INT_GET(agfp->agf_magicnum, ARCH_CONVERT)); 4024 ASSERT(XFS_AGF_GOOD_VERSION(be32_to_cpu(agfp->agf_versionnum)));
4027 ASSERT(XFS_AGF_GOOD_VERSION( 4025 ASSERT(be32_to_cpu(agfp->agf_seqno) == agno);
4028 INT_GET(agfp->agf_versionnum, ARCH_CONVERT))); 4026
4029 ASSERT(INT_GET(agfp->agf_seqno, ARCH_CONVERT) == agno); 4027 freeblks += be32_to_cpu(agfp->agf_freeblks) +
4030 4028 be32_to_cpu(agfp->agf_flcount);
4031 freeblks += INT_GET(agfp->agf_freeblks, ARCH_CONVERT) +
4032 INT_GET(agfp->agf_flcount, ARCH_CONVERT);
4033 xfs_buf_relse(agfbp); 4029 xfs_buf_relse(agfbp);
4034 4030
4035 agidaddr = XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)); 4031 agidaddr = XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp));
@@ -4040,14 +4036,12 @@ xlog_recover_check_summary(
4040 mp, agibp, agidaddr); 4036 mp, agibp, agidaddr);
4041 } 4037 }
4042 agip = XFS_BUF_TO_AGI(agibp); 4038 agip = XFS_BUF_TO_AGI(agibp);
4043 ASSERT(XFS_AGI_MAGIC == 4039 ASSERT(XFS_AGI_MAGIC == be32_to_cpu(agip->agi_magicnum));
4044 INT_GET(agip->agi_magicnum, ARCH_CONVERT)); 4040 ASSERT(XFS_AGI_GOOD_VERSION(be32_to_cpu(agip->agi_versionnum)));
4045 ASSERT(XFS_AGI_GOOD_VERSION( 4041 ASSERT(be32_to_cpu(agip->agi_seqno) == agno);
4046 INT_GET(agip->agi_versionnum, ARCH_CONVERT))); 4042
4047 ASSERT(INT_GET(agip->agi_seqno, ARCH_CONVERT) == agno); 4043 itotal += be32_to_cpu(agip->agi_count);
4048 4044 ifree += be32_to_cpu(agip->agi_freecount);
4049 itotal += INT_GET(agip->agi_count, ARCH_CONVERT);
4050 ifree += INT_GET(agip->agi_freecount, ARCH_CONVERT);
4051 xfs_buf_relse(agibp); 4045 xfs_buf_relse(agibp);
4052 } 4046 }
4053 4047