1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_RECOVERY_H
3 #define _BCACHEFS_RECOVERY_H
5 extern const char * const bch2_recovery_passes[];
8 * For when we need to rewind recovery passes and run a pass we skipped:
10 static inline int bch2_run_explicit_recovery_pass(struct bch_fs *c,
11 enum bch_recovery_pass pass)
13 bch_info(c, "running explicit recovery pass %s (%u), currently at %s (%u)",
14 bch2_recovery_passes[pass], pass,
15 bch2_recovery_passes[c->curr_recovery_pass], c->curr_recovery_pass);
17 c->recovery_passes_explicit |= BIT_ULL(pass);
19 if (c->curr_recovery_pass >= pass) {
20 c->curr_recovery_pass = pass;
21 c->recovery_passes_complete &= (1ULL << pass) >> 1;
22 return -BCH_ERR_restart_recovery;
28 u64 bch2_fsck_recovery_passes(void);
30 int bch2_fs_recovery(struct bch_fs *);
31 int bch2_fs_initialize(struct bch_fs *);
33 #endif /* _BCACHEFS_RECOVERY_H */