]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs.h
Update bcachefs sources to 4c2d3669b1 bcachefs: In fsck, pass BTREE_UPDATE_INTERNAL_S...
[bcachefs-tools-debian] / libbcachefs.h
index 6ae24e9f865f89139fa917db9fc2bc1a55cb3f66..17e8eef3d9998d037c2787e2c431647e5e17e933 100644 (file)
@@ -12,6 +12,8 @@
 
 /* option parsing */
 
+#define SUPERBLOCK_SIZE_DEFAULT                2048    /* 1 MB */
+
 struct bch_opt_strs {
 union {
        char                    *by_id[bch2_opts_nr];
@@ -23,6 +25,7 @@ struct {
 };
 };
 
+void bch2_opt_strs_free(struct bch_opt_strs *);
 struct bch_opt_strs bch2_cmdline_opts_get(int *, char *[], unsigned);
 struct bch_opts bch2_parse_opts(struct bch_opt_strs);
 void bch2_opts_usage(unsigned);
@@ -30,9 +33,8 @@ void bch2_opts_usage(unsigned);
 struct format_opts {
        char            *label;
        uuid_le         uuid;
-
-       unsigned        encoded_extent_max;
-
+       unsigned        version;
+       unsigned        superblock_size;
        bool            encrypted;
        char            *passphrase;
 };
@@ -40,16 +42,17 @@ struct format_opts {
 static inline struct format_opts format_opts_default()
 {
        return (struct format_opts) {
-               .encoded_extent_max     = 128,
+               .version                = bcachefs_metadata_version_current,
+               .superblock_size        = SUPERBLOCK_SIZE_DEFAULT,
        };
 }
 
 struct dev_opts {
        int             fd;
        char            *path;
-       u64             size; /* 512 byte sectors */
-       unsigned        bucket_size;
-       const char      *group;
+       u64             size;           /* bytes*/
+       u64             bucket_size;    /* bytes */
+       const char      *label;
        unsigned        data_allowed;
        unsigned        durability;
        bool            discard;
@@ -76,8 +79,6 @@ struct bch_sb *bch2_format(struct bch_opt_strs,
 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);
@@ -90,7 +91,8 @@ struct bchfs_handle {
 
 void bcache_fs_close(struct bchfs_handle);
 struct bchfs_handle bcache_fs_open(const char *);
-struct bchfs_handle bchu_fs_open_by_dev(const char *, unsigned *);
+struct bchfs_handle bchu_fs_open_by_dev(const char *, int *);
+int bchu_dev_path_to_idx(struct bchfs_handle, const char *);
 
 static inline void bchu_disk_add(struct bchfs_handle fs, char *dev)
 {
@@ -235,7 +237,7 @@ struct dev_name {
        char            *label;
        uuid_le         uuid;
 };
-typedef darray(struct dev_name) dev_names;
+typedef DARRAY(struct dev_name) dev_names;
 
 dev_names bchu_fs_get_devices(struct bchfs_handle);