diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-12 06:53:43 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-12 06:53:43 -0800 |
commit | d252e12accd8b4fdc0e50b539370b203f3894de9 (patch) | |
tree | 075bef138b2a3bfe4a935dacfaa68d55cb0db7c1 /include | |
parent | 3bf874183a518cc1bf785d9944de05cf51a177d3 (diff) |
Refactoring for device specific commands
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bcache-ioctl.h | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/include/linux/bcache-ioctl.h b/include/linux/bcache-ioctl.h index 7a0513cd..2d07666c 100644 --- a/include/linux/bcache-ioctl.h +++ b/include/linux/bcache-ioctl.h @@ -8,8 +8,6 @@ extern "C" { #endif -/* global control dev: */ - #define BCH_FORCE_IF_DATA_LOST (1 << 0) #define BCH_FORCE_IF_METADATA_LOST (1 << 1) #define BCH_FORCE_IF_DATA_DEGRADED (1 << 2) @@ -19,24 +17,12 @@ extern "C" { (BCH_FORCE_IF_DATA_DEGRADED| \ BCH_FORCE_IF_METADATA_DEGRADED) -#define BCH_IOCTL_ASSEMBLE _IOW('r', 1, struct bch_ioctl_assemble) -#define BCH_IOCTL_INCREMENTAL _IOW('r', 1, struct bch_ioctl_incremental) - -/* cache set control dev: */ +#define BCH_BY_UUID (1 << 4) -#define BCH_IOCTL_RUN _IO('r', 2) -#define BCH_IOCTL_STOP _IO('r', 3) - -#define BCH_IOCTL_DISK_ADD _IOW('r', 4, struct bch_ioctl_disk_add) -#define BCH_IOCTL_DISK_REMOVE _IOW('r', 5, struct bch_ioctl_disk_remove) -#define BCH_IOCTL_DISK_SET_STATE _IOW('r', 6, struct bch_ioctl_disk_set_state) - -#define BCH_IOCTL_DISK_REMOVE_BY_UUID \ - _IOW('r', 5, struct bch_ioctl_disk_remove_by_uuid) -#define BCH_IOCTL_DISK_FAIL_BY_UUID \ - _IOW('r', 6, struct bch_ioctl_disk_fail_by_uuid) +/* global control dev: */ -#define BCH_IOCTL_QUERY_UUID _IOR('r', 6, struct bch_ioctl_query_uuid) +#define BCH_IOCTL_ASSEMBLE _IOW(0xbc, 1, struct bch_ioctl_assemble) +#define BCH_IOCTL_INCREMENTAL _IOW(0xbc, 2, struct bch_ioctl_incremental) struct bch_ioctl_assemble { __u32 flags; @@ -51,13 +37,29 @@ struct bch_ioctl_incremental { __u64 dev; }; -struct bch_ioctl_disk_add { +/* filesystem ioctls: */ + +#define BCH_IOCTL_QUERY_UUID _IOR(0xbc, 1, struct bch_ioctl_query_uuid) +#define BCH_IOCTL_START _IOW(0xbc, 2, struct bch_ioctl_start) +#define BCH_IOCTL_STOP _IO(0xbc, 3) +#define BCH_IOCTL_DISK_ADD _IOW(0xbc, 4, struct bch_ioctl_disk) +#define BCH_IOCTL_DISK_REMOVE _IOW(0xbc, 5, struct bch_ioctl_disk) +#define BCH_IOCTL_DISK_ONLINE _IOW(0xbc, 6, struct bch_ioctl_disk) +#define BCH_IOCTL_DISK_OFFLINE _IOW(0xbc, 7, struct bch_ioctl_disk) +#define BCH_IOCTL_DISK_SET_STATE _IOW(0xbc, 8, struct bch_ioctl_disk_set_state) +#define BCH_IOCTL_DISK_EVACUATE _IOW(0xbc, 9, struct bch_ioctl_disk) +#define BCH_IOCTL_DATA _IOW(0xbc, 10, struct bch_ioctl_data) + +struct bch_ioctl_query_uuid { + uuid_le uuid; +}; + +struct bch_ioctl_start { __u32 flags; __u32 pad; - __u64 dev; }; -struct bch_ioctl_disk_remove { +struct bch_ioctl_disk { __u32 flags; __u32 pad; __u64 dev; @@ -70,20 +72,21 @@ struct bch_ioctl_disk_set_state { __u64 dev; }; -struct bch_ioctl_disk_remove_by_uuid { - __u32 flags; - __u32 pad; - uuid_le dev; -}; +#define BCH_REWRITE_INCREASE_REPLICAS (1 << 0) +#define BCH_REWRITE_DECREASE_REPLICAS (1 << 1) -struct bch_ioctl_disk_fail_by_uuid { +#define BCH_REWRITE_RECOMPRESS (1 << 0) +#define BCH_REWRITE_DECREASE_REPLICAS (1 << 1) + +struct bch_ioctl_data { __u32 flags; __u32 pad; - uuid_le dev; -}; -struct bch_ioctl_query_uuid { - uuid_le uuid; + __u64 start_inode; + __u64 start_offset; + + __u64 end_inode; + __u64 end_offset; }; #ifdef __cplusplus |