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.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index 9abecd207c4e..cbd371d9e98d 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -395,7 +395,7 @@ xfs_dir2_leaf_addname(
395 */ 395 */
396 dup = (xfs_dir2_data_unused_t *) 396 dup = (xfs_dir2_data_unused_t *)
397 ((char *)data + be16_to_cpu(data->hdr.bestfree[0].offset)); 397 ((char *)data + be16_to_cpu(data->hdr.bestfree[0].offset));
398 ASSERT(INT_GET(dup->length, ARCH_CONVERT) >= length); 398 ASSERT(be16_to_cpu(dup->length) >= length);
399 needscan = needlog = 0; 399 needscan = needlog = 0;
400 /* 400 /*
401 * Mark the initial part of our freespace in use for the new entry. 401 * Mark the initial part of our freespace in use for the new entry.
@@ -1047,11 +1047,10 @@ xfs_dir2_leaf_getdents(
1047 while ((char *)ptr - (char *)data < byteoff) { 1047 while ((char *)ptr - (char *)data < byteoff) {
1048 dup = (xfs_dir2_data_unused_t *)ptr; 1048 dup = (xfs_dir2_data_unused_t *)ptr;
1049 1049
1050 if (INT_GET(dup->freetag, ARCH_CONVERT) 1050 if (be16_to_cpu(dup->freetag)
1051 == XFS_DIR2_DATA_FREE_TAG) { 1051 == XFS_DIR2_DATA_FREE_TAG) {
1052 1052
1053 length = INT_GET(dup->length, 1053 length = be16_to_cpu(dup->length);
1054 ARCH_CONVERT);
1055 ptr += length; 1054 ptr += length;
1056 continue; 1055 continue;
1057 } 1056 }
@@ -1080,9 +1079,8 @@ xfs_dir2_leaf_getdents(
1080 /* 1079 /*
1081 * No, it's unused, skip over it. 1080 * No, it's unused, skip over it.
1082 */ 1081 */
1083 if (INT_GET(dup->freetag, ARCH_CONVERT) 1082 if (be16_to_cpu(dup->freetag) == XFS_DIR2_DATA_FREE_TAG) {
1084 == XFS_DIR2_DATA_FREE_TAG) { 1083 length = be16_to_cpu(dup->length);
1085 length = INT_GET(dup->length, ARCH_CONVERT);
1086 ptr += length; 1084 ptr += length;
1087 curoff += length; 1085 curoff += length;
1088 continue; 1086 continue;