[XFS] endianess annotations for xfs_dir_leaf_entry_t
SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25808a
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>
diff --git a/fs/xfs/xfs_dir.c b/fs/xfs/xfs_dir.c
index a3b0e97..3cd8657 100644
--- a/fs/xfs/xfs_dir.c
+++ b/fs/xfs/xfs_dir.c
@@ -710,7 +710,7 @@
if (retval == EEXIST) {
leaf = bp->data;
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? */
XFS_DIR_SF_PUT_DIRINO(&inum, &namest->inumber);
xfs_da_log_buf(args->trans, bp,
@@ -918,14 +918,14 @@
xfs_da_brelse(trans, bp);
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",
dp, uio, bno);
xfs_da_brelse(trans, bp);
bp = NULL;
}
- if (bp &&
- cookhash > INT_GET(leaf->entries[be16_to_cpu(leaf->hdr.count) - 1].hashval, ARCH_CONVERT)) {
+ if (bp && cookhash > be32_to_cpu(leaf->entries[
+ be16_to_cpu(leaf->hdr.count) - 1].hashval)) {
xfs_dir_trace_g_dub("node: leaf hash too small",
dp, uio, bno);
xfs_da_brelse(trans, bp);
@@ -1059,7 +1059,7 @@
bp = blk->bp;
leaf = bp->data;
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 ? */
XFS_DIR_SF_PUT_DIRINO(&inum, &namest->inumber);
xfs_da_log_buf(args->trans, bp,
@@ -1151,10 +1151,8 @@
(void *)(unsigned long)uio->uio_resid,
(void *)(unsigned long)be32_to_cpu(leaf->hdr.info.forw),
(void *)(unsigned long)be16_to_cpu(leaf->hdr.count),
- (void *)(unsigned long)
- INT_GET(leaf->entries[0].hashval, ARCH_CONVERT),
- (void *)(unsigned long)
- INT_GET(leaf->entries[last].hashval, ARCH_CONVERT),
+ (void *)(unsigned long)be32_to_cpu(leaf->entries[0].hashval),
+ (void *)(unsigned long)be32_to_cpu(leaf->entries[last].hashval),
NULL, NULL, NULL);
}
@@ -1170,8 +1168,7 @@
(void *)((unsigned long)(uio->uio_offset >> 32)),
(void *)((unsigned long)(uio->uio_offset & 0xFFFFFFFF)),
(void *)(unsigned long)uio->uio_resid,
- (void *)(unsigned long)
- INT_GET(entry->hashval, ARCH_CONVERT),
+ (void *)(unsigned long)be32_to_cpu(entry->hashval),
NULL, NULL, NULL, NULL, NULL, NULL);
}