diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-28 12:15:32 -0400 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-29 13:26:13 -0400 |
| commit | 7337f9f14e0e2dbd2da50ade0cd7e58df6c7af6d (patch) | |
| tree | 37cb1fb94e5eaed48bf2ee4073deb34ce75f5f92 /fs/bcachefs/error.h | |
| parent | b00750c2e5f09b90fdd370ff3f9581b880ad86fd (diff) | |
bcachefs: bch2_count_fsck_err()
Factor out a helper from __bch2_fsck_err(), for counting the error in
the superblock and deciding whether to print or ratelimit - will be used
to replace some log_fsck_err() calls, where we want to lift out printing
the error message.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.h')
| -rw-r--r-- | fs/bcachefs/error.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/error.h b/fs/bcachefs/error.h index e3f72e26abdd..542bdbb8d8be 100644 --- a/fs/bcachefs/error.h +++ b/fs/bcachefs/error.h @@ -67,7 +67,7 @@ int bch2_fs_topology_error(struct bch_fs *, const char *, ...); struct fsck_err_state { struct list_head list; - const char *fmt; + enum bch_sb_error_id id; u64 nr; bool ratelimited; int ret; @@ -77,6 +77,12 @@ struct fsck_err_state { #define fsck_err_count(_c, _err) bch2_sb_err_count(_c, BCH_FSCK_ERR_##_err) +void __bch2_count_fsck_err(struct bch_fs *, + enum bch_sb_error_id, const char *, + bool *, bool *, bool *); +#define bch2_count_fsck_err(_c, _err, ...) \ + __bch2_count_fsck_err(_c, BCH_FSCK_ERR_##_err, __VA_ARGS__) + __printf(5, 6) __cold int __bch2_fsck_err(struct bch_fs *, struct btree_trans *, enum bch_fsck_flags, |
