aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_attr_leaf.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_attr_leaf.h')
-rw-r--r--fs/xfs/xfs_attr_leaf.h47
1 files changed, 23 insertions, 24 deletions
diff --git a/fs/xfs/xfs_attr_leaf.h b/fs/xfs/xfs_attr_leaf.h
index 541e34109bb9..51c3ee156b2f 100644
--- a/fs/xfs/xfs_attr_leaf.h
+++ b/fs/xfs/xfs_attr_leaf.h
@@ -73,39 +73,39 @@ struct xfs_trans;
73#define XFS_ATTR_LEAF_MAPSIZE 3 /* how many freespace slots */ 73#define XFS_ATTR_LEAF_MAPSIZE 3 /* how many freespace slots */
74 74
75typedef struct xfs_attr_leaf_map { /* RLE map of free bytes */ 75typedef struct xfs_attr_leaf_map { /* RLE map of free bytes */
76 __uint16_t base; /* base of free region */ 76 __be16 base; /* base of free region */
77 __uint16_t size; /* length of free region */ 77 __be16 size; /* length of free region */
78} xfs_attr_leaf_map_t; 78} xfs_attr_leaf_map_t;
79 79
80typedef struct xfs_attr_leaf_hdr { /* constant-structure header block */ 80typedef struct xfs_attr_leaf_hdr { /* constant-structure header block */
81 xfs_da_blkinfo_t info; /* block type, links, etc. */ 81 xfs_da_blkinfo_t info; /* block type, links, etc. */
82 __uint16_t count; /* count of active leaf_entry's */ 82 __be16 count; /* count of active leaf_entry's */
83 __uint16_t usedbytes; /* num bytes of names/values stored */ 83 __be16 usedbytes; /* num bytes of names/values stored */
84 __uint16_t firstused; /* first used byte in name area */ 84 __be16 firstused; /* first used byte in name area */
85 __uint8_t holes; /* != 0 if blk needs compaction */ 85 __u8 holes; /* != 0 if blk needs compaction */
86 __uint8_t pad1; 86 __u8 pad1;
87 xfs_attr_leaf_map_t freemap[XFS_ATTR_LEAF_MAPSIZE]; 87 xfs_attr_leaf_map_t freemap[XFS_ATTR_LEAF_MAPSIZE];
88 /* N largest free regions */ 88 /* N largest free regions */
89} xfs_attr_leaf_hdr_t; 89} xfs_attr_leaf_hdr_t;
90 90
91typedef struct xfs_attr_leaf_entry { /* sorted on key, not name */ 91typedef struct xfs_attr_leaf_entry { /* sorted on key, not name */
92 xfs_dahash_t hashval; /* hash value of name */ 92 __be32 hashval; /* hash value of name */
93 __uint16_t nameidx; /* index into buffer of name/value */ 93 __be16 nameidx; /* index into buffer of name/value */
94 __uint8_t flags; /* LOCAL/ROOT/SECURE/INCOMPLETE flag */ 94 __u8 flags; /* LOCAL/ROOT/SECURE/INCOMPLETE flag */
95 __uint8_t pad2; /* unused pad byte */ 95 __u8 pad2; /* unused pad byte */
96} xfs_attr_leaf_entry_t; 96} xfs_attr_leaf_entry_t;
97 97
98typedef struct xfs_attr_leaf_name_local { 98typedef struct xfs_attr_leaf_name_local {
99 __uint16_t valuelen; /* number of bytes in value */ 99 __be16 valuelen; /* number of bytes in value */
100 __uint8_t namelen; /* length of name bytes */ 100 __u8 namelen; /* length of name bytes */
101 __uint8_t nameval[1]; /* name/value bytes */ 101 __u8 nameval[1]; /* name/value bytes */
102} xfs_attr_leaf_name_local_t; 102} xfs_attr_leaf_name_local_t;
103 103
104typedef struct xfs_attr_leaf_name_remote { 104typedef struct xfs_attr_leaf_name_remote {
105 xfs_dablk_t valueblk; /* block number of value bytes */ 105 __be32 valueblk; /* block number of value bytes */
106 __uint32_t valuelen; /* number of bytes in value */ 106 __be32 valuelen; /* number of bytes in value */
107 __uint8_t namelen; /* length of name bytes */ 107 __u8 namelen; /* length of name bytes */
108 __uint8_t name[1]; /* name bytes */ 108 __u8 name[1]; /* name bytes */
109} xfs_attr_leaf_name_remote_t; 109} xfs_attr_leaf_name_remote_t;
110 110
111typedef struct xfs_attr_leafblock { 111typedef struct xfs_attr_leafblock {
@@ -143,8 +143,8 @@ typedef struct xfs_attr_leafblock {
143static inline xfs_attr_leaf_name_remote_t * 143static inline xfs_attr_leaf_name_remote_t *
144xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx) 144xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx)
145{ 145{
146 return (xfs_attr_leaf_name_remote_t *) &((char *) 146 return (xfs_attr_leaf_name_remote_t *)
147 (leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)]; 147 &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)];
148} 148}
149 149
150#define XFS_ATTR_LEAF_NAME_LOCAL(leafp,idx) \ 150#define XFS_ATTR_LEAF_NAME_LOCAL(leafp,idx) \
@@ -152,16 +152,15 @@ xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx)
152static inline xfs_attr_leaf_name_local_t * 152static inline xfs_attr_leaf_name_local_t *
153xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx) 153xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx)
154{ 154{
155 return (xfs_attr_leaf_name_local_t *) &((char *) 155 return (xfs_attr_leaf_name_local_t *)
156 (leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)]; 156 &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)];
157} 157}
158 158
159#define XFS_ATTR_LEAF_NAME(leafp,idx) \ 159#define XFS_ATTR_LEAF_NAME(leafp,idx) \
160 xfs_attr_leaf_name(leafp,idx) 160 xfs_attr_leaf_name(leafp,idx)
161static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx) 161static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx)
162{ 162{
163 return (&((char *) 163 return &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)];
164 (leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)]);
165} 164}
166 165
167/* 166/*