summaryrefslogtreecommitdiff
path: root/c_src/cmd_format.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-05-04 15:26:14 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-04 15:28:24 -0400
commit52904aa88690f71b8bb84b70645e39cd4962f616 (patch)
tree3f7d7a2580405e9e10d4b51f776616bbd1729b65 /c_src/cmd_format.c
parent2b8a0f0caf676ba7b2944578fb07ce9ce7605f8a (diff)
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>
Diffstat (limited to 'c_src/cmd_format.c')
-rw-r--r--c_src/cmd_format.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/c_src/cmd_format.c b/c_src/cmd_format.c
index e2468350..4bafa171 100644
--- a/c_src/cmd_format.c
+++ b/c_src/cmd_format.c
@@ -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,