This changes the default version for the format command to be the
currently supported version, via
/sys/modules/bcachefs/parameters/version.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
break;
}
+ if (opts.version != bcachefs_metadata_version_current)
+ initialize = false;
+
if (!devices.nr)
die("Please supply a device");
static inline struct format_opts format_opts_default()
{
+ unsigned version = !access( "/sys/module/bcachefs/parameters/version", R_OK)
+ ? read_file_u64(AT_FDCWD, "/sys/module/bcachefs/parameters/version")
+ : bcachefs_metadata_version_current;
+
return (struct format_opts) {
- .version = bcachefs_metadata_version_current,
+ .version = version,
.superblock_size = SUPERBLOCK_SIZE_DEFAULT,
};
}