Commit 1d8daf06 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Nathan Scott

[XFS] endianess annotations for xfs_dir_leaf_entry_t

SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25808a
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 8034fff3
...@@ -1785,8 +1785,8 @@ xfs_da_swap_lastblock(xfs_da_args_t *args, xfs_dablk_t *dead_blknop, ...@@ -1785,8 +1785,8 @@ xfs_da_swap_lastblock(xfs_da_args_t *args, xfs_dablk_t *dead_blknop,
ASSERT(XFS_DIR_IS_V1(mp)); ASSERT(XFS_DIR_IS_V1(mp));
dead_leaf = (xfs_dir_leafblock_t *)dead_info; dead_leaf = (xfs_dir_leafblock_t *)dead_info;
dead_level = 0; dead_level = 0;
dead_hash = dead_hash = be32_to_cpu(dead_leaf->entries[
INT_GET(dead_leaf->entries[be16_to_cpu(dead_leaf->hdr.count) - 1].hashval, ARCH_CONVERT); be16_to_cpu(dead_leaf->hdr.count) - 1].hashval);
} else if (be16_to_cpu(dead_info->magic) == XFS_DIR2_LEAFN_MAGIC) { } else if (be16_to_cpu(dead_info->magic) == XFS_DIR2_LEAFN_MAGIC) {
ASSERT(XFS_DIR_IS_V2(mp)); ASSERT(XFS_DIR_IS_V2(mp));
dead_leaf2 = (xfs_dir2_leaf_t *)dead_info; dead_leaf2 = (xfs_dir2_leaf_t *)dead_info;
......
...@@ -710,7 +710,7 @@ xfs_dir_leaf_replace(xfs_da_args_t *args) ...@@ -710,7 +710,7 @@ xfs_dir_leaf_replace(xfs_da_args_t *args)
if (retval == EEXIST) { if (retval == EEXIST) {
leaf = bp->data; leaf = bp->data;
entry = &leaf->entries[index]; entry = &leaf->entries[index];
namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT)); namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, be16_to_cpu(entry->nameidx));
/* XXX - replace assert? */ /* XXX - replace assert? */
XFS_DIR_SF_PUT_DIRINO(&inum, &namest->inumber); XFS_DIR_SF_PUT_DIRINO(&inum, &namest->inumber);
xfs_da_log_buf(args->trans, bp, xfs_da_log_buf(args->trans, bp,
...@@ -918,14 +918,14 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio, ...@@ -918,14 +918,14 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio,
xfs_da_brelse(trans, bp); xfs_da_brelse(trans, bp);
bp = NULL; bp = NULL;
} }
if (bp && INT_GET(leaf->entries[0].hashval, ARCH_CONVERT) > cookhash) { if (bp && be32_to_cpu(leaf->entries[0].hashval) > cookhash) {
xfs_dir_trace_g_dub("node: leaf hash too large", xfs_dir_trace_g_dub("node: leaf hash too large",
dp, uio, bno); dp, uio, bno);
xfs_da_brelse(trans, bp); xfs_da_brelse(trans, bp);
bp = NULL; bp = NULL;
} }
if (bp && if (bp && cookhash > be32_to_cpu(leaf->entries[
cookhash > INT_GET(leaf->entries[be16_to_cpu(leaf->hdr.count) - 1].hashval, ARCH_CONVERT)) { be16_to_cpu(leaf->hdr.count) - 1].hashval)) {
xfs_dir_trace_g_dub("node: leaf hash too small", xfs_dir_trace_g_dub("node: leaf hash too small",
dp, uio, bno); dp, uio, bno);
xfs_da_brelse(trans, bp); xfs_da_brelse(trans, bp);
...@@ -1059,7 +1059,7 @@ xfs_dir_node_replace(xfs_da_args_t *args) ...@@ -1059,7 +1059,7 @@ xfs_dir_node_replace(xfs_da_args_t *args)
bp = blk->bp; bp = blk->bp;
leaf = bp->data; leaf = bp->data;
entry = &leaf->entries[blk->index]; entry = &leaf->entries[blk->index];
namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT)); namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, be16_to_cpu(entry->nameidx));
/* XXX - replace assert ? */ /* XXX - replace assert ? */
XFS_DIR_SF_PUT_DIRINO(&inum, &namest->inumber); XFS_DIR_SF_PUT_DIRINO(&inum, &namest->inumber);
xfs_da_log_buf(args->trans, bp, xfs_da_log_buf(args->trans, bp,
...@@ -1151,10 +1151,8 @@ xfs_dir_trace_g_dul(char *where, xfs_inode_t *dp, uio_t *uio, ...@@ -1151,10 +1151,8 @@ xfs_dir_trace_g_dul(char *where, xfs_inode_t *dp, uio_t *uio,
(void *)(unsigned long)uio->uio_resid, (void *)(unsigned long)uio->uio_resid,
(void *)(unsigned long)be32_to_cpu(leaf->hdr.info.forw), (void *)(unsigned long)be32_to_cpu(leaf->hdr.info.forw),
(void *)(unsigned long)be16_to_cpu(leaf->hdr.count), (void *)(unsigned long)be16_to_cpu(leaf->hdr.count),
(void *)(unsigned long) (void *)(unsigned long)be32_to_cpu(leaf->entries[0].hashval),
INT_GET(leaf->entries[0].hashval, ARCH_CONVERT), (void *)(unsigned long)be32_to_cpu(leaf->entries[last].hashval),
(void *)(unsigned long)
INT_GET(leaf->entries[last].hashval, ARCH_CONVERT),
NULL, NULL, NULL); NULL, NULL, NULL);
} }
...@@ -1170,8 +1168,7 @@ xfs_dir_trace_g_due(char *where, xfs_inode_t *dp, uio_t *uio, ...@@ -1170,8 +1168,7 @@ xfs_dir_trace_g_due(char *where, xfs_inode_t *dp, uio_t *uio,
(void *)((unsigned long)(uio->uio_offset >> 32)), (void *)((unsigned long)(uio->uio_offset >> 32)),
(void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)), (void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)),
(void *)(unsigned long)uio->uio_resid, (void *)(unsigned long)uio->uio_resid,
(void *)(unsigned long) (void *)(unsigned long)be32_to_cpu(entry->hashval),
INT_GET(entry->hashval, ARCH_CONVERT),
NULL, NULL, NULL, NULL, NULL, NULL); NULL, NULL, NULL, NULL, NULL, NULL);
} }
......
This diff is collapsed.
...@@ -83,10 +83,10 @@ typedef struct xfs_dir_leaf_hdr { /* constant-structure header block */ ...@@ -83,10 +83,10 @@ typedef struct xfs_dir_leaf_hdr { /* constant-structure header block */
} xfs_dir_leaf_hdr_t; } xfs_dir_leaf_hdr_t;
typedef struct xfs_dir_leaf_entry { /* sorted on key, not name */ typedef struct xfs_dir_leaf_entry { /* sorted on key, not name */
xfs_dahash_t hashval; /* hash value of name */ __be32 hashval; /* hash value of name */
__uint16_t nameidx; /* index into buffer of name */ __be16 nameidx; /* index into buffer of name */
__uint8_t namelen; /* length of name string */ __u8 namelen; /* length of name string */
__uint8_t pad2; __u8 pad2;
} xfs_dir_leaf_entry_t; } xfs_dir_leaf_entry_t;
typedef struct xfs_dir_leaf_name { typedef struct xfs_dir_leaf_name {
......
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