Commit 403432dc authored by Nathan Scott's avatar Nathan Scott

[XFS] endianess annotations for xfs_da_node_entry_t

SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25504a
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent d7929ff6
...@@ -1829,9 +1829,8 @@ xfs_attr_node_list(xfs_attr_list_context_t *context) ...@@ -1829,9 +1829,8 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
i < INT_GET(node->hdr.count, ARCH_CONVERT); i < INT_GET(node->hdr.count, ARCH_CONVERT);
btree++, i++) { btree++, i++) {
if (cursor->hashval if (cursor->hashval
<= INT_GET(btree->hashval, <= be32_to_cpu(btree->hashval)) {
ARCH_CONVERT)) { cursor->blkno = be32_to_cpu(btree->before);
cursor->blkno = INT_GET(btree->before, ARCH_CONVERT);
xfs_attr_trace_l_cb("descending", xfs_attr_trace_l_cb("descending",
context, btree); context, btree);
break; break;
...@@ -2228,8 +2227,8 @@ xfs_attr_trace_l_cn(char *where, struct xfs_attr_list_context *context, ...@@ -2228,8 +2227,8 @@ xfs_attr_trace_l_cn(char *where, struct xfs_attr_list_context *context,
(__psunsigned_t)context->dupcnt, (__psunsigned_t)context->dupcnt,
(__psunsigned_t)context->flags, (__psunsigned_t)context->flags,
(__psunsigned_t)INT_GET(node->hdr.count, ARCH_CONVERT), (__psunsigned_t)INT_GET(node->hdr.count, ARCH_CONVERT),
(__psunsigned_t)INT_GET(node->btree[0].hashval, ARCH_CONVERT), (__psunsigned_t)be32_to_cpu(node->btree[0].hashval),
(__psunsigned_t)INT_GET(node->btree[INT_GET(node->hdr.count, ARCH_CONVERT)-1].hashval, ARCH_CONVERT)); (__psunsigned_t)be32_to_cpu(node->btree[INT_GET(node->hdr.count, ARCH_CONVERT)-1].hashval));
} }
/* /*
...@@ -2256,8 +2255,8 @@ xfs_attr_trace_l_cb(char *where, struct xfs_attr_list_context *context, ...@@ -2256,8 +2255,8 @@ xfs_attr_trace_l_cb(char *where, struct xfs_attr_list_context *context,
: 0, : 0,
(__psunsigned_t)context->dupcnt, (__psunsigned_t)context->dupcnt,
(__psunsigned_t)context->flags, (__psunsigned_t)context->flags,
(__psunsigned_t)INT_GET(btree->hashval, ARCH_CONVERT), (__psunsigned_t)be32_to_cpu(btree->hashval),
(__psunsigned_t)INT_GET(btree->before, ARCH_CONVERT), (__psunsigned_t)be32_to_cpu(btree->before),
(__psunsigned_t)NULL); (__psunsigned_t)NULL);
} }
......
...@@ -869,7 +869,7 @@ xfs_attr_leaf_to_node(xfs_da_args_t *args) ...@@ -869,7 +869,7 @@ xfs_attr_leaf_to_node(xfs_da_args_t *args)
/* both on-disk, don't endian-flip twice */ /* both on-disk, don't endian-flip twice */
node->btree[0].hashval = node->btree[0].hashval =
leaf->entries[be16_to_cpu(leaf->hdr.count)-1 ].hashval; leaf->entries[be16_to_cpu(leaf->hdr.count)-1 ].hashval;
INT_SET(node->btree[0].before, ARCH_CONVERT, blkno); node->btree[0].before = cpu_to_be32(blkno);
INT_SET(node->hdr.count, ARCH_CONVERT, 1); INT_SET(node->hdr.count, ARCH_CONVERT, 1);
xfs_da_log_buf(args->trans, bp1, 0, XFS_LBSIZE(dp->i_mount) - 1); xfs_da_log_buf(args->trans, bp1, 0, XFS_LBSIZE(dp->i_mount) - 1);
error = 0; error = 0;
...@@ -2809,7 +2809,7 @@ xfs_attr_node_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp, ...@@ -2809,7 +2809,7 @@ xfs_attr_node_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp,
xfs_da_brelse(*trans, bp); xfs_da_brelse(*trans, bp);
return(0); return(0);
} }
child_fsb = INT_GET(node->btree[0].before, ARCH_CONVERT); child_fsb = be32_to_cpu(node->btree[0].before);
xfs_da_brelse(*trans, bp); /* no locks for later trans */ xfs_da_brelse(*trans, bp); /* no locks for later trans */
/* /*
...@@ -2869,7 +2869,7 @@ xfs_attr_node_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp, ...@@ -2869,7 +2869,7 @@ xfs_attr_node_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp,
&bp, XFS_ATTR_FORK); &bp, XFS_ATTR_FORK);
if (error) if (error)
return(error); return(error);
child_fsb = INT_GET(node->btree[i+1].before, ARCH_CONVERT); child_fsb = be32_to_cpu(node->btree[i+1].before);
xfs_da_brelse(*trans, bp); xfs_da_brelse(*trans, bp);
} }
/* /*
......
This diff is collapsed.
...@@ -69,8 +69,8 @@ typedef struct xfs_da_intnode { ...@@ -69,8 +69,8 @@ typedef struct xfs_da_intnode {
__uint16_t level; /* level above leaves (leaf == 0) */ __uint16_t level; /* level above leaves (leaf == 0) */
} hdr; } hdr;
struct xfs_da_node_entry { struct xfs_da_node_entry {
xfs_dahash_t hashval; /* hash value for this descendant */ __be32 hashval; /* hash value for this descendant */
xfs_dablk_t before; /* Btree block before this key */ __be32 before; /* Btree block before this key */
} btree[1]; /* variable sized array of keys */ } btree[1]; /* variable sized array of keys */
} xfs_da_intnode_t; } xfs_da_intnode_t;
typedef struct xfs_da_node_hdr xfs_da_node_hdr_t; typedef struct xfs_da_node_hdr xfs_da_node_hdr_t;
......
...@@ -954,8 +954,8 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio, ...@@ -954,8 +954,8 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio,
btree = &node->btree[0]; btree = &node->btree[0];
xfs_dir_trace_g_dun("node: node detail", dp, uio, node); xfs_dir_trace_g_dun("node: node detail", dp, uio, node);
for (i = 0; i < INT_GET(node->hdr.count, ARCH_CONVERT); btree++, i++) { for (i = 0; i < INT_GET(node->hdr.count, ARCH_CONVERT); btree++, i++) {
if (INT_GET(btree->hashval, ARCH_CONVERT) >= cookhash) { if (be32_to_cpu(btree->hashval) >= cookhash) {
bno = INT_GET(btree->before, ARCH_CONVERT); bno = be32_to_cpu(btree->before);
break; break;
} }
} }
...@@ -1129,9 +1129,9 @@ xfs_dir_trace_g_dun(char *where, xfs_inode_t *dp, uio_t *uio, ...@@ -1129,9 +1129,9 @@ xfs_dir_trace_g_dun(char *where, xfs_inode_t *dp, uio_t *uio,
(void *)(unsigned long) (void *)(unsigned long)
INT_GET(node->hdr.count, ARCH_CONVERT), INT_GET(node->hdr.count, ARCH_CONVERT),
(void *)(unsigned long) (void *)(unsigned long)
INT_GET(node->btree[0].hashval, ARCH_CONVERT), be32_to_cpu(node->btree[0].hashval),
(void *)(unsigned long) (void *)(unsigned long)
INT_GET(node->btree[last].hashval, ARCH_CONVERT), be32_to_cpu(node->btree[last].hashval),
NULL, NULL, NULL); NULL, NULL, NULL);
} }
......
...@@ -745,7 +745,7 @@ xfs_dir_leaf_to_node(xfs_da_args_t *args) ...@@ -745,7 +745,7 @@ xfs_dir_leaf_to_node(xfs_da_args_t *args)
ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR_LEAF_MAGIC); ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR_LEAF_MAGIC);
INT_SET(node->btree[0].hashval, ARCH_CONVERT, INT_GET(leaf->entries[ INT_GET(leaf->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)); INT_SET(node->btree[0].hashval, ARCH_CONVERT, INT_GET(leaf->entries[ INT_GET(leaf->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT));
xfs_da_buf_done(bp2); xfs_da_buf_done(bp2);
INT_SET(node->btree[0].before, ARCH_CONVERT, blkno); node->btree[0].before = cpu_to_be32(blkno);
INT_SET(node->hdr.count, ARCH_CONVERT, 1); INT_SET(node->hdr.count, ARCH_CONVERT, 1);
xfs_da_log_buf(args->trans, bp1, xfs_da_log_buf(args->trans, bp1,
XFS_DA_LOGRANGE(node, &node->btree[0], sizeof(node->btree[0]))); XFS_DA_LOGRANGE(node, &node->btree[0], sizeof(node->btree[0])));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment