]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - repair/agheader.h
b5c10ecd8e161632db61d1f8557ebaccbc9f4a3a
[thirdparty/xfsprogs-dev.git] / repair / agheader.h
1 /*
2 * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 typedef struct fs_geometry {
20 /*
21 * these types should match the superblock types
22 */
23 __uint32_t sb_blocksize; /* blocksize (bytes) */
24 xfs_drfsbno_t sb_dblocks; /* # data blocks */
25 xfs_drfsbno_t sb_rblocks; /* # realtime blocks */
26 xfs_drtbno_t sb_rextents; /* # realtime extents */
27 uuid_t sb_uuid; /* fs uuid */
28 xfs_dfsbno_t sb_logstart; /* starting log block # */
29 xfs_agblock_t sb_rextsize; /* realtime extent size (blocks )*/
30 xfs_agblock_t sb_agblocks; /* # of blocks per ag */
31 xfs_agnumber_t sb_agcount; /* # of ags */
32 xfs_extlen_t sb_rbmblocks; /* # of rt bitmap blocks */
33 xfs_extlen_t sb_logblocks; /* # of log blocks */
34 __uint16_t sb_sectsize; /* volume sector size (bytes) */
35 __uint16_t sb_inodesize; /* inode size (bytes) */
36 __uint8_t sb_imax_pct; /* max % of fs for inode space */
37
38 /*
39 * these don't have to match the superblock types but are placed
40 * before sb_shared_vn because these values don't have to be
41 * checked manually. These variables will be set only on
42 * filesystems with dependably good (fully initialized)
43 * secondary superblock sectors, will be stamped in all
44 * superblocks at mkfs time, and are features that cannot
45 * be downgraded unless all superblocks in the filesystem
46 * are rewritten.
47 */
48 int sb_extflgbit; /* extent flag feature bit set */
49
50 /*
51 * fields after this point have to be checked manually in compare_sb()
52 */
53 __uint8_t sb_shared_vn; /* shared version number */
54 xfs_extlen_t sb_inoalignmt; /* inode chunk alignment, fsblocks */
55 __uint32_t sb_unit; /* stripe or raid unit */
56 __uint32_t sb_width; /* stripe or width unit */
57
58 /*
59 * these don't have to match, they track superblock properties
60 * that could have been upgraded and/or downgraded during
61 * run-time so that the primary superblock has them but the
62 * secondaries do not.
63 * Plus, they have associated data fields whose data fields may
64 * be corrupt in cases where the filesystem was made on a
65 * pre-6.5 campus alpha mkfs and the feature was enabled on
66 * the filesystem later.
67 */
68 int sb_ialignbit; /* sb has inode alignment bit set */
69 int sb_salignbit; /* sb has stripe alignment bit set */
70 int sb_sharedbit; /* sb has inode alignment bit set */
71
72 int sb_fully_zeroed; /* has zeroed secondary sb sectors */
73 } fs_geometry_t;
74
75 typedef struct fs_geo_list {
76 struct fs_geo_list *next;
77 int refs;
78 int index;
79 fs_geometry_t geo;
80 } fs_geo_list_t;
81
82 /*
83 * fields for sb_last_nonzero
84 */
85
86 #define XR_SB_COUNTERS 0x0001
87 #define XR_SB_INOALIGN 0x0002
88 #define XR_SB_SALIGN 0x0004
89
90 /*
91 * what got modified by verify_set_* routines
92 */
93
94 #define XR_AG_SB 0x1
95 #define XR_AG_AGF 0x2
96 #define XR_AG_AGI 0x4
97 #define XR_AG_SB_SEC 0x8