BCACHEFS_KERNEL_ONLY

Add an environment variable that indicates we prefer to run bcachefs
code in the kernel, not userspace - this is for the test environment
where it's easier to debug kernel code.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-05-04 15:26:14 -04:00
parent 2b8a0f0caf
commit 52904aa886
2 changed files with 6 additions and 0 deletions

View File

@ -128,6 +128,9 @@ int cmd_format(int argc, char *argv[])
bch2_cmdline_opts_get(&argc, argv, OPT_FORMAT);
struct bch_opts fs_opts = bch2_parse_opts(fs_opt_strs);
if (getenv("BCACHEFS_KERNEL_ONLY"))
initialize = false;
while ((opt = getopt_long(argc, argv,
"-L:U:g:fqhv",
format_opts,

View File

@ -171,6 +171,9 @@ int cmd_fsck(int argc, char *argv[])
int opt, ret = 0;
struct printbuf opts_str = PRINTBUF;
if (getenv("BCACHEFS_KERNEL_ONLY"))
kernel = true;
append_opt(&opts_str, "degraded");
append_opt(&opts_str, "fsck");
append_opt(&opts_str, "fix_errors=ask");