aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_leaf.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-03-17 01:27:28 -0500
committerNathan Scott <nathans@sgi.com>2006-03-17 01:27:28 -0500
commitafbcb3f91903bcd34d470efe64b3738257178667 (patch)
treee2dbfefdd7c711e8335079096c0f4f713a28630e /fs/xfs/xfs_dir2_leaf.c
parent68b3a1024a7cda4afaacb3d25e6ac234ddfc0834 (diff)
[XFS] endianess annotations for xfs_dir2_leaf_tail_t
SGI-PV: 943272 SGI-Modid: xfs-linux-melb:xfs-kern:25487a Signed-off-by: Christoph Hellwig <hch@lst.de> 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.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index 568e0feca034..9abecd207c4e 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -141,7 +141,7 @@ xfs_dir2_block_to_leaf(
141 * Set up leaf tail and bests table. 141 * Set up leaf tail and bests table.
142 */ 142 */
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 ltp->bestcount = cpu_to_be32(1);
145 bestsp = XFS_DIR2_LEAF_BESTS_P(ltp); 145 bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
146 bestsp[0] = block->hdr.bestfree[0].length; 146 bestsp[0] = block->hdr.bestfree[0].length;
147 /* 147 /*
@@ -227,7 +227,7 @@ xfs_dir2_leaf_addname(
227 if (INT_GET(lep->address, ARCH_CONVERT) == XFS_DIR2_NULL_DATAPTR) 227 if (INT_GET(lep->address, ARCH_CONVERT) == XFS_DIR2_NULL_DATAPTR)
228 continue; 228 continue;
229 i = XFS_DIR2_DATAPTR_TO_DB(mp, INT_GET(lep->address, ARCH_CONVERT)); 229 i = XFS_DIR2_DATAPTR_TO_DB(mp, INT_GET(lep->address, ARCH_CONVERT));
230 ASSERT(i < INT_GET(ltp->bestcount, ARCH_CONVERT)); 230 ASSERT(i < be32_to_cpu(ltp->bestcount));
231 ASSERT(be16_to_cpu(bestsp[i]) != NULLDATAOFF); 231 ASSERT(be16_to_cpu(bestsp[i]) != NULLDATAOFF);
232 if (be16_to_cpu(bestsp[i]) >= length) { 232 if (be16_to_cpu(bestsp[i]) >= length) {
233 use_block = i; 233 use_block = i;
@@ -238,7 +238,7 @@ xfs_dir2_leaf_addname(
238 * Didn't find a block yet, linear search all the data blocks. 238 * Didn't find a block yet, linear search all the data blocks.
239 */ 239 */
240 if (use_block == -1) { 240 if (use_block == -1) {
241 for (i = 0; i < INT_GET(ltp->bestcount, ARCH_CONVERT); i++) { 241 for (i = 0; i < be32_to_cpu(ltp->bestcount); i++) {
242 /* 242 /*
243 * Remember a block we see that's missing. 243 * Remember a block we see that's missing.
244 */ 244 */
@@ -358,13 +358,13 @@ xfs_dir2_leaf_addname(
358 * If we're adding a new data block on the end we need to 358 * If we're adding a new data block on the end we need to
359 * extend the bests table. Copy it up one entry. 359 * extend the bests table. Copy it up one entry.
360 */ 360 */
361 if (use_block >= INT_GET(ltp->bestcount, ARCH_CONVERT)) { 361 if (use_block >= be32_to_cpu(ltp->bestcount)) {
362 bestsp--; 362 bestsp--;
363 memmove(&bestsp[0], &bestsp[1], 363 memmove(&bestsp[0], &bestsp[1],
364 INT_GET(ltp->bestcount, ARCH_CONVERT) * sizeof(bestsp[0])); 364 be32_to_cpu(ltp->bestcount) * sizeof(bestsp[0]));
365 INT_MOD(ltp->bestcount, ARCH_CONVERT, +1); 365 be32_add(&ltp->bestcount, 1);
366 xfs_dir2_leaf_log_tail(tp, lbp); 366 xfs_dir2_leaf_log_tail(tp, lbp);
367 xfs_dir2_leaf_log_bests(tp, lbp, 0, INT_GET(ltp->bestcount, ARCH_CONVERT) - 1); 367 xfs_dir2_leaf_log_bests(tp, lbp, 0, be32_to_cpu(ltp->bestcount) - 1);
368 } 368 }
369 /* 369 /*
370 * If we're filling in a previously empty block just log it. 370 * If we're filling in a previously empty block just log it.
@@ -1537,7 +1537,7 @@ xfs_dir2_leaf_removename(
1537 * If this is the last data block then compact the 1537 * If this is the last data block then compact the
1538 * bests table by getting rid of entries. 1538 * bests table by getting rid of entries.
1539 */ 1539 */
1540 if (db == INT_GET(ltp->bestcount, ARCH_CONVERT) - 1) { 1540 if (db == be32_to_cpu(ltp->bestcount) - 1) {
1541 /* 1541 /*
1542 * Look for the last active entry (i). 1542 * Look for the last active entry (i).
1543 */ 1543 */
@@ -1550,10 +1550,10 @@ xfs_dir2_leaf_removename(
1550 * end are removed. 1550 * end are removed.
1551 */ 1551 */
1552 memmove(&bestsp[db - i], bestsp, 1552 memmove(&bestsp[db - i], bestsp,
1553 (INT_GET(ltp->bestcount, ARCH_CONVERT) - (db - i)) * sizeof(*bestsp)); 1553 (be32_to_cpu(ltp->bestcount) - (db - i)) * sizeof(*bestsp));
1554 INT_MOD(ltp->bestcount, ARCH_CONVERT, -(db - i)); 1554 be32_add(&ltp->bestcount, -(db - i));
1555 xfs_dir2_leaf_log_tail(tp, lbp); 1555 xfs_dir2_leaf_log_tail(tp, lbp);
1556 xfs_dir2_leaf_log_bests(tp, lbp, 0, INT_GET(ltp->bestcount, ARCH_CONVERT) - 1); 1556 xfs_dir2_leaf_log_bests(tp, lbp, 0, be32_to_cpu(ltp->bestcount) - 1);
1557 } else 1557 } else
1558 bestsp[db] = cpu_to_be16(NULLDATAOFF); 1558 bestsp[db] = cpu_to_be16(NULLDATAOFF);
1559 } 1559 }
@@ -1719,7 +1719,7 @@ xfs_dir2_leaf_trim_data(
1719 ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf); 1719 ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
1720 ASSERT(be16_to_cpu(data->hdr.bestfree[0].length) == 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 == be32_to_cpu(ltp->bestcount) - 1);
1723 /* 1723 /*
1724 * Get rid of the data block. 1724 * Get rid of the data block.
1725 */ 1725 */
@@ -1732,10 +1732,10 @@ xfs_dir2_leaf_trim_data(
1732 * Eliminate the last bests entry from the table. 1732 * Eliminate the last bests entry from the table.
1733 */ 1733 */
1734 bestsp = XFS_DIR2_LEAF_BESTS_P(ltp); 1734 bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
1735 INT_MOD(ltp->bestcount, ARCH_CONVERT, -1); 1735 be32_add(&ltp->bestcount, -1);
1736 memmove(&bestsp[1], &bestsp[0], INT_GET(ltp->bestcount, ARCH_CONVERT) * sizeof(*bestsp)); 1736 memmove(&bestsp[1], &bestsp[0], be32_to_cpu(ltp->bestcount) * sizeof(*bestsp));
1737 xfs_dir2_leaf_log_tail(tp, lbp); 1737 xfs_dir2_leaf_log_tail(tp, lbp);
1738 xfs_dir2_leaf_log_bests(tp, lbp, 0, INT_GET(ltp->bestcount, ARCH_CONVERT) - 1); 1738 xfs_dir2_leaf_log_bests(tp, lbp, 0, be32_to_cpu(ltp->bestcount) - 1);
1739 return 0; 1739 return 0;
1740} 1740}
1741 1741
@@ -1848,8 +1848,8 @@ xfs_dir2_node_to_leaf(
1848 * Set up the leaf bests table. 1848 * Set up the leaf bests table.
1849 */ 1849 */
1850 memcpy(XFS_DIR2_LEAF_BESTS_P(ltp), free->bests, 1850 memcpy(XFS_DIR2_LEAF_BESTS_P(ltp), free->bests,
1851 INT_GET(ltp->bestcount, ARCH_CONVERT) * sizeof(leaf->bests[0])); 1851 be32_to_cpu(ltp->bestcount) * sizeof(leaf->bests[0]));
1852 xfs_dir2_leaf_log_bests(tp, lbp, 0, INT_GET(ltp->bestcount, ARCH_CONVERT) - 1); 1852 xfs_dir2_leaf_log_bests(tp, lbp, 0, be32_to_cpu(ltp->bestcount) - 1);
1853 xfs_dir2_leaf_log_tail(tp, lbp); 1853 xfs_dir2_leaf_log_tail(tp, lbp);
1854 xfs_dir2_leaf_check(dp, lbp); 1854 xfs_dir2_leaf_check(dp, lbp);
1855 /* 1855 /*