| .. | .. |
|---|
| 62 | 62 | struct xfs_inode *ip; |
|---|
| 63 | 63 | void *buf; |
|---|
| 64 | 64 | uint ilock_flags; |
|---|
| 65 | | - bool try_harder; |
|---|
| 66 | | - bool has_quotaofflock; |
|---|
| 65 | + |
|---|
| 66 | + /* See the XCHK/XREP state flags below. */ |
|---|
| 67 | + unsigned int flags; |
|---|
| 68 | + |
|---|
| 69 | + /* |
|---|
| 70 | + * The XFS_SICK_* flags that correspond to the metadata being scrubbed |
|---|
| 71 | + * or repaired. We will use this mask to update the in-core fs health |
|---|
| 72 | + * status with whatever we find. |
|---|
| 73 | + */ |
|---|
| 74 | + unsigned int sick_mask; |
|---|
| 67 | 75 | |
|---|
| 68 | 76 | /* State tracking for single-AG operations. */ |
|---|
| 69 | 77 | struct xchk_ag sa; |
|---|
| 70 | 78 | }; |
|---|
| 79 | + |
|---|
| 80 | +/* XCHK state flags grow up from zero, XREP state flags grown down from 2^31 */ |
|---|
| 81 | +#define XCHK_TRY_HARDER (1 << 0) /* can't get resources, try again */ |
|---|
| 82 | +#define XCHK_HAS_QUOTAOFFLOCK (1 << 1) /* we hold the quotaoff lock */ |
|---|
| 83 | +#define XCHK_REAPING_DISABLED (1 << 2) /* background block reaping paused */ |
|---|
| 84 | +#define XREP_ALREADY_FIXED (1 << 31) /* checking our repair work */ |
|---|
| 71 | 85 | |
|---|
| 72 | 86 | /* Metadata scrubbers */ |
|---|
| 73 | 87 | int xchk_tester(struct xfs_scrub *sc); |
|---|
| .. | .. |
|---|
| 113 | 127 | return -ENOENT; |
|---|
| 114 | 128 | } |
|---|
| 115 | 129 | #endif |
|---|
| 130 | +int xchk_fscounters(struct xfs_scrub *sc); |
|---|
| 116 | 131 | |
|---|
| 117 | 132 | /* cross-referencing helpers */ |
|---|
| 118 | 133 | void xchk_xref_is_used_space(struct xfs_scrub *sc, xfs_agblock_t agbno, |
|---|
| .. | .. |
|---|
| 122 | 137 | void xchk_xref_is_inode_chunk(struct xfs_scrub *sc, xfs_agblock_t agbno, |
|---|
| 123 | 138 | xfs_extlen_t len); |
|---|
| 124 | 139 | void xchk_xref_is_owned_by(struct xfs_scrub *sc, xfs_agblock_t agbno, |
|---|
| 125 | | - xfs_extlen_t len, struct xfs_owner_info *oinfo); |
|---|
| 140 | + xfs_extlen_t len, const struct xfs_owner_info *oinfo); |
|---|
| 126 | 141 | void xchk_xref_is_not_owned_by(struct xfs_scrub *sc, xfs_agblock_t agbno, |
|---|
| 127 | | - xfs_extlen_t len, struct xfs_owner_info *oinfo); |
|---|
| 142 | + xfs_extlen_t len, const struct xfs_owner_info *oinfo); |
|---|
| 128 | 143 | void xchk_xref_has_no_owner(struct xfs_scrub *sc, xfs_agblock_t agbno, |
|---|
| 129 | 144 | xfs_extlen_t len); |
|---|
| 130 | 145 | void xchk_xref_is_cow_staging(struct xfs_scrub *sc, xfs_agblock_t bno, |
|---|
| .. | .. |
|---|
| 138 | 153 | # define xchk_xref_is_used_rt_space(sc, rtbno, len) do { } while (0) |
|---|
| 139 | 154 | #endif |
|---|
| 140 | 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 | + |
|---|
| 141 | 164 | #endif /* __XFS_SCRUB_SCRUB_H__ */ |
|---|