]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/bcachefs_ioctl.h
Update bcachefs sources to fd381c355c bcachefs: Fix a null ptr deref in fsck check_ex...
[bcachefs-tools-debian] / libbcachefs / bcachefs_ioctl.h
index f679fc2151bc4cfdd2e18a42674352f87e7fba7e..ad47a506a907651bf1ead3bfa0c29c3efb04cc05 100644 (file)
@@ -78,6 +78,9 @@ struct bch_ioctl_incremental {
 #define BCH_IOCTL_DISK_RESIZE  _IOW(0xbc,      14,  struct bch_ioctl_disk_resize)
 #define BCH_IOCTL_DISK_RESIZE_JOURNAL _IOW(0xbc,15,  struct bch_ioctl_disk_resize_journal)
 
+#define BCH_IOCTL_SUBVOLUME_CREATE _IOW(0xbc,  16,  struct bch_ioctl_subvolume)
+#define BCH_IOCTL_SUBVOLUME_DESTROY _IOW(0xbc, 17,  struct bch_ioctl_subvolume)
+
 /* ioctl below act on a particular file, not the filesystem as a whole: */
 
 #define BCHFS_IOC_REINHERIT_ATTRS      _IOR(0xbc, 64, const char __user *)
@@ -205,7 +208,7 @@ struct bch_ioctl_data {
                __u64           pad[8];
        };
        };
-} __attribute__((packed, aligned(8)));
+} __packed __aligned(8);
 
 enum bch_data_event {
        BCH_DATA_EVENT_PROGRESS = 0,
@@ -221,7 +224,7 @@ struct bch_ioctl_data_progress {
 
        __u64                   sectors_done;
        __u64                   sectors_total;
-} __attribute__((packed, aligned(8)));
+} __packed __aligned(8);
 
 struct bch_ioctl_data_event {
        __u8                    type;
@@ -230,12 +233,12 @@ struct bch_ioctl_data_event {
        struct bch_ioctl_data_progress p;
        __u64                   pad2[15];
        };
-} __attribute__((packed, aligned(8)));
+} __packed __aligned(8);
 
 struct bch_replicas_usage {
        __u64                   sectors;
        struct bch_replicas_entry r;
-} __attribute__((packed));
+} __packed;
 
 static inline struct bch_replicas_usage *
 replicas_usage_next(struct bch_replicas_usage *u)
@@ -282,13 +285,14 @@ struct bch_ioctl_dev_usage {
 
        __u32                   bucket_size;
        __u64                   nr_buckets;
-       __u64                   available_buckets;
 
-       __u64                   buckets[BCH_DATA_NR];
-       __u64                   sectors[BCH_DATA_NR];
+       __u64                   buckets_ec;
 
-       __u64                   ec_buckets;
-       __u64                   ec_sectors;
+       struct bch_ioctl_dev_usage_type {
+               __u64           buckets;
+               __u64           sectors;
+               __u64           fragmented;
+       }                       d[BCH_DATA_NR];
 };
 
 /*
@@ -349,4 +353,16 @@ struct bch_ioctl_disk_resize_journal {
        __u64                   nbuckets;
 };
 
+struct bch_ioctl_subvolume {
+       __u32                   flags;
+       __u32                   dirfd;
+       __u16                   mode;
+       __u16                   pad[3];
+       __u64                   dst_ptr;
+       __u64                   src_ptr;
+};
+
+#define BCH_SUBVOL_SNAPSHOT_CREATE     (1U << 0)
+#define BCH_SUBVOL_SNAPSHOT_RO         (1U << 1)
+
 #endif /* _BCACHEFS_IOCTL_H */