Skip to content

Commit

Permalink
[XFS] endianess annotations for xfs_dir_leaf_hdr_t
Browse files Browse the repository at this point in the history
SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25807a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Nathan Scott <nathans@sgi.com>
  • Loading branch information
Christoph Hellwig authored and Nathan Scott committed Jun 9, 2006
1 parent ff9901c commit 8034fff
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 171 deletions.
2 changes: 1 addition & 1 deletion fs/xfs/xfs_da_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ xfs_da_swap_lastblock(xfs_da_args_t *args, xfs_dablk_t *dead_blknop,
dead_leaf = (xfs_dir_leafblock_t *)dead_info;
dead_level = 0;
dead_hash =
INT_GET(dead_leaf->entries[INT_GET(dead_leaf->hdr.count, ARCH_CONVERT) - 1].hashval, ARCH_CONVERT);
INT_GET(dead_leaf->entries[be16_to_cpu(dead_leaf->hdr.count) - 1].hashval, ARCH_CONVERT);
} else if (be16_to_cpu(dead_info->magic) == XFS_DIR2_LEAFN_MAGIC) {
ASSERT(XFS_DIR_IS_V2(mp));
dead_leaf2 = (xfs_dir2_leaf_t *)dead_info;
Expand Down
11 changes: 5 additions & 6 deletions fs/xfs/xfs_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,8 @@ xfs_dir_leaf_removename(xfs_da_args_t *args, int *count, int *totallen)
retval = xfs_dir_leaf_lookup_int(bp, args, &index);
if (retval == EEXIST) {
(void)xfs_dir_leaf_remove(args->trans, bp, index);
*count = INT_GET(leaf->hdr.count, ARCH_CONVERT);
*totallen = INT_GET(leaf->hdr.namebytes, ARCH_CONVERT);
*count = be16_to_cpu(leaf->hdr.count);
*totallen = be16_to_cpu(leaf->hdr.namebytes);
retval = 0;
}
xfs_da_buf_done(bp);
Expand Down Expand Up @@ -925,7 +925,7 @@ xfs_dir_node_getdents(xfs_trans_t *trans, xfs_inode_t *dp, uio_t *uio,
bp = NULL;
}
if (bp &&
cookhash > INT_GET(leaf->entries[INT_GET(leaf->hdr.count, ARCH_CONVERT) - 1].hashval, ARCH_CONVERT)) {
cookhash > INT_GET(leaf->entries[be16_to_cpu(leaf->hdr.count) - 1].hashval, ARCH_CONVERT)) {
xfs_dir_trace_g_dub("node: leaf hash too small",
dp, uio, bno);
xfs_da_brelse(trans, bp);
Expand Down Expand Up @@ -1142,16 +1142,15 @@ void
xfs_dir_trace_g_dul(char *where, xfs_inode_t *dp, uio_t *uio,
xfs_dir_leafblock_t *leaf)
{
int last = INT_GET(leaf->hdr.count, ARCH_CONVERT) - 1;
int last = be16_to_cpu(leaf->hdr.count) - 1;

xfs_dir_trace_enter(XFS_DIR_KTRACE_G_DUL, where,
(void *)dp, (void *)dp->i_mount,
(void *)((unsigned long)(uio->uio_offset >> 32)),
(void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)),
(void *)(unsigned long)uio->uio_resid,
(void *)(unsigned long)be32_to_cpu(leaf->hdr.info.forw),
(void *)(unsigned long)
INT_GET(leaf->hdr.count, ARCH_CONVERT),
(void *)(unsigned long)be16_to_cpu(leaf->hdr.count),
(void *)(unsigned long)
INT_GET(leaf->entries[0].hashval, ARCH_CONVERT),
(void *)(unsigned long)
Expand Down
Loading

0 comments on commit 8034fff

Please sign in to comment.