X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libbcachefs.h;h=ba5d380768e48db25daa2438e6240ccaccc8e530;hb=d364661521d53cac21891bef4f406574d6332f15;hp=17e8eef3d9998d037c2787e2c431647e5e17e933;hpb=c0e4aea9c85649bb5e551aca7b22596332755a6e;p=bcachefs-tools-debian diff --git a/libbcachefs.h b/libbcachefs.h index 17e8eef..ba5d380 100644 --- a/libbcachefs.h +++ b/libbcachefs.h @@ -32,7 +32,7 @@ void bch2_opts_usage(unsigned); struct format_opts { char *label; - uuid_le uuid; + __uuid_t uuid; unsigned version; unsigned superblock_size; bool encrypted; @@ -41,8 +41,12 @@ struct format_opts { 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, }; } @@ -84,9 +88,9 @@ struct bch_sb *__bch2_super_read(int, u64); int bcachectl_open(void); struct bchfs_handle { - uuid_le uuid; - int ioctl_fd; - int sysfs_fd; + __uuid_t uuid; + int ioctl_fd; + int sysfs_fd; }; void bcache_fs_close(struct bchfs_handle); @@ -235,7 +239,7 @@ struct dev_name { unsigned idx; char *dev; char *label; - uuid_le uuid; + uuid_t uuid; }; typedef DARRAY(struct dev_name) dev_names;