diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2012-01-16 15:04:47 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2012-01-16 15:04:47 -0500 |
commit | c9e9f97bdfb64d06e9520f8e4f37674ac21cc9bc (patch) | |
tree | 22d695a7a461068c773b327e5c89a045ade5d8a3 /fs/btrfs/ioctl.h | |
parent | 10ea00f55a07f8f9536d9112b95108a86f700bab (diff) |
Btrfs: add basic restriper infrastructure
Add basic restriper infrastructure: extended balancing ioctl and all
related ioctl data structures, add data structure for tracking
restriper's state to fs_info, etc. The semantics of the old balancing
ioctl are fully preserved.
Explicitly disallow any volume operations when balance is in progress.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/btrfs/ioctl.h')
-rw-r--r-- | fs/btrfs/ioctl.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.h b/fs/btrfs/ioctl.h index 252ae9915de8..c8b37d2c0d77 100644 --- a/fs/btrfs/ioctl.h +++ b/fs/btrfs/ioctl.h | |||
@@ -109,6 +109,47 @@ struct btrfs_ioctl_fs_info_args { | |||
109 | __u64 reserved[124]; /* pad to 1k */ | 109 | __u64 reserved[124]; /* pad to 1k */ |
110 | }; | 110 | }; |
111 | 111 | ||
112 | /* | ||
113 | * this is packed, because it should be exactly the same as its disk | ||
114 | * byte order counterpart (struct btrfs_disk_balance_args) | ||
115 | */ | ||
116 | struct btrfs_balance_args { | ||
117 | __u64 profiles; | ||
118 | __u64 usage; | ||
119 | __u64 devid; | ||
120 | __u64 pstart; | ||
121 | __u64 pend; | ||
122 | __u64 vstart; | ||
123 | __u64 vend; | ||
124 | |||
125 | __u64 target; | ||
126 | |||
127 | __u64 flags; | ||
128 | |||
129 | __u64 unused[8]; | ||
130 | } __attribute__ ((__packed__)); | ||
131 | |||
132 | /* report balance progress to userspace */ | ||
133 | struct btrfs_balance_progress { | ||
134 | __u64 expected; /* estimated # of chunks that will be | ||
135 | * relocated to fulfill the request */ | ||
136 | __u64 considered; /* # of chunks we have considered so far */ | ||
137 | __u64 completed; /* # of chunks relocated so far */ | ||
138 | }; | ||
139 | |||
140 | struct btrfs_ioctl_balance_args { | ||
141 | __u64 flags; /* in/out */ | ||
142 | __u64 state; /* out */ | ||
143 | |||
144 | struct btrfs_balance_args data; /* in/out */ | ||
145 | struct btrfs_balance_args meta; /* in/out */ | ||
146 | struct btrfs_balance_args sys; /* in/out */ | ||
147 | |||
148 | struct btrfs_balance_progress stat; /* out */ | ||
149 | |||
150 | __u64 unused[72]; /* pad to 1k */ | ||
151 | }; | ||
152 | |||
112 | #define BTRFS_INO_LOOKUP_PATH_MAX 4080 | 153 | #define BTRFS_INO_LOOKUP_PATH_MAX 4080 |
113 | struct btrfs_ioctl_ino_lookup_args { | 154 | struct btrfs_ioctl_ino_lookup_args { |
114 | __u64 treeid; | 155 | __u64 treeid; |
@@ -272,6 +313,8 @@ struct btrfs_ioctl_logical_ino_args { | |||
272 | struct btrfs_ioctl_dev_info_args) | 313 | struct btrfs_ioctl_dev_info_args) |
273 | #define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \ | 314 | #define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \ |
274 | struct btrfs_ioctl_fs_info_args) | 315 | struct btrfs_ioctl_fs_info_args) |
316 | #define BTRFS_IOC_BALANCE_V2 _IOWR(BTRFS_IOCTL_MAGIC, 32, \ | ||
317 | struct btrfs_ioctl_balance_args) | ||
275 | #define BTRFS_IOC_INO_PATHS _IOWR(BTRFS_IOCTL_MAGIC, 35, \ | 318 | #define BTRFS_IOC_INO_PATHS _IOWR(BTRFS_IOCTL_MAGIC, 35, \ |
276 | struct btrfs_ioctl_ino_path_args) | 319 | struct btrfs_ioctl_ino_path_args) |
277 | #define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \ | 320 | #define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \ |