diff options
author | Christoph Hellwig <hch@sgi.com> | 2005-11-01 23:11:25 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-11-01 23:11:25 -0500 |
commit | 16259e7d952e26e949cc2c8c68b74f34b293935d (patch) | |
tree | a016791ecb67761236d32b9915efa9a92f6f3767 /fs/xfs/xfs_ag.h | |
parent | e2ed81fbbb7c76e0a1b3e2f1b5a7414f4d66a559 (diff) |
[XFS] Endianess annotations for various allocator data structures
SGI-PV: 943272
SGI-Modid: xfs-linux:xfs-kern:201006a
Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_ag.h')
-rw-r--r-- | fs/xfs/xfs_ag.h | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h index 8d055593fee4..a96e2ffce0cc 100644 --- a/fs/xfs/xfs_ag.h +++ b/fs/xfs/xfs_ag.h | |||
@@ -48,27 +48,26 @@ struct xfs_trans; | |||
48 | * are > 64k, our value cannot be confused for an EFS superblock's. | 48 | * are > 64k, our value cannot be confused for an EFS superblock's. |
49 | */ | 49 | */ |
50 | 50 | ||
51 | typedef struct xfs_agf | 51 | typedef struct xfs_agf { |
52 | { | ||
53 | /* | 52 | /* |
54 | * Common allocation group header information | 53 | * Common allocation group header information |
55 | */ | 54 | */ |
56 | __uint32_t agf_magicnum; /* magic number == XFS_AGF_MAGIC */ | 55 | __be32 agf_magicnum; /* magic number == XFS_AGF_MAGIC */ |
57 | __uint32_t agf_versionnum; /* header version == XFS_AGF_VERSION */ | 56 | __be32 agf_versionnum; /* header version == XFS_AGF_VERSION */ |
58 | xfs_agnumber_t agf_seqno; /* sequence # starting from 0 */ | 57 | __be32 agf_seqno; /* sequence # starting from 0 */ |
59 | xfs_agblock_t agf_length; /* size in blocks of a.g. */ | 58 | __be32 agf_length; /* size in blocks of a.g. */ |
60 | /* | 59 | /* |
61 | * Freespace information | 60 | * Freespace information |
62 | */ | 61 | */ |
63 | xfs_agblock_t agf_roots[XFS_BTNUM_AGF]; /* root blocks */ | 62 | __be32 agf_roots[XFS_BTNUM_AGF]; /* root blocks */ |
64 | __uint32_t agf_spare0; /* spare field */ | 63 | __be32 agf_spare0; /* spare field */ |
65 | __uint32_t agf_levels[XFS_BTNUM_AGF]; /* btree levels */ | 64 | __be32 agf_levels[XFS_BTNUM_AGF]; /* btree levels */ |
66 | __uint32_t agf_spare1; /* spare field */ | 65 | __be32 agf_spare1; /* spare field */ |
67 | __uint32_t agf_flfirst; /* first freelist block's index */ | 66 | __be32 agf_flfirst; /* first freelist block's index */ |
68 | __uint32_t agf_fllast; /* last freelist block's index */ | 67 | __be32 agf_fllast; /* last freelist block's index */ |
69 | __uint32_t agf_flcount; /* count of blocks in freelist */ | 68 | __be32 agf_flcount; /* count of blocks in freelist */ |
70 | xfs_extlen_t agf_freeblks; /* total free blocks */ | 69 | __be32 agf_freeblks; /* total free blocks */ |
71 | xfs_extlen_t agf_longest; /* longest free space */ | 70 | __be32 agf_longest; /* longest free space */ |
72 | } xfs_agf_t; | 71 | } xfs_agf_t; |
73 | 72 | ||
74 | #define XFS_AGF_MAGICNUM 0x00000001 | 73 | #define XFS_AGF_MAGICNUM 0x00000001 |
@@ -96,31 +95,30 @@ typedef struct xfs_agf | |||
96 | */ | 95 | */ |
97 | #define XFS_AGI_UNLINKED_BUCKETS 64 | 96 | #define XFS_AGI_UNLINKED_BUCKETS 64 |
98 | 97 | ||
99 | typedef struct xfs_agi | 98 | typedef struct xfs_agi { |
100 | { | ||
101 | /* | 99 | /* |
102 | * Common allocation group header information | 100 | * Common allocation group header information |
103 | */ | 101 | */ |
104 | __uint32_t agi_magicnum; /* magic number == XFS_AGI_MAGIC */ | 102 | __be32 agi_magicnum; /* magic number == XFS_AGI_MAGIC */ |
105 | __uint32_t agi_versionnum; /* header version == XFS_AGI_VERSION */ | 103 | __be32 agi_versionnum; /* header version == XFS_AGI_VERSION */ |
106 | xfs_agnumber_t agi_seqno; /* sequence # starting from 0 */ | 104 | __be32 agi_seqno; /* sequence # starting from 0 */ |
107 | xfs_agblock_t agi_length; /* size in blocks of a.g. */ | 105 | __be32 agi_length; /* size in blocks of a.g. */ |
108 | /* | 106 | /* |
109 | * Inode information | 107 | * Inode information |
110 | * Inodes are mapped by interpreting the inode number, so no | 108 | * Inodes are mapped by interpreting the inode number, so no |
111 | * mapping data is needed here. | 109 | * mapping data is needed here. |
112 | */ | 110 | */ |
113 | xfs_agino_t agi_count; /* count of allocated inodes */ | 111 | __be32 agi_count; /* count of allocated inodes */ |
114 | xfs_agblock_t agi_root; /* root of inode btree */ | 112 | __be32 agi_root; /* root of inode btree */ |
115 | __uint32_t agi_level; /* levels in inode btree */ | 113 | __be32 agi_level; /* levels in inode btree */ |
116 | xfs_agino_t agi_freecount; /* number of free inodes */ | 114 | __be32 agi_freecount; /* number of free inodes */ |
117 | xfs_agino_t agi_newino; /* new inode just allocated */ | 115 | __be32 agi_newino; /* new inode just allocated */ |
118 | xfs_agino_t agi_dirino; /* last directory inode chunk */ | 116 | __be32 agi_dirino; /* last directory inode chunk */ |
119 | /* | 117 | /* |
120 | * Hash table of inodes which have been unlinked but are | 118 | * Hash table of inodes which have been unlinked but are |
121 | * still being referenced. | 119 | * still being referenced. |
122 | */ | 120 | */ |
123 | xfs_agino_t agi_unlinked[XFS_AGI_UNLINKED_BUCKETS]; | 121 | __be32 agi_unlinked[XFS_AGI_UNLINKED_BUCKETS]; |
124 | } xfs_agi_t; | 122 | } xfs_agi_t; |
125 | 123 | ||
126 | #define XFS_AGI_MAGICNUM 0x00000001 | 124 | #define XFS_AGI_MAGICNUM 0x00000001 |
@@ -201,8 +199,8 @@ typedef struct xfs_perag | |||
201 | (MIN(bl + 1, XFS_AG_MAXLEVELS(mp)) + MIN(cl + 1, XFS_AG_MAXLEVELS(mp))) | 199 | (MIN(bl + 1, XFS_AG_MAXLEVELS(mp)) + MIN(cl + 1, XFS_AG_MAXLEVELS(mp))) |
202 | #define XFS_MIN_FREELIST(a,mp) \ | 200 | #define XFS_MIN_FREELIST(a,mp) \ |
203 | (XFS_MIN_FREELIST_RAW( \ | 201 | (XFS_MIN_FREELIST_RAW( \ |
204 | INT_GET((a)->agf_levels[XFS_BTNUM_BNOi], ARCH_CONVERT), \ | 202 | be32_to_cpu((a)->agf_levels[XFS_BTNUM_BNOi]), \ |
205 | INT_GET((a)->agf_levels[XFS_BTNUM_CNTi], ARCH_CONVERT), mp)) | 203 | be32_to_cpu((a)->agf_levels[XFS_BTNUM_CNTi]), mp)) |
206 | #define XFS_MIN_FREELIST_PAG(pag,mp) \ | 204 | #define XFS_MIN_FREELIST_PAG(pag,mp) \ |
207 | (XFS_MIN_FREELIST_RAW( \ | 205 | (XFS_MIN_FREELIST_RAW( \ |
208 | (uint_t)(pag)->pagf_levels[XFS_BTNUM_BNOi], \ | 206 | (uint_t)(pag)->pagf_levels[XFS_BTNUM_BNOi], \ |