Commit c0f054e7 authored by Nathan Scott's avatar Nathan Scott

[XFS] endianess annotations for xfs_attr_leaf_name_remote_t

SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25500a
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 053b5758
...@@ -2006,11 +2006,9 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args) ...@@ -2006,11 +2006,9 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args)
((entry->flags & XFS_ATTR_ROOT) != 0)) ((entry->flags & XFS_ATTR_ROOT) != 0))
continue; continue;
args->index = probe; args->index = probe;
args->rmtblkno args->rmtblkno = be32_to_cpu(name_rmt->valueblk);
= INT_GET(name_rmt->valueblk, ARCH_CONVERT);
args->rmtblkcnt = XFS_B_TO_FSB(args->dp->i_mount, args->rmtblkcnt = XFS_B_TO_FSB(args->dp->i_mount,
INT_GET(name_rmt->valuelen, be32_to_cpu(name_rmt->valuelen));
ARCH_CONVERT));
return(XFS_ERROR(EEXIST)); return(XFS_ERROR(EEXIST));
} }
} }
...@@ -2057,8 +2055,8 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, xfs_da_args_t *args) ...@@ -2057,8 +2055,8 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, xfs_da_args_t *args)
name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
ASSERT(name_rmt->namelen == args->namelen); ASSERT(name_rmt->namelen == args->namelen);
ASSERT(memcmp(args->name, name_rmt->name, args->namelen) == 0); ASSERT(memcmp(args->name, name_rmt->name, args->namelen) == 0);
valuelen = INT_GET(name_rmt->valuelen, ARCH_CONVERT); valuelen = be32_to_cpu(name_rmt->valuelen);
args->rmtblkno = INT_GET(name_rmt->valueblk, ARCH_CONVERT); args->rmtblkno = be32_to_cpu(name_rmt->valueblk);
args->rmtblkcnt = XFS_B_TO_FSB(args->dp->i_mount, valuelen); args->rmtblkcnt = XFS_B_TO_FSB(args->dp->i_mount, valuelen);
if (args->flags & ATTR_KERNOVAL) { if (args->flags & ATTR_KERNOVAL) {
args->valuelen = valuelen; args->valuelen = valuelen;
...@@ -2413,8 +2411,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context) ...@@ -2413,8 +2411,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context)
retval = xfs_attr_put_listent(context, namesp, retval = xfs_attr_put_listent(context, namesp,
(char *)name_rmt->name, (char *)name_rmt->name,
(int)name_rmt->namelen, (int)name_rmt->namelen,
(int)INT_GET(name_rmt->valuelen, be32_to_cpu(name_rmt->valuelen));
ARCH_CONVERT));
} }
} }
if (retval == 0) { if (retval == 0) {
...@@ -2549,8 +2546,8 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args) ...@@ -2549,8 +2546,8 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args)
if (args->rmtblkno) { if (args->rmtblkno) {
ASSERT((entry->flags & XFS_ATTR_LOCAL) == 0); ASSERT((entry->flags & XFS_ATTR_LOCAL) == 0);
name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
INT_SET(name_rmt->valueblk, ARCH_CONVERT, args->rmtblkno); name_rmt->valueblk = cpu_to_be32(args->rmtblkno);
INT_SET(name_rmt->valuelen, ARCH_CONVERT, args->valuelen); name_rmt->valuelen = cpu_to_be32(args->valuelen);
xfs_da_log_buf(args->trans, bp, xfs_da_log_buf(args->trans, bp,
XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt)));
} }
...@@ -2703,8 +2700,8 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args) ...@@ -2703,8 +2700,8 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args)
if (args->rmtblkno) { if (args->rmtblkno) {
ASSERT((entry1->flags & XFS_ATTR_LOCAL) == 0); ASSERT((entry1->flags & XFS_ATTR_LOCAL) == 0);
name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf1, args->index); name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf1, args->index);
INT_SET(name_rmt->valueblk, ARCH_CONVERT, args->rmtblkno); name_rmt->valueblk = cpu_to_be32(args->rmtblkno);
INT_SET(name_rmt->valuelen, ARCH_CONVERT, args->valuelen); name_rmt->valuelen = cpu_to_be32(args->valuelen);
xfs_da_log_buf(args->trans, bp1, xfs_da_log_buf(args->trans, bp1,
XFS_DA_LOGRANGE(leaf1, name_rmt, sizeof(*name_rmt))); XFS_DA_LOGRANGE(leaf1, name_rmt, sizeof(*name_rmt)));
} }
...@@ -2953,8 +2950,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp) ...@@ -2953,8 +2950,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp)
lp->valueblk = name_rmt->valueblk; lp->valueblk = name_rmt->valueblk;
INT_SET(lp->valuelen, ARCH_CONVERT, INT_SET(lp->valuelen, ARCH_CONVERT,
XFS_B_TO_FSB(dp->i_mount, XFS_B_TO_FSB(dp->i_mount,
INT_GET(name_rmt->valuelen, be32_to_cpu(name_rmt->valuelen)));
ARCH_CONVERT)));
lp++; lp++;
} }
} }
......
...@@ -102,10 +102,10 @@ typedef struct xfs_attr_leaf_name_local { ...@@ -102,10 +102,10 @@ typedef struct xfs_attr_leaf_name_local {
} xfs_attr_leaf_name_local_t; } xfs_attr_leaf_name_local_t;
typedef struct xfs_attr_leaf_name_remote { typedef struct xfs_attr_leaf_name_remote {
xfs_dablk_t valueblk; /* block number of value bytes */ __be32 valueblk; /* block number of value bytes */
__uint32_t valuelen; /* number of bytes in value */ __be32 valuelen; /* number of bytes in value */
__uint8_t namelen; /* length of name bytes */ __u8 namelen; /* length of name bytes */
__uint8_t name[1]; /* name bytes */ __u8 name[1]; /* name bytes */
} xfs_attr_leaf_name_remote_t; } xfs_attr_leaf_name_remote_t;
typedef struct xfs_attr_leafblock { typedef struct xfs_attr_leafblock {
......
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