struct format_opts {
char *label;
- uuid_le uuid;
+ __uuid_t uuid;
unsigned version;
unsigned superblock_size;
bool encrypted;
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,
};
}
struct dev_opts {
int fd;
char *path;
- u64 size; /* 512 byte sectors */
- unsigned bucket_size;
+ u64 size; /* bytes*/
+ u64 bucket_size; /* bytes */
const char *label;
unsigned data_allowed;
unsigned durability;
void bch2_super_write(int, struct bch_sb *);
struct bch_sb *__bch2_super_read(int, u64);
-void bch2_sb_print(struct bch_sb *, bool, unsigned, enum units);
-
/* ioctl interface: */
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);
unsigned idx;
char *dev;
char *label;
- uuid_le uuid;
+ uuid_t uuid;
};
-typedef darray(struct dev_name) dev_names;
+typedef DARRAY(struct dev_name) dev_names;
dev_names bchu_fs_get_devices(struct bchfs_handle);