summaryrefslogtreecommitdiff
path: root/volumes.h
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2013-06-22 13:32:45 +0800
committerChris Mason <chris.mason@fusionio.com>2013-07-03 14:16:10 -0400
commit095e21af458b9c40fc90b3f6901e4c7f2c6d0dd5 (patch)
treed55d3799068194806c8a05f6af89aee5667c2ad7 /volumes.h
parentaa88c0ac37cddd4690c7fb427018276788618621 (diff)
Btrfs-progs: enhance btrfs-image to restore image onto multiple disks
This adds a 'btrfs-image -m' option, which let us restore an image that is built from a btrfs of multiple disks onto several disks altogether. This aims to address the following case, $ mkfs.btrfs -m raid0 sda sdb $ btrfs-image sda image.file $ btrfs-image -r image.file sdc --------- so we can only restore metadata onto sdc, and another thing is we can only mount sdc with degraded mode as we don't provide informations of another disk. And, it's built as RAID0 and we have only one disk, so after mount sdc we'll get into readonly mode. This is just annoying for people(like me) who're trying to restore image but turn to find they cannot make it work. So this'll make your life easier, just tap $ btrfs-image -m image.file sdc sdd --------- then you get everything about metadata done, the same offset with that of the originals(of course, you need offer enough disk size, at least the disk size of the original disks). Besides, this also works with raid5 and raid6 metadata image. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'volumes.h')
-rw-r--r--volumes.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/volumes.h b/volumes.h
index 911f7881..105179fa 100644
--- a/volumes.h
+++ b/volumes.h
@@ -190,4 +190,9 @@ int btrfs_add_system_chunk(struct btrfs_trans_handle *trans,
int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset);
struct btrfs_device *btrfs_find_device_by_devid(struct btrfs_root *root,
u64 devid, int instance);
+
+int write_raid56_with_parity(struct btrfs_fs_info *info,
+ struct extent_buffer *eb,
+ struct btrfs_multi_bio *multi,
+ u64 stripe_len, u64 *raid_map);
#endif