aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ialloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_ialloc.c')
-rw-r--r--fs/xfs/xfs_ialloc.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index 84ebeec1664..9f24ec28283 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -202,8 +202,7 @@ xfs_ialloc_inode_init(
202 fbuf = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, 202 fbuf = xfs_trans_get_buf(tp, mp->m_ddev_targp, d,
203 mp->m_bsize * blks_per_cluster, 203 mp->m_bsize * blks_per_cluster,
204 XBF_LOCK); 204 XBF_LOCK);
205 ASSERT(fbuf); 205 ASSERT(!xfs_buf_geterror(fbuf));
206 ASSERT(!XFS_BUF_GETERROR(fbuf));
207 206
208 /* 207 /*
209 * Initialize all inodes in this buffer and then log them. 208 * Initialize all inodes in this buffer and then log them.
@@ -683,7 +682,7 @@ xfs_dialloc(
683 return 0; 682 return 0;
684 } 683 }
685 agi = XFS_BUF_TO_AGI(agbp); 684 agi = XFS_BUF_TO_AGI(agbp);
686 ASSERT(be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC); 685 ASSERT(agi->agi_magicnum == cpu_to_be32(XFS_AGI_MAGIC));
687 } else { 686 } else {
688 /* 687 /*
689 * Continue where we left off before. In this case, we 688 * Continue where we left off before. In this case, we
@@ -691,7 +690,7 @@ xfs_dialloc(
691 */ 690 */
692 agbp = *IO_agbp; 691 agbp = *IO_agbp;
693 agi = XFS_BUF_TO_AGI(agbp); 692 agi = XFS_BUF_TO_AGI(agbp);
694 ASSERT(be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC); 693 ASSERT(agi->agi_magicnum == cpu_to_be32(XFS_AGI_MAGIC));
695 ASSERT(be32_to_cpu(agi->agi_freecount) > 0); 694 ASSERT(be32_to_cpu(agi->agi_freecount) > 0);
696 } 695 }
697 mp = tp->t_mountp; 696 mp = tp->t_mountp;
@@ -775,7 +774,7 @@ nextag:
775 if (error) 774 if (error)
776 goto nextag; 775 goto nextag;
777 agi = XFS_BUF_TO_AGI(agbp); 776 agi = XFS_BUF_TO_AGI(agbp);
778 ASSERT(be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC); 777 ASSERT(agi->agi_magicnum == cpu_to_be32(XFS_AGI_MAGIC));
779 } 778 }
780 /* 779 /*
781 * Here with an allocation group that has a free inode. 780 * Here with an allocation group that has a free inode.
@@ -944,7 +943,7 @@ nextag:
944 * See if the most recently allocated block has any free. 943 * See if the most recently allocated block has any free.
945 */ 944 */
946newino: 945newino:
947 if (be32_to_cpu(agi->agi_newino) != NULLAGINO) { 946 if (agi->agi_newino != cpu_to_be32(NULLAGINO)) {
948 error = xfs_inobt_lookup(cur, be32_to_cpu(agi->agi_newino), 947 error = xfs_inobt_lookup(cur, be32_to_cpu(agi->agi_newino),
949 XFS_LOOKUP_EQ, &i); 948 XFS_LOOKUP_EQ, &i);
950 if (error) 949 if (error)
@@ -1085,7 +1084,7 @@ xfs_difree(
1085 return error; 1084 return error;
1086 } 1085 }
1087 agi = XFS_BUF_TO_AGI(agbp); 1086 agi = XFS_BUF_TO_AGI(agbp);
1088 ASSERT(be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC); 1087 ASSERT(agi->agi_magicnum == cpu_to_be32(XFS_AGI_MAGIC));
1089 ASSERT(agbno < be32_to_cpu(agi->agi_length)); 1088 ASSERT(agbno < be32_to_cpu(agi->agi_length));
1090 /* 1089 /*
1091 * Initialize the cursor. 1090 * Initialize the cursor.
@@ -1438,7 +1437,7 @@ xfs_ialloc_log_agi(
1438 xfs_agi_t *agi; /* allocation group header */ 1437 xfs_agi_t *agi; /* allocation group header */
1439 1438
1440 agi = XFS_BUF_TO_AGI(bp); 1439 agi = XFS_BUF_TO_AGI(bp);
1441 ASSERT(be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC); 1440 ASSERT(agi->agi_magicnum == cpu_to_be32(XFS_AGI_MAGIC));
1442#endif 1441#endif
1443 /* 1442 /*
1444 * Compute byte offsets for the first and last fields. 1443 * Compute byte offsets for the first and last fields.
@@ -1486,13 +1485,13 @@ xfs_read_agi(
1486 if (error) 1485 if (error)
1487 return error; 1486 return error;
1488 1487
1489 ASSERT(*bpp && !XFS_BUF_GETERROR(*bpp)); 1488 ASSERT(!xfs_buf_geterror(*bpp));
1490 agi = XFS_BUF_TO_AGI(*bpp); 1489 agi = XFS_BUF_TO_AGI(*bpp);
1491 1490
1492 /* 1491 /*
1493 * Validate the magic number of the agi block. 1492 * Validate the magic number of the agi block.
1494 */ 1493 */
1495 agi_ok = be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC && 1494 agi_ok = agi->agi_magicnum == cpu_to_be32(XFS_AGI_MAGIC) &&
1496 XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum)) && 1495 XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum)) &&
1497 be32_to_cpu(agi->agi_seqno) == agno; 1496 be32_to_cpu(agi->agi_seqno) == agno;
1498 if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IALLOC_READ_AGI, 1497 if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IALLOC_READ_AGI,