Commit 6b19f2d8 authored by Nathan Scott's avatar Nathan Scott

[XFS] endianess annotations for xfs_attr_leaf_entry_t

SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25498a
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 918ae424
......@@ -1770,17 +1770,14 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
break;
case XFS_ATTR_LEAF_MAGIC:
leaf = bp->data;
if (cursor->hashval >
INT_GET(leaf->entries[
be16_to_cpu(leaf->hdr.count)-1].hashval,
ARCH_CONVERT)) {
if (cursor->hashval > be32_to_cpu(leaf->entries[
be16_to_cpu(leaf->hdr.count)-1].hashval)) {
xfs_attr_trace_l_cl("wrong blk",
context, leaf);
xfs_da_brelse(NULL, bp);
bp = NULL;
} else if (cursor->hashval <=
INT_GET(leaf->entries[0].hashval,
ARCH_CONVERT)) {
be32_to_cpu(leaf->entries[0].hashval)) {
xfs_attr_trace_l_cl("maybe wrong blk",
context, leaf);
xfs_da_brelse(NULL, bp);
......@@ -2289,8 +2286,9 @@ xfs_attr_trace_l_cl(char *where, struct xfs_attr_list_context *context,
(__psunsigned_t)context->dupcnt,
(__psunsigned_t)context->flags,
(__psunsigned_t)be16_to_cpu(leaf->hdr.count),
(__psunsigned_t)INT_GET(leaf->entries[0].hashval, ARCH_CONVERT),
(__psunsigned_t)INT_GET(leaf->entries[be16_to_cpu(leaf->hdr.count)-1].hashval, ARCH_CONVERT));
(__psunsigned_t)be32_to_cpu(leaf->entries[0].hashval),
(__psunsigned_t)be32_to_cpu(leaf->entries[
be16_to_cpu(leaf->hdr.count)-1].hashval));
}
/*
......
This diff is collapsed.
......@@ -89,10 +89,10 @@ typedef struct xfs_attr_leaf_hdr { /* constant-structure header block */
} xfs_attr_leaf_hdr_t;
typedef struct xfs_attr_leaf_entry { /* sorted on key, not name */
xfs_dahash_t hashval; /* hash value of name */
__uint16_t nameidx; /* index into buffer of name/value */
__uint8_t flags; /* LOCAL/ROOT/SECURE/INCOMPLETE flag */
__uint8_t pad2; /* unused pad byte */
__be32 hashval; /* hash value of name */
__be16 nameidx; /* index into buffer of name/value */
__u8 flags; /* LOCAL/ROOT/SECURE/INCOMPLETE flag */
__u8 pad2; /* unused pad byte */
} xfs_attr_leaf_entry_t;
typedef struct xfs_attr_leaf_name_local {
......@@ -143,8 +143,8 @@ typedef struct xfs_attr_leafblock {
static inline xfs_attr_leaf_name_remote_t *
xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx)
{
return (xfs_attr_leaf_name_remote_t *) &((char *)
(leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)];
return (xfs_attr_leaf_name_remote_t *)
&((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)];
}
#define XFS_ATTR_LEAF_NAME_LOCAL(leafp,idx) \
......@@ -152,16 +152,15 @@ xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx)
static inline xfs_attr_leaf_name_local_t *
xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx)
{
return (xfs_attr_leaf_name_local_t *) &((char *)
(leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)];
return (xfs_attr_leaf_name_local_t *)
&((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)];
}
#define XFS_ATTR_LEAF_NAME(leafp,idx) \
xfs_attr_leaf_name(leafp,idx)
static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx)
{
return (&((char *)
(leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)]);
return &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)];
}
/*
......
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