#include "bcachefs.h"
#include "btree_iter.h"
#include "error.h"
#include "journal.h"
#include "recovery_passes.h"
#include "super.h"
#include "thread_with_file.h"
#define FSCK_ERR_RATELIMIT_NR …
bool bch2_inconsistent_error(struct bch_fs *c)
{ … }
int bch2_topology_error(struct bch_fs *c)
{ … }
void bch2_fatal_error(struct bch_fs *c)
{ … }
void bch2_io_error_work(struct work_struct *work)
{ … }
void bch2_io_error(struct bch_dev *ca, enum bch_member_error_type type)
{ … }
enum ask_yn { … };
static enum ask_yn parse_yn_response(char *buf)
{ … }
#ifdef __KERNEL__
static enum ask_yn bch2_fsck_ask_yn(struct bch_fs *c, struct btree_trans *trans)
{ … }
#else
#include "tools-util.h"
static enum ask_yn bch2_fsck_ask_yn(struct bch_fs *c, struct btree_trans *trans)
{
char *buf = NULL;
size_t buflen = 0;
int ret;
do {
fputs(" (y,n, or Y,N for all errors of this type) ", stdout);
fflush(stdout);
if (getline(&buf, &buflen, stdin) < 0)
die("error reading from standard input");
} while ((ret = parse_yn_response(buf)) < 0);
free(buf);
return ret;
}
#endif
static struct fsck_err_state *fsck_err_get(struct bch_fs *c, const char *fmt)
{ … }
static void prt_actioning(struct printbuf *out, const char *action)
{ … }
static const u8 fsck_flags_extra[] = …;
int __bch2_fsck_err(struct bch_fs *c,
struct btree_trans *trans,
enum bch_fsck_flags flags,
enum bch_sb_error_id err,
const char *fmt, ...)
{ … }
void bch2_flush_fsck_errs(struct bch_fs *c)
{ … }