aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_leaf.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-03-17 01:26:52 -0500
committerNathan Scott <nathans@sgi.com>2006-03-17 01:26:52 -0500
commit70e73f59755867383edf563d5a5cbea614c0fd49 (patch)
tree6850f22b47754078b1695aad1ade7bf9705dc52a /fs/xfs/xfs_dir2_leaf.c
parent9cea236492ebabb9545564eb039aa0f477a05c96 (diff)
[XFS] endianess annotations for xfs_dir2_data_hdr structure.
SGI-PV: 943272 SGI-Modid: xfs-linux-melb:xfs-kern:25484a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_leaf.c')
-rw-r--r--fs/xfs/xfs_dir2_leaf.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index e4e07c8f7a76..8d7f154d1900 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -133,7 +133,7 @@ xfs_dir2_block_to_leaf(
133 /* 133 /*
134 * Fix up the block header, make it a data block. 134 * Fix up the block header, make it a data block.
135 */ 135 */
136 INT_SET(block->hdr.magic, ARCH_CONVERT, XFS_DIR2_DATA_MAGIC); 136 block->hdr.magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC);
137 if (needscan) 137 if (needscan)
138 xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)block, &needlog, 138 xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)block, &needlog,
139 NULL); 139 NULL);
@@ -143,7 +143,7 @@ xfs_dir2_block_to_leaf(
143 ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf); 143 ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
144 INT_SET(ltp->bestcount, ARCH_CONVERT, 1); 144 INT_SET(ltp->bestcount, ARCH_CONVERT, 1);
145 bestsp = XFS_DIR2_LEAF_BESTS_P(ltp); 145 bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
146 INT_COPY(bestsp[0], block->hdr.bestfree[0].length, ARCH_CONVERT); 146 bestsp[0] = block->hdr.bestfree[0].length;
147 /* 147 /*
148 * Log the data header and leaf bests table. 148 * Log the data header and leaf bests table.
149 */ 149 */
@@ -372,7 +372,7 @@ xfs_dir2_leaf_addname(
372 else 372 else
373 xfs_dir2_leaf_log_bests(tp, lbp, use_block, use_block); 373 xfs_dir2_leaf_log_bests(tp, lbp, use_block, use_block);
374 data = dbp->data; 374 data = dbp->data;
375 INT_COPY(bestsp[use_block], data->hdr.bestfree[0].length, ARCH_CONVERT); 375 bestsp[use_block] = data->hdr.bestfree[0].length;
376 grown = 1; 376 grown = 1;
377 } 377 }
378 /* 378 /*
@@ -394,7 +394,7 @@ xfs_dir2_leaf_addname(
394 * Point to the biggest freespace in our data block. 394 * Point to the biggest freespace in our data block.
395 */ 395 */
396 dup = (xfs_dir2_data_unused_t *) 396 dup = (xfs_dir2_data_unused_t *)
397 ((char *)data + INT_GET(data->hdr.bestfree[0].offset, ARCH_CONVERT)); 397 ((char *)data + be16_to_cpu(data->hdr.bestfree[0].offset));
398 ASSERT(INT_GET(dup->length, ARCH_CONVERT) >= length); 398 ASSERT(INT_GET(dup->length, ARCH_CONVERT) >= length);
399 needscan = needlog = 0; 399 needscan = needlog = 0;
400 /* 400 /*
@@ -427,8 +427,8 @@ xfs_dir2_leaf_addname(
427 * If the bests table needs to be changed, do it. 427 * If the bests table needs to be changed, do it.
428 * Log the change unless we've already done that. 428 * Log the change unless we've already done that.
429 */ 429 */
430 if (INT_GET(bestsp[use_block], ARCH_CONVERT) != INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT)) { 430 if (INT_GET(bestsp[use_block], ARCH_CONVERT) != be16_to_cpu(data->hdr.bestfree[0].length)) {
431 INT_COPY(bestsp[use_block], data->hdr.bestfree[0].length, ARCH_CONVERT); 431 bestsp[use_block] = data->hdr.bestfree[0].length;
432 if (!grown) 432 if (!grown)
433 xfs_dir2_leaf_log_bests(tp, lbp, use_block, use_block); 433 xfs_dir2_leaf_log_bests(tp, lbp, use_block, use_block);
434 } 434 }
@@ -1477,7 +1477,7 @@ xfs_dir2_leaf_removename(
1477 dep = (xfs_dir2_data_entry_t *) 1477 dep = (xfs_dir2_data_entry_t *)
1478 ((char *)data + XFS_DIR2_DATAPTR_TO_OFF(mp, INT_GET(lep->address, ARCH_CONVERT))); 1478 ((char *)data + XFS_DIR2_DATAPTR_TO_OFF(mp, INT_GET(lep->address, ARCH_CONVERT)));
1479 needscan = needlog = 0; 1479 needscan = needlog = 0;
1480 oldbest = INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT); 1480 oldbest = be16_to_cpu(data->hdr.bestfree[0].length);
1481 ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf); 1481 ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
1482 bestsp = XFS_DIR2_LEAF_BESTS_P(ltp); 1482 bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
1483 ASSERT(INT_GET(bestsp[db], ARCH_CONVERT) == oldbest); 1483 ASSERT(INT_GET(bestsp[db], ARCH_CONVERT) == oldbest);
@@ -1506,15 +1506,15 @@ xfs_dir2_leaf_removename(
1506 * If the longest freespace in the data block has changed, 1506 * If the longest freespace in the data block has changed,
1507 * put the new value in the bests table and log that. 1507 * put the new value in the bests table and log that.
1508 */ 1508 */
1509 if (INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT) != oldbest) { 1509 if (be16_to_cpu(data->hdr.bestfree[0].length) != oldbest) {
1510 INT_COPY(bestsp[db], data->hdr.bestfree[0].length, ARCH_CONVERT); 1510 bestsp[db] = data->hdr.bestfree[0].length;
1511 xfs_dir2_leaf_log_bests(tp, lbp, db, db); 1511 xfs_dir2_leaf_log_bests(tp, lbp, db, db);
1512 } 1512 }
1513 xfs_dir2_data_check(dp, dbp); 1513 xfs_dir2_data_check(dp, dbp);
1514 /* 1514 /*
1515 * If the data block is now empty then get rid of the data block. 1515 * If the data block is now empty then get rid of the data block.
1516 */ 1516 */
1517 if (INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT) == 1517 if (be16_to_cpu(data->hdr.bestfree[0].length) ==
1518 mp->m_dirblksize - (uint)sizeof(data->hdr)) { 1518 mp->m_dirblksize - (uint)sizeof(data->hdr)) {
1519 ASSERT(db != mp->m_dirdatablk); 1519 ASSERT(db != mp->m_dirdatablk);
1520 if ((error = xfs_dir2_shrink_inode(args, db, dbp))) { 1520 if ((error = xfs_dir2_shrink_inode(args, db, dbp))) {
@@ -1708,7 +1708,7 @@ xfs_dir2_leaf_trim_data(
1708 } 1708 }
1709#ifdef DEBUG 1709#ifdef DEBUG
1710 data = dbp->data; 1710 data = dbp->data;
1711 ASSERT(INT_GET(data->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC); 1711 ASSERT(be32_to_cpu(data->hdr.magic) == XFS_DIR2_DATA_MAGIC);
1712#endif 1712#endif
1713 /* this seems to be an error 1713 /* this seems to be an error
1714 * data is only valid if DEBUG is defined? 1714 * data is only valid if DEBUG is defined?
@@ -1717,7 +1717,7 @@ xfs_dir2_leaf_trim_data(
1717 1717
1718 leaf = lbp->data; 1718 leaf = lbp->data;
1719 ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf); 1719 ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
1720 ASSERT(INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT) == 1720 ASSERT(be16_to_cpu(data->hdr.bestfree[0].length) ==
1721 mp->m_dirblksize - (uint)sizeof(data->hdr)); 1721 mp->m_dirblksize - (uint)sizeof(data->hdr));
1722 ASSERT(db == INT_GET(ltp->bestcount, ARCH_CONVERT) - 1); 1722 ASSERT(db == INT_GET(ltp->bestcount, ARCH_CONVERT) - 1);
1723 /* 1723 /*