You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[XFS] endianess annotations for xfs_dir_leaf_hdr_t
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>
This commit is contained in:
committed by
Nathan Scott
parent
ff9901c1e7
commit
8034fff39b
@@ -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;
|
||||
|
||||
+5
-6
@@ -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);
|
||||
@@ -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);
|
||||
@@ -1142,7 +1142,7 @@ 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,
|
||||
@@ -1150,8 +1150,7 @@ xfs_dir_trace_g_dul(char *where, xfs_inode_t *dp, uio_t *uio,
|
||||
(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)
|
||||
|
||||
+169
-157
File diff suppressed because it is too large
Load Diff
@@ -68,17 +68,17 @@ struct xfs_trans;
|
||||
#define XFS_DIR_LEAF_MAPSIZE 3 /* how many freespace slots */
|
||||
|
||||
typedef struct xfs_dir_leaf_map { /* RLE map of free bytes */
|
||||
__uint16_t base; /* base of free region */
|
||||
__uint16_t size; /* run length of free region */
|
||||
__be16 base; /* base of free region */
|
||||
__be16 size; /* run length of free region */
|
||||
} xfs_dir_leaf_map_t;
|
||||
|
||||
typedef struct xfs_dir_leaf_hdr { /* constant-structure header block */
|
||||
xfs_da_blkinfo_t info; /* block type, links, etc. */
|
||||
__uint16_t count; /* count of active leaf_entry's */
|
||||
__uint16_t namebytes; /* num bytes of name strings stored */
|
||||
__uint16_t firstused; /* first used byte in name area */
|
||||
__uint8_t holes; /* != 0 if blk needs compaction */
|
||||
__uint8_t pad1;
|
||||
__be16 count; /* count of active leaf_entry's */
|
||||
__be16 namebytes; /* num bytes of name strings stored */
|
||||
__be16 firstused; /* first used byte in name area */
|
||||
__u8 holes; /* != 0 if blk needs compaction */
|
||||
__u8 pad1;
|
||||
xfs_dir_leaf_map_t freemap[XFS_DIR_LEAF_MAPSIZE];
|
||||
} xfs_dir_leaf_hdr_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user