3 #include <linux/types.h>
5 #define bch2_fmt(_c, fmt) fmt "\n"
7 #include "libbcachefs.h"
8 #include "tools-util.h"
10 enum fsck_err_opts fsck_err_opt;
12 /* Returns true if error should be fixed: */
14 /* XXX: flag if we ignore errors */
17 * If it's an error that we can't ignore, and we're running non
18 * interactively - return true and have the error fixed so that we don't have to
19 * bail out and stop the fsck early, so that the user can see all the errors
22 #define __fsck_err(c, _can_fix, _can_ignore, _nofix_msg, msg, ...) \
27 switch (fsck_err_opt) { \
29 printf(msg ": fix?", ##__VA_ARGS__); \
34 bch_err(c, msg ", fixing", ##__VA_ARGS__); \
38 bch_err(c, msg, ##__VA_ARGS__); \
42 } else if (_can_ignore) { \
43 bch_err(c, msg, ##__VA_ARGS__); \
46 if (_can_fix && !_can_ignore && fsck_err_opt == FSCK_ERR_NO) \
49 if (!_fix && !_can_ignore) { \
50 printf("Fatal filesystem inconsistency, halting\n"); \
51 ret = BCH_FSCK_ERRORS_NOT_FIXED; \
61 #include "bkey_methods.c"
63 #include "btree_cache.c"
66 #include "btree_iter.c"
67 #include "btree_update.c"
69 //#include "chardev.c"
98 #define SHIM_KTYPE(type) \
99 struct kobj_type type ## _ktype = { .release = type ## _release, }
101 static void bch2_fs_internal_release(struct kobject *k) {}
103 static void bch2_fs_opts_dir_release(struct kobject *k) {}
105 static void bch2_fs_time_stats_release(struct kobject *k) {}
107 SHIM_KTYPE(bch2_dev);
109 SHIM_KTYPE(bch2_fs_internal);
110 SHIM_KTYPE(bch2_fs_time_stats);
111 SHIM_KTYPE(bch2_fs_opts_dir);