]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/bcachefs_ioctl.h
Update bcachefs sources to 44ac32df8e0c bcachefs: Split brain detection
[bcachefs-tools-debian] / libbcachefs / bcachefs_ioctl.h
index 18eb325401cf647662ed0b2ec1d1d623669214ae..4b8fba754b1c13f069bb6d1a199d94e591a62668 100644 (file)
@@ -81,6 +81,11 @@ struct bch_ioctl_incremental {
 #define BCH_IOCTL_SUBVOLUME_CREATE _IOW(0xbc,  16,  struct bch_ioctl_subvolume)
 #define BCH_IOCTL_SUBVOLUME_DESTROY _IOW(0xbc, 17,  struct bch_ioctl_subvolume)
 
+#define BCH_IOCTL_DEV_USAGE_V2 _IOWR(0xbc,     18, struct bch_ioctl_dev_usage_v2)
+
+#define BCH_IOCTL_FSCK_OFFLINE _IOW(0xbc,      19,  struct bch_ioctl_fsck_offline)
+#define BCH_IOCTL_FSCK_ONLINE  _IOW(0xbc,      20,  struct bch_ioctl_fsck_online)
+
 /* ioctl below act on a particular file, not the filesystem as a whole: */
 
 #define BCHFS_IOC_REINHERIT_ATTRS      _IOR(0xbc, 64, const char __user *)
@@ -274,7 +279,7 @@ struct bch_ioctl_fs_usage {
        __u32                   replica_entries_bytes;
        __u32                   pad;
 
-       struct bch_replicas_usage replicas[0];
+       struct bch_replicas_usage replicas[];
 };
 
 /*
@@ -298,7 +303,20 @@ struct bch_ioctl_dev_usage {
                __u64           buckets;
                __u64           sectors;
                __u64           fragmented;
-       }                       d[BCH_DATA_NR];
+       }                       d[10];
+};
+
+struct bch_ioctl_dev_usage_v2 {
+       __u64                   dev;
+       __u32                   flags;
+       __u8                    state;
+       __u8                    nr_data_types;
+       __u8                    pad[6];
+
+       __u32                   bucket_size;
+       __u64                   nr_buckets;
+
+       struct bch_ioctl_dev_usage_type d[];
 };
 
 /*
@@ -371,4 +389,24 @@ struct bch_ioctl_subvolume {
 #define BCH_SUBVOL_SNAPSHOT_CREATE     (1U << 0)
 #define BCH_SUBVOL_SNAPSHOT_RO         (1U << 1)
 
+/*
+ * BCH_IOCTL_FSCK_OFFLINE: run fsck from the 'bcachefs fsck' userspace command,
+ * but with the kernel's implementation of fsck:
+ */
+struct bch_ioctl_fsck_offline {
+       __u64                   flags;
+       __u64                   opts;           /* string */
+       __u64                   nr_devs;
+       __u64                   devs[] __counted_by(nr_devs);
+};
+
+/*
+ * BCH_IOCTL_FSCK_ONLINE: run fsck from the 'bcachefs fsck' userspace command,
+ * but with the kernel's implementation of fsck:
+ */
+struct bch_ioctl_fsck_online {
+       __u64                   flags;
+       __u64                   opts;           /* string */
+};
+
 #endif /* _BCACHEFS_IOCTL_H */