Commit fac80cce authored by Nathan Scott's avatar Nathan Scott

[XFS] endianess annotations for xfs_da_node_hdr_t

SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25505a
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 403432dc
......@@ -1825,8 +1825,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
return(XFS_ERROR(EFSCORRUPTED));
}
btree = node->btree;
for (i = 0;
i < INT_GET(node->hdr.count, ARCH_CONVERT);
for (i = 0; i < be16_to_cpu(node->hdr.count);
btree++, i++) {
if (cursor->hashval
<= be32_to_cpu(btree->hashval)) {
......@@ -1836,7 +1835,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
break;
}
}
if (i == INT_GET(node->hdr.count, ARCH_CONVERT)) {
if (i == be16_to_cpu(node->hdr.count)) {
xfs_da_brelse(NULL, bp);
return(0);
}
......@@ -2226,9 +2225,10 @@ xfs_attr_trace_l_cn(char *where, struct xfs_attr_list_context *context,
: 0,
(__psunsigned_t)context->dupcnt,
(__psunsigned_t)context->flags,
(__psunsigned_t)INT_GET(node->hdr.count, ARCH_CONVERT),
(__psunsigned_t)be16_to_cpu(node->hdr.count),
(__psunsigned_t)be32_to_cpu(node->btree[0].hashval),
(__psunsigned_t)be32_to_cpu(node->btree[INT_GET(node->hdr.count, ARCH_CONVERT)-1].hashval));
(__psunsigned_t)be32_to_cpu(node->btree[
be16_to_cpu(node->hdr.count)-1].hashval));
}
/*
......
......@@ -870,7 +870,7 @@ xfs_attr_leaf_to_node(xfs_da_args_t *args)
node->btree[0].hashval =
leaf->entries[be16_to_cpu(leaf->hdr.count)-1 ].hashval;
node->btree[0].before = cpu_to_be32(blkno);
INT_SET(node->hdr.count, ARCH_CONVERT, 1);
node->hdr.count = cpu_to_be16(1);
xfs_da_log_buf(args->trans, bp1, 0, XFS_LBSIZE(dp->i_mount) - 1);
error = 0;
out:
......@@ -2804,7 +2804,7 @@ xfs_attr_node_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp,
node = bp->data;
ASSERT(be16_to_cpu(node->hdr.info.magic) == XFS_DA_NODE_MAGIC);
parent_blkno = xfs_da_blkno(bp); /* save for re-read later */
count = INT_GET(node->hdr.count, ARCH_CONVERT);
count = be16_to_cpu(node->hdr.count);
if (!count) {
xfs_da_brelse(*trans, bp);
return(0);
......
This diff is collapsed.
......@@ -65,8 +65,8 @@ typedef struct xfs_da_blkinfo {
typedef struct xfs_da_intnode {
struct xfs_da_node_hdr { /* constant-structure header block */
xfs_da_blkinfo_t info; /* block type, links, etc. */
__uint16_t count; /* count of active entries */
__uint16_t level; /* level above leaves (leaf == 0) */
__be16 count; /* count of active entries */
__be16 level; /* level above leaves (leaf == 0) */
} hdr;
struct xfs_da_node_entry {
__be32 hashval; /* hash value for this descendant */
......
......@@ -953,13 +953,13 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio,
break;
btree = &node->btree[0];
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 < be16_to_cpu(node->hdr.count); btree++, i++) {
if (be32_to_cpu(btree->hashval) >= cookhash) {
bno = be32_to_cpu(btree->before);
break;
}
}
if (i == INT_GET(node->hdr.count, ARCH_CONVERT)) {
if (i == be16_to_cpu(node->hdr.count)) {
xfs_da_brelse(trans, bp);
xfs_dir_trace_g_du("node: hash beyond EOF",
dp, uio);
......@@ -1118,7 +1118,7 @@ void
xfs_dir_trace_g_dun(char *where, xfs_inode_t *dp, uio_t *uio,
xfs_da_intnode_t *node)
{
int last = INT_GET(node->hdr.count, ARCH_CONVERT) - 1;
int last = be16_to_cpu(node->hdr.count) - 1;
xfs_dir_trace_enter(XFS_DIR_KTRACE_G_DUN, where,
(void *)dp, (void *)dp->i_mount,
......@@ -1127,7 +1127,7 @@ xfs_dir_trace_g_dun(char *where, xfs_inode_t *dp, uio_t *uio,
(void *)(unsigned long)uio->uio_resid,
(void *)(unsigned long)be32_to_cpu(node->hdr.info.forw),
(void *)(unsigned long)
INT_GET(node->hdr.count, ARCH_CONVERT),
be16_to_cpu(node->hdr.count),
(void *)(unsigned long)
be32_to_cpu(node->btree[0].hashval),
(void *)(unsigned long)
......
......@@ -743,10 +743,12 @@ xfs_dir_leaf_to_node(xfs_da_args_t *args)
node = bp1->data;
leaf = bp2->data;
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));
node->btree[0].hashval = cpu_to_be32(
INT_GET(leaf->entries[
INT_GET(leaf->hdr.count, ARCH_CONVERT)-1].hashval, ARCH_CONVERT));
xfs_da_buf_done(bp2);
node->btree[0].before = cpu_to_be32(blkno);
INT_SET(node->hdr.count, ARCH_CONVERT, 1);
node->hdr.count = cpu_to_be16(1);
xfs_da_log_buf(args->trans, bp1,
XFS_DA_LOGRANGE(node, &node->btree[0], sizeof(node->btree[0])));
xfs_da_buf_done(bp1);
......
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