This source file includes following definitions.
- xfs_fs_has_sickness
- xfs_rt_has_sickness
- xfs_ag_has_sickness
- xfs_inode_has_sickness
- xfs_fs_is_healthy
- xfs_rt_is_healthy
- xfs_ag_is_healthy
- xfs_inode_is_healthy
1
2
3
4
5
6 #ifndef __XFS_HEALTH_H__
7 #define __XFS_HEALTH_H__
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 struct xfs_mount;
35 struct xfs_perag;
36 struct xfs_inode;
37 struct xfs_fsop_geom;
38
39
40 #define XFS_SICK_FS_COUNTERS (1 << 0)
41 #define XFS_SICK_FS_UQUOTA (1 << 1)
42 #define XFS_SICK_FS_GQUOTA (1 << 2)
43 #define XFS_SICK_FS_PQUOTA (1 << 3)
44
45
46 #define XFS_SICK_RT_BITMAP (1 << 0)
47 #define XFS_SICK_RT_SUMMARY (1 << 1)
48
49
50 #define XFS_SICK_AG_SB (1 << 0)
51 #define XFS_SICK_AG_AGF (1 << 1)
52 #define XFS_SICK_AG_AGFL (1 << 2)
53 #define XFS_SICK_AG_AGI (1 << 3)
54 #define XFS_SICK_AG_BNOBT (1 << 4)
55 #define XFS_SICK_AG_CNTBT (1 << 5)
56 #define XFS_SICK_AG_INOBT (1 << 6)
57 #define XFS_SICK_AG_FINOBT (1 << 7)
58 #define XFS_SICK_AG_RMAPBT (1 << 8)
59 #define XFS_SICK_AG_REFCNTBT (1 << 9)
60
61
62 #define XFS_SICK_INO_CORE (1 << 0)
63 #define XFS_SICK_INO_BMBTD (1 << 1)
64 #define XFS_SICK_INO_BMBTA (1 << 2)
65 #define XFS_SICK_INO_BMBTC (1 << 3)
66 #define XFS_SICK_INO_DIR (1 << 4)
67 #define XFS_SICK_INO_XATTR (1 << 5)
68 #define XFS_SICK_INO_SYMLINK (1 << 6)
69 #define XFS_SICK_INO_PARENT (1 << 7)
70
71
72 #define XFS_SICK_FS_PRIMARY (XFS_SICK_FS_COUNTERS | \
73 XFS_SICK_FS_UQUOTA | \
74 XFS_SICK_FS_GQUOTA | \
75 XFS_SICK_FS_PQUOTA)
76
77 #define XFS_SICK_RT_PRIMARY (XFS_SICK_RT_BITMAP | \
78 XFS_SICK_RT_SUMMARY)
79
80 #define XFS_SICK_AG_PRIMARY (XFS_SICK_AG_SB | \
81 XFS_SICK_AG_AGF | \
82 XFS_SICK_AG_AGFL | \
83 XFS_SICK_AG_AGI | \
84 XFS_SICK_AG_BNOBT | \
85 XFS_SICK_AG_CNTBT | \
86 XFS_SICK_AG_INOBT | \
87 XFS_SICK_AG_FINOBT | \
88 XFS_SICK_AG_RMAPBT | \
89 XFS_SICK_AG_REFCNTBT)
90
91 #define XFS_SICK_INO_PRIMARY (XFS_SICK_INO_CORE | \
92 XFS_SICK_INO_BMBTD | \
93 XFS_SICK_INO_BMBTA | \
94 XFS_SICK_INO_BMBTC | \
95 XFS_SICK_INO_DIR | \
96 XFS_SICK_INO_XATTR | \
97 XFS_SICK_INO_SYMLINK | \
98 XFS_SICK_INO_PARENT)
99
100
101
102 void xfs_fs_mark_sick(struct xfs_mount *mp, unsigned int mask);
103 void xfs_fs_mark_healthy(struct xfs_mount *mp, unsigned int mask);
104 void xfs_fs_measure_sickness(struct xfs_mount *mp, unsigned int *sick,
105 unsigned int *checked);
106
107 void xfs_rt_mark_sick(struct xfs_mount *mp, unsigned int mask);
108 void xfs_rt_mark_healthy(struct xfs_mount *mp, unsigned int mask);
109 void xfs_rt_measure_sickness(struct xfs_mount *mp, unsigned int *sick,
110 unsigned int *checked);
111
112 void xfs_ag_mark_sick(struct xfs_perag *pag, unsigned int mask);
113 void xfs_ag_mark_healthy(struct xfs_perag *pag, unsigned int mask);
114 void xfs_ag_measure_sickness(struct xfs_perag *pag, unsigned int *sick,
115 unsigned int *checked);
116
117 void xfs_inode_mark_sick(struct xfs_inode *ip, unsigned int mask);
118 void xfs_inode_mark_healthy(struct xfs_inode *ip, unsigned int mask);
119 void xfs_inode_measure_sickness(struct xfs_inode *ip, unsigned int *sick,
120 unsigned int *checked);
121
122 void xfs_health_unmount(struct xfs_mount *mp);
123
124
125
126 static inline bool
127 xfs_fs_has_sickness(struct xfs_mount *mp, unsigned int mask)
128 {
129 unsigned int sick, checked;
130
131 xfs_fs_measure_sickness(mp, &sick, &checked);
132 return sick & mask;
133 }
134
135 static inline bool
136 xfs_rt_has_sickness(struct xfs_mount *mp, unsigned int mask)
137 {
138 unsigned int sick, checked;
139
140 xfs_rt_measure_sickness(mp, &sick, &checked);
141 return sick & mask;
142 }
143
144 static inline bool
145 xfs_ag_has_sickness(struct xfs_perag *pag, unsigned int mask)
146 {
147 unsigned int sick, checked;
148
149 xfs_ag_measure_sickness(pag, &sick, &checked);
150 return sick & mask;
151 }
152
153 static inline bool
154 xfs_inode_has_sickness(struct xfs_inode *ip, unsigned int mask)
155 {
156 unsigned int sick, checked;
157
158 xfs_inode_measure_sickness(ip, &sick, &checked);
159 return sick & mask;
160 }
161
162 static inline bool
163 xfs_fs_is_healthy(struct xfs_mount *mp)
164 {
165 return !xfs_fs_has_sickness(mp, -1U);
166 }
167
168 static inline bool
169 xfs_rt_is_healthy(struct xfs_mount *mp)
170 {
171 return !xfs_rt_has_sickness(mp, -1U);
172 }
173
174 static inline bool
175 xfs_ag_is_healthy(struct xfs_perag *pag)
176 {
177 return !xfs_ag_has_sickness(pag, -1U);
178 }
179
180 static inline bool
181 xfs_inode_is_healthy(struct xfs_inode *ip)
182 {
183 return !xfs_inode_has_sickness(ip, -1U);
184 }
185
186 void xfs_fsop_geom_health(struct xfs_mount *mp, struct xfs_fsop_geom *geo);
187 void xfs_ag_geom_health(struct xfs_perag *pag, struct xfs_ag_geometry *ageo);
188 void xfs_bulkstat_health(struct xfs_inode *ip, struct xfs_bulkstat *bs);
189
190 #endif