This source file includes following definitions.
- xchk_rtbitmap
- xchk_rtsummary
- xchk_quota
1
2
3
4
5
6 #ifndef __XFS_SCRUB_SCRUB_H__
7 #define __XFS_SCRUB_SCRUB_H__
8
9 struct xfs_scrub;
10
11
12 enum xchk_type {
13 ST_NONE = 1,
14 ST_PERAG,
15 ST_FS,
16 ST_INODE,
17 };
18
19 struct xchk_meta_ops {
20
21 int (*setup)(struct xfs_scrub *,
22 struct xfs_inode *);
23
24
25 int (*scrub)(struct xfs_scrub *);
26
27
28 int (*repair)(struct xfs_scrub *);
29
30
31 bool (*has)(struct xfs_sb *);
32
33
34 enum xchk_type type;
35 };
36
37
38 struct xchk_ag {
39 xfs_agnumber_t agno;
40 struct xfs_perag *pag;
41
42
43 struct xfs_buf *agf_bp;
44 struct xfs_buf *agfl_bp;
45 struct xfs_buf *agi_bp;
46
47
48 struct xfs_btree_cur *bno_cur;
49 struct xfs_btree_cur *cnt_cur;
50 struct xfs_btree_cur *ino_cur;
51 struct xfs_btree_cur *fino_cur;
52 struct xfs_btree_cur *rmap_cur;
53 struct xfs_btree_cur *refc_cur;
54 };
55
56 struct xfs_scrub {
57
58 struct xfs_mount *mp;
59 struct xfs_scrub_metadata *sm;
60 const struct xchk_meta_ops *ops;
61 struct xfs_trans *tp;
62 struct xfs_inode *ip;
63 void *buf;
64 uint ilock_flags;
65
66
67 unsigned int flags;
68
69
70
71
72
73
74 unsigned int sick_mask;
75
76
77 struct xchk_ag sa;
78 };
79
80
81 #define XCHK_TRY_HARDER (1 << 0)
82 #define XCHK_HAS_QUOTAOFFLOCK (1 << 1)
83 #define XCHK_REAPING_DISABLED (1 << 2)
84 #define XREP_ALREADY_FIXED (1 << 31)
85
86
87 int xchk_tester(struct xfs_scrub *sc);
88 int xchk_superblock(struct xfs_scrub *sc);
89 int xchk_agf(struct xfs_scrub *sc);
90 int xchk_agfl(struct xfs_scrub *sc);
91 int xchk_agi(struct xfs_scrub *sc);
92 int xchk_bnobt(struct xfs_scrub *sc);
93 int xchk_cntbt(struct xfs_scrub *sc);
94 int xchk_inobt(struct xfs_scrub *sc);
95 int xchk_finobt(struct xfs_scrub *sc);
96 int xchk_rmapbt(struct xfs_scrub *sc);
97 int xchk_refcountbt(struct xfs_scrub *sc);
98 int xchk_inode(struct xfs_scrub *sc);
99 int xchk_bmap_data(struct xfs_scrub *sc);
100 int xchk_bmap_attr(struct xfs_scrub *sc);
101 int xchk_bmap_cow(struct xfs_scrub *sc);
102 int xchk_directory(struct xfs_scrub *sc);
103 int xchk_xattr(struct xfs_scrub *sc);
104 int xchk_symlink(struct xfs_scrub *sc);
105 int xchk_parent(struct xfs_scrub *sc);
106 #ifdef CONFIG_XFS_RT
107 int xchk_rtbitmap(struct xfs_scrub *sc);
108 int xchk_rtsummary(struct xfs_scrub *sc);
109 #else
110 static inline int
111 xchk_rtbitmap(struct xfs_scrub *sc)
112 {
113 return -ENOENT;
114 }
115 static inline int
116 xchk_rtsummary(struct xfs_scrub *sc)
117 {
118 return -ENOENT;
119 }
120 #endif
121 #ifdef CONFIG_XFS_QUOTA
122 int xchk_quota(struct xfs_scrub *sc);
123 #else
124 static inline int
125 xchk_quota(struct xfs_scrub *sc)
126 {
127 return -ENOENT;
128 }
129 #endif
130 int xchk_fscounters(struct xfs_scrub *sc);
131
132
133 void xchk_xref_is_used_space(struct xfs_scrub *sc, xfs_agblock_t agbno,
134 xfs_extlen_t len);
135 void xchk_xref_is_not_inode_chunk(struct xfs_scrub *sc, xfs_agblock_t agbno,
136 xfs_extlen_t len);
137 void xchk_xref_is_inode_chunk(struct xfs_scrub *sc, xfs_agblock_t agbno,
138 xfs_extlen_t len);
139 void xchk_xref_is_owned_by(struct xfs_scrub *sc, xfs_agblock_t agbno,
140 xfs_extlen_t len, const struct xfs_owner_info *oinfo);
141 void xchk_xref_is_not_owned_by(struct xfs_scrub *sc, xfs_agblock_t agbno,
142 xfs_extlen_t len, const struct xfs_owner_info *oinfo);
143 void xchk_xref_has_no_owner(struct xfs_scrub *sc, xfs_agblock_t agbno,
144 xfs_extlen_t len);
145 void xchk_xref_is_cow_staging(struct xfs_scrub *sc, xfs_agblock_t bno,
146 xfs_extlen_t len);
147 void xchk_xref_is_not_shared(struct xfs_scrub *sc, xfs_agblock_t bno,
148 xfs_extlen_t len);
149 #ifdef CONFIG_XFS_RT
150 void xchk_xref_is_used_rt_space(struct xfs_scrub *sc, xfs_rtblock_t rtbno,
151 xfs_extlen_t len);
152 #else
153 # define xchk_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
154 #endif
155
156 struct xchk_fscounters {
157 uint64_t icount;
158 uint64_t ifree;
159 uint64_t fdblocks;
160 unsigned long long icount_min;
161 unsigned long long icount_max;
162 };
163
164 #endif