aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_leaf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dir2_leaf.c')
-rw-r--r--fs/xfs/xfs_dir2_leaf.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index bd425925ee24..568e0feca034 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -66,7 +66,7 @@ xfs_dir2_block_to_leaf(
66 xfs_da_args_t *args, /* operation arguments */ 66 xfs_da_args_t *args, /* operation arguments */
67 xfs_dabuf_t *dbp) /* input block's buffer */ 67 xfs_dabuf_t *dbp) /* input block's buffer */
68{ 68{
69 xfs_dir2_data_off_t *bestsp; /* leaf's bestsp entries */ 69 __be16 *bestsp; /* leaf's bestsp entries */
70 xfs_dablk_t blkno; /* leaf block's bno */ 70 xfs_dablk_t blkno; /* leaf block's bno */
71 xfs_dir2_block_t *block; /* block structure */ 71 xfs_dir2_block_t *block; /* block structure */
72 xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */ 72 xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */
@@ -163,7 +163,7 @@ int /* error */
163xfs_dir2_leaf_addname( 163xfs_dir2_leaf_addname(
164 xfs_da_args_t *args) /* operation arguments */ 164 xfs_da_args_t *args) /* operation arguments */
165{ 165{
166 xfs_dir2_data_off_t *bestsp; /* freespace table in leaf */ 166 __be16 *bestsp; /* freespace table in leaf */
167 int compact; /* need to compact leaves */ 167 int compact; /* need to compact leaves */
168 xfs_dir2_data_t *data; /* data block structure */ 168 xfs_dir2_data_t *data; /* data block structure */
169 xfs_dabuf_t *dbp; /* data block buffer */ 169 xfs_dabuf_t *dbp; /* data block buffer */
@@ -228,8 +228,8 @@ xfs_dir2_leaf_addname(
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 < INT_GET(ltp->bestcount, ARCH_CONVERT));
231 ASSERT(INT_GET(bestsp[i], ARCH_CONVERT) != NULLDATAOFF); 231 ASSERT(be16_to_cpu(bestsp[i]) != NULLDATAOFF);
232 if (INT_GET(bestsp[i], ARCH_CONVERT) >= length) { 232 if (be16_to_cpu(bestsp[i]) >= length) {
233 use_block = i; 233 use_block = i;
234 break; 234 break;
235 } 235 }
@@ -242,9 +242,9 @@ xfs_dir2_leaf_addname(
242 /* 242 /*
243 * Remember a block we see that's missing. 243 * Remember a block we see that's missing.
244 */ 244 */
245 if (INT_GET(bestsp[i], ARCH_CONVERT) == NULLDATAOFF && use_block == -1) 245 if (be16_to_cpu(bestsp[i]) == NULLDATAOFF && use_block == -1)
246 use_block = i; 246 use_block = i;
247 else if (INT_GET(bestsp[i], ARCH_CONVERT) >= length) { 247 else if (be16_to_cpu(bestsp[i]) >= length) {
248 use_block = i; 248 use_block = i;
249 break; 249 break;
250 } 250 }
@@ -260,7 +260,7 @@ xfs_dir2_leaf_addname(
260 * Now kill use_block if it refers to a missing block, so we 260 * Now kill use_block if it refers to a missing block, so we
261 * can use it as an indication of allocation needed. 261 * can use it as an indication of allocation needed.
262 */ 262 */
263 if (use_block != -1 && INT_GET(bestsp[use_block], ARCH_CONVERT) == NULLDATAOFF) 263 if (use_block != -1 && be16_to_cpu(bestsp[use_block]) == NULLDATAOFF)
264 use_block = -1; 264 use_block = -1;
265 /* 265 /*
266 * If we don't have enough free bytes but we can make enough 266 * If we don't have enough free bytes but we can make enough
@@ -427,7 +427,7 @@ 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) != be16_to_cpu(data->hdr.bestfree[0].length)) { 430 if (be16_to_cpu(bestsp[use_block]) != be16_to_cpu(data->hdr.bestfree[0].length)) {
431 bestsp[use_block] = data->hdr.bestfree[0].length; 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);
@@ -1203,8 +1203,8 @@ xfs_dir2_leaf_log_bests(
1203 int first, /* first entry to log */ 1203 int first, /* first entry to log */
1204 int last) /* last entry to log */ 1204 int last) /* last entry to log */
1205{ 1205{
1206 xfs_dir2_data_off_t *firstb; /* pointer to first entry */ 1206 __be16 *firstb; /* pointer to first entry */
1207 xfs_dir2_data_off_t *lastb; /* pointer to last entry */ 1207 __be16 *lastb; /* pointer to last entry */
1208 xfs_dir2_leaf_t *leaf; /* leaf structure */ 1208 xfs_dir2_leaf_t *leaf; /* leaf structure */
1209 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ 1209 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
1210 1210
@@ -1437,7 +1437,7 @@ int /* error */
1437xfs_dir2_leaf_removename( 1437xfs_dir2_leaf_removename(
1438 xfs_da_args_t *args) /* operation arguments */ 1438 xfs_da_args_t *args) /* operation arguments */
1439{ 1439{
1440 xfs_dir2_data_off_t *bestsp; /* leaf block best freespace */ 1440 __be16 *bestsp; /* leaf block best freespace */
1441 xfs_dir2_data_t *data; /* data block structure */ 1441 xfs_dir2_data_t *data; /* data block structure */
1442 xfs_dir2_db_t db; /* data block number */ 1442 xfs_dir2_db_t db; /* data block number */
1443 xfs_dabuf_t *dbp; /* data block buffer */ 1443 xfs_dabuf_t *dbp; /* data block buffer */
@@ -1480,7 +1480,7 @@ xfs_dir2_leaf_removename(
1480 oldbest = be16_to_cpu(data->hdr.bestfree[0].length); 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(be16_to_cpu(bestsp[db]) == oldbest);
1484 /* 1484 /*
1485 * Mark the former data entry unused. 1485 * Mark the former data entry unused.
1486 */ 1486 */
@@ -1542,7 +1542,7 @@ xfs_dir2_leaf_removename(
1542 * Look for the last active entry (i). 1542 * Look for the last active entry (i).
1543 */ 1543 */
1544 for (i = db - 1; i > 0; i--) { 1544 for (i = db - 1; i > 0; i--) {
1545 if (INT_GET(bestsp[i], ARCH_CONVERT) != NULLDATAOFF) 1545 if (be16_to_cpu(bestsp[i]) != NULLDATAOFF)
1546 break; 1546 break;
1547 } 1547 }
1548 /* 1548 /*
@@ -1555,7 +1555,7 @@ xfs_dir2_leaf_removename(
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, INT_GET(ltp->bestcount, ARCH_CONVERT) - 1);
1557 } else 1557 } else
1558 INT_SET(bestsp[db], ARCH_CONVERT, NULLDATAOFF); 1558 bestsp[db] = cpu_to_be16(NULLDATAOFF);
1559 } 1559 }
1560 /* 1560 /*
1561 * If the data block was not the first one, drop it. 1561 * If the data block was not the first one, drop it.
@@ -1684,7 +1684,7 @@ xfs_dir2_leaf_trim_data(
1684 xfs_dabuf_t *lbp, /* leaf buffer */ 1684 xfs_dabuf_t *lbp, /* leaf buffer */
1685 xfs_dir2_db_t db) /* data block number */ 1685 xfs_dir2_db_t db) /* data block number */
1686{ 1686{
1687 xfs_dir2_data_off_t *bestsp; /* leaf bests table */ 1687 __be16 *bestsp; /* leaf bests table */
1688#ifdef DEBUG 1688#ifdef DEBUG
1689 xfs_dir2_data_t *data; /* data block structure */ 1689 xfs_dir2_data_t *data; /* data block structure */
1690#endif 1690#endif