aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.h
diff options
context:
space:
mode:
authorStefan Behrens <sbehrens@giantdisaster.de>2012-11-05 11:33:06 -0500
committerJosef Bacik <jbacik@fusionio.com>2012-12-12 17:15:41 -0500
commite93c89c1aaaaaec3487c4c18dd02360371790722 (patch)
tree359c310c736d0db5cfd724c628fdb9f2f680a3d3 /fs/btrfs/ioctl.h
parentff023aac31198e88507d626825379b28ea481d4d (diff)
Btrfs: add new sources for device replace code
This adds a new file to the sources together with the header file and the changes to ioctl.h and ctree.h that are required by the new C source file. Additionally, 4 new functions are added to volume.c that deal with device creation and destruction. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/ioctl.h')
-rw-r--r--fs/btrfs/ioctl.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.h b/fs/btrfs/ioctl.h
index 731e2875ab93..62006ba02719 100644
--- a/fs/btrfs/ioctl.h
+++ b/fs/btrfs/ioctl.h
@@ -123,6 +123,48 @@ struct btrfs_ioctl_scrub_args {
123 __u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8]; 123 __u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8];
124}; 124};
125 125
126#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
127#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
128struct btrfs_ioctl_dev_replace_start_params {
129 __u64 srcdevid; /* in, if 0, use srcdev_name instead */
130 __u8 srcdev_name[BTRFS_PATH_NAME_MAX + 1]; /* in */
131 __u8 tgtdev_name[BTRFS_PATH_NAME_MAX + 1]; /* in */
132 __u64 cont_reading_from_srcdev_mode; /* in, see #define
133 * above */
134};
135
136#define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0
137#define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1
138#define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
139#define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3
140#define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4
141struct btrfs_ioctl_dev_replace_status_params {
142 __u64 replace_state; /* out, see #define above */
143 __u64 progress_1000; /* out, 0 <= x <= 1000 */
144 __u64 time_started; /* out, seconds since 1-Jan-1970 */
145 __u64 time_stopped; /* out, seconds since 1-Jan-1970 */
146 __u64 num_write_errors; /* out */
147 __u64 num_uncorrectable_read_errors; /* out */
148};
149
150#define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
151#define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
152#define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
153#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
154#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
155#define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
156struct btrfs_ioctl_dev_replace_args {
157 __u64 cmd; /* in */
158 __u64 result; /* out */
159
160 union {
161 struct btrfs_ioctl_dev_replace_start_params start;
162 struct btrfs_ioctl_dev_replace_status_params status;
163 }; /* in/out */
164
165 __u64 spare[64];
166};
167
126#define BTRFS_DEVICE_PATH_NAME_MAX 1024 168#define BTRFS_DEVICE_PATH_NAME_MAX 1024
127struct btrfs_ioctl_dev_info_args { 169struct btrfs_ioctl_dev_info_args {
128 __u64 devid; /* in/out */ 170 __u64 devid; /* in/out */
@@ -453,4 +495,7 @@ struct btrfs_ioctl_send_args {
453 struct btrfs_ioctl_qgroup_limit_args) 495 struct btrfs_ioctl_qgroup_limit_args)
454#define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \ 496#define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \
455 struct btrfs_ioctl_get_dev_stats) 497 struct btrfs_ioctl_get_dev_stats)
498#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
499 struct btrfs_ioctl_dev_replace_args)
500
456#endif 501#endif