diff options
Diffstat (limited to 'fs/xfs/xfs_dir.c')
-rw-r--r-- | fs/xfs/xfs_dir.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/xfs/xfs_dir.c b/fs/xfs/xfs_dir.c index bb87d2a700a9..7a708e993db6 100644 --- a/fs/xfs/xfs_dir.c +++ b/fs/xfs/xfs_dir.c | |||
@@ -634,7 +634,7 @@ xfs_dir_leaf_removename(xfs_da_args_t *args, int *count, int *totallen) | |||
634 | return(retval); | 634 | return(retval); |
635 | ASSERT(bp != NULL); | 635 | ASSERT(bp != NULL); |
636 | leaf = bp->data; | 636 | leaf = bp->data; |
637 | ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); | 637 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR_LEAF_MAGIC); |
638 | retval = xfs_dir_leaf_lookup_int(bp, args, &index); | 638 | retval = xfs_dir_leaf_lookup_int(bp, args, &index); |
639 | if (retval == EEXIST) { | 639 | if (retval == EEXIST) { |
640 | (void)xfs_dir_leaf_remove(args->trans, bp, index); | 640 | (void)xfs_dir_leaf_remove(args->trans, bp, index); |
@@ -912,7 +912,7 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio, | |||
912 | return(error); | 912 | return(error); |
913 | if (bp) | 913 | if (bp) |
914 | leaf = bp->data; | 914 | leaf = bp->data; |
915 | if (bp && INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) != XFS_DIR_LEAF_MAGIC) { | 915 | if (bp && be16_to_cpu(leaf->hdr.info.magic) != XFS_DIR_LEAF_MAGIC) { |
916 | xfs_dir_trace_g_dub("node: block not a leaf", | 916 | xfs_dir_trace_g_dub("node: block not a leaf", |
917 | dp, uio, bno); | 917 | dp, uio, bno); |
918 | xfs_da_brelse(trans, bp); | 918 | xfs_da_brelse(trans, bp); |
@@ -949,7 +949,7 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio, | |||
949 | if (bp == NULL) | 949 | if (bp == NULL) |
950 | return(XFS_ERROR(EFSCORRUPTED)); | 950 | return(XFS_ERROR(EFSCORRUPTED)); |
951 | node = bp->data; | 951 | node = bp->data; |
952 | if (INT_GET(node->hdr.info.magic, ARCH_CONVERT) != XFS_DA_NODE_MAGIC) | 952 | if (be16_to_cpu(node->hdr.info.magic) != XFS_DA_NODE_MAGIC) |
953 | break; | 953 | break; |
954 | btree = &node->btree[0]; | 954 | btree = &node->btree[0]; |
955 | xfs_dir_trace_g_dun("node: node detail", dp, uio, node); | 955 | xfs_dir_trace_g_dun("node: node detail", dp, uio, node); |
@@ -982,7 +982,7 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio, | |||
982 | */ | 982 | */ |
983 | for (;;) { | 983 | for (;;) { |
984 | leaf = bp->data; | 984 | leaf = bp->data; |
985 | if (unlikely(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) != XFS_DIR_LEAF_MAGIC)) { | 985 | if (unlikely(be16_to_cpu(leaf->hdr.info.magic) != XFS_DIR_LEAF_MAGIC)) { |
986 | xfs_dir_trace_g_dul("node: not a leaf", dp, uio, leaf); | 986 | xfs_dir_trace_g_dul("node: not a leaf", dp, uio, leaf); |
987 | xfs_da_brelse(trans, bp); | 987 | xfs_da_brelse(trans, bp); |
988 | XFS_CORRUPTION_ERROR("xfs_dir_node_getdents(1)", | 988 | XFS_CORRUPTION_ERROR("xfs_dir_node_getdents(1)", |
@@ -990,7 +990,7 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio, | |||
990 | return XFS_ERROR(EFSCORRUPTED); | 990 | return XFS_ERROR(EFSCORRUPTED); |
991 | } | 991 | } |
992 | xfs_dir_trace_g_dul("node: leaf detail", dp, uio, leaf); | 992 | xfs_dir_trace_g_dul("node: leaf detail", dp, uio, leaf); |
993 | if ((nextbno = INT_GET(leaf->hdr.info.forw, ARCH_CONVERT))) { | 993 | if ((nextbno = be32_to_cpu(leaf->hdr.info.forw))) { |
994 | nextda = xfs_da_reada_buf(trans, dp, nextbno, | 994 | nextda = xfs_da_reada_buf(trans, dp, nextbno, |
995 | XFS_DATA_FORK); | 995 | XFS_DATA_FORK); |
996 | } else | 996 | } else |
@@ -1125,8 +1125,7 @@ xfs_dir_trace_g_dun(char *where, xfs_inode_t *dp, uio_t *uio, | |||
1125 | (void *)((unsigned long)(uio->uio_offset >> 32)), | 1125 | (void *)((unsigned long)(uio->uio_offset >> 32)), |
1126 | (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)), | 1126 | (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)), |
1127 | (void *)(unsigned long)uio->uio_resid, | 1127 | (void *)(unsigned long)uio->uio_resid, |
1128 | (void *)(unsigned long) | 1128 | (void *)(unsigned long)be32_to_cpu(node->hdr.info.forw), |
1129 | INT_GET(node->hdr.info.forw, ARCH_CONVERT), | ||
1130 | (void *)(unsigned long) | 1129 | (void *)(unsigned long) |
1131 | INT_GET(node->hdr.count, ARCH_CONVERT), | 1130 | INT_GET(node->hdr.count, ARCH_CONVERT), |
1132 | (void *)(unsigned long) | 1131 | (void *)(unsigned long) |
@@ -1150,8 +1149,7 @@ xfs_dir_trace_g_dul(char *where, xfs_inode_t *dp, uio_t *uio, | |||
1150 | (void *)((unsigned long)(uio->uio_offset >> 32)), | 1149 | (void *)((unsigned long)(uio->uio_offset >> 32)), |
1151 | (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)), | 1150 | (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)), |
1152 | (void *)(unsigned long)uio->uio_resid, | 1151 | (void *)(unsigned long)uio->uio_resid, |
1153 | (void *)(unsigned long) | 1152 | (void *)(unsigned long)be32_to_cpu(leaf->hdr.info.forw), |
1154 | INT_GET(leaf->hdr.info.forw, ARCH_CONVERT), | ||
1155 | (void *)(unsigned long) | 1153 | (void *)(unsigned long) |
1156 | INT_GET(leaf->hdr.count, ARCH_CONVERT), | 1154 | INT_GET(leaf->hdr.count, ARCH_CONVERT), |
1157 | (void *)(unsigned long) | 1155 | (void *)(unsigned long) |