aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_block.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dir2_block.c')
-rw-r--r--fs/xfs/xfs_dir2_block.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index 6f3b99dfe55c..1dd1a7694e4b 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -939,7 +939,7 @@ xfs_dir2_leaf_to_block(
939 * Size of the "leaf" area in the block. 939 * Size of the "leaf" area in the block.
940 */ 940 */
941 size = (uint)sizeof(block->tail) + 941 size = (uint)sizeof(block->tail) +
942 (uint)sizeof(*lep) * (INT_GET(leaf->hdr.count, ARCH_CONVERT) - INT_GET(leaf->hdr.stale, ARCH_CONVERT)); 942 (uint)sizeof(*lep) * (be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale));
943 /* 943 /*
944 * Look at the last data entry. 944 * Look at the last data entry.
945 */ 945 */
@@ -968,14 +968,14 @@ xfs_dir2_leaf_to_block(
968 * Initialize the block tail. 968 * Initialize the block tail.
969 */ 969 */
970 btp = XFS_DIR2_BLOCK_TAIL_P(mp, block); 970 btp = XFS_DIR2_BLOCK_TAIL_P(mp, block);
971 btp->count = cpu_to_be32(INT_GET(leaf->hdr.count, ARCH_CONVERT) - INT_GET(leaf->hdr.stale, ARCH_CONVERT)); 971 btp->count = cpu_to_be32(be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale));
972 btp->stale = 0; 972 btp->stale = 0;
973 xfs_dir2_block_log_tail(tp, dbp); 973 xfs_dir2_block_log_tail(tp, dbp);
974 /* 974 /*
975 * Initialize the block leaf area. We compact out stale entries. 975 * Initialize the block leaf area. We compact out stale entries.
976 */ 976 */
977 lep = XFS_DIR2_BLOCK_LEAF_P(btp); 977 lep = XFS_DIR2_BLOCK_LEAF_P(btp);
978 for (from = to = 0; from < INT_GET(leaf->hdr.count, ARCH_CONVERT); from++) { 978 for (from = to = 0; from < be16_to_cpu(leaf->hdr.count); from++) {
979 if (INT_GET(leaf->ents[from].address, ARCH_CONVERT) == XFS_DIR2_NULL_DATAPTR) 979 if (INT_GET(leaf->ents[from].address, ARCH_CONVERT) == XFS_DIR2_NULL_DATAPTR)
980 continue; 980 continue;
981 lep[to++] = leaf->ents[from]; 981 lep[to++] = leaf->ents[from];