3 #include <linux/types.h>
6 #include "tools-util.h"
8 #define bch_fmt(_c, fmt) fmt "\n"
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"
62 //#include "blockdev.c"
64 #include "btree_cache.c"
67 #include "btree_iter.c"
68 #include "btree_update.c"
70 //#include "chardev.c"
92 //#include "request.c"
102 //#include "writeback.c"
105 #define SHIM_KTYPE(type) \
106 struct kobj_type type ## _ktype = { .release = type ## _release, }
108 static void bch_fs_internal_release(struct kobject *k) {}
110 static void bch_fs_opts_dir_release(struct kobject *k) {}
112 static void bch_fs_time_stats_release(struct kobject *k) {}
116 SHIM_KTYPE(bch_fs_internal);
117 SHIM_KTYPE(bch_fs_time_stats);
118 SHIM_KTYPE(bch_fs_opts_dir);