diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-07-19 17:20:18 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:37 -0400 |
commit | 1ed0a5d280ef7a1183b42b2fcc13d919925f1b6e (patch) | |
tree | 1bbed805fd079f8991867b0085a00e7c2d0b02de /fs/bcachefs/error.h | |
parent | a0cb8d784f309d22323974e47b103bf01d0b62c0 (diff) |
bcachefs: Convert fsck errors to errcode.h
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/error.h')
-rw-r--r-- | fs/bcachefs/error.h | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/fs/bcachefs/error.h b/fs/bcachefs/error.h index 6e63c38186f3..b603d738c549 100644 --- a/fs/bcachefs/error.h +++ b/fs/bcachefs/error.h @@ -91,14 +91,6 @@ do { \ * be able to repair: */ -enum { - BCH_FSCK_OK = 0, - BCH_FSCK_ERRORS_NOT_FIXED = 1, - BCH_FSCK_REPAIR_UNIMPLEMENTED = 2, - BCH_FSCK_REPAIR_IMPOSSIBLE = 3, - BCH_FSCK_UNKNOWN_VERSION = 4, -}; - enum fsck_err_opts { FSCK_OPT_EXIT, FSCK_OPT_YES, @@ -106,13 +98,6 @@ enum fsck_err_opts { FSCK_OPT_ASK, }; -enum fsck_err_ret { - FSCK_ERR_IGNORE = 0, - FSCK_ERR_FIX = 1, - FSCK_ERR_EXIT = 2, - FSCK_ERR_START_TOPOLOGY_REPAIR = 3, -}; - struct fsck_err_state { struct list_head list; const char *fmt; @@ -127,21 +112,21 @@ struct fsck_err_state { #define FSCK_NO_RATELIMIT (1 << 3) __printf(3, 4) __cold -enum fsck_err_ret bch2_fsck_err(struct bch_fs *, - unsigned, const char *, ...); +int bch2_fsck_err(struct bch_fs *, unsigned, const char *, ...); void bch2_flush_fsck_errs(struct bch_fs *); #define __fsck_err(c, _flags, msg, ...) \ ({ \ - int _fix = bch2_fsck_err(c, _flags, msg, ##__VA_ARGS__);\ + int _ret = bch2_fsck_err(c, _flags, msg, ##__VA_ARGS__); \ \ - if (_fix == FSCK_ERR_EXIT) { \ + if (_ret != -BCH_ERR_fsck_fix && \ + _ret != -BCH_ERR_fsck_ignore) { \ bch_err(c, "Unable to continue, halting"); \ - ret = BCH_FSCK_ERRORS_NOT_FIXED; \ + ret = _ret; \ goto fsck_err; \ } \ \ - _fix; \ + _ret == -BCH_ERR_fsck_fix; \ }) /* These macros return true if error should be fixed: */ |