forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/fs/xfs/scrub/scrub.h
....@@ -62,12 +62,26 @@
6262 struct xfs_inode *ip;
6363 void *buf;
6464 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;
6775
6876 /* State tracking for single-AG operations. */
6977 struct xchk_ag sa;
7078 };
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 */
7185
7286 /* Metadata scrubbers */
7387 int xchk_tester(struct xfs_scrub *sc);
....@@ -113,6 +127,7 @@
113127 return -ENOENT;
114128 }
115129 #endif
130
+int xchk_fscounters(struct xfs_scrub *sc);
116131
117132 /* cross-referencing helpers */
118133 void xchk_xref_is_used_space(struct xfs_scrub *sc, xfs_agblock_t agbno,
....@@ -122,9 +137,9 @@
122137 void xchk_xref_is_inode_chunk(struct xfs_scrub *sc, xfs_agblock_t agbno,
123138 xfs_extlen_t len);
124139 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);
126141 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);
128143 void xchk_xref_has_no_owner(struct xfs_scrub *sc, xfs_agblock_t agbno,
129144 xfs_extlen_t len);
130145 void xchk_xref_is_cow_staging(struct xfs_scrub *sc, xfs_agblock_t bno,
....@@ -138,4 +153,12 @@
138153 # define xchk_xref_is_used_rt_space(sc, rtbno, len) do { } while (0)
139154 #endif
140155
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
+
141164 #endif /* __XFS_SCRUB_SCRUB_H__ */