summaryrefslogtreecommitdiff
path: root/image/main.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-10-20 00:24:13 +0200
committerDavid Sterba <dsterba@suse.com>2017-11-14 15:59:00 +0100
commitc76b05fba284c68c6cb7b710dbb95a42089e8538 (patch)
treeda624a483b192f345498870b0cff2f6ab59b218b /image/main.c
parent9896b43f70df300feb792487f92b1b1ed87a49ce (diff)
btrfs-progs: image: move metadump definitions to own header
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'image/main.c')
-rw-r--r--image/main.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/image/main.c b/image/main.c
index 4cffbdba..4557f963 100644
--- a/image/main.c
+++ b/image/main.c
@@ -36,54 +36,10 @@
#include "volumes.h"
#include "extent_io.h"
#include "help.h"
-
-#define HEADER_MAGIC 0xbd5c25e27295668bULL
-#define MAX_PENDING_SIZE (256 * 1024)
-#define BLOCK_SIZE 1024
-#define BLOCK_MASK (BLOCK_SIZE - 1)
-
-#define COMPRESS_NONE 0
-#define COMPRESS_ZLIB 1
+#include "image/metadump.h"
#define MAX_WORKER_THREADS (32)
-struct meta_cluster_item {
- __le64 bytenr;
- __le32 size;
-} __attribute__ ((__packed__));
-
-struct meta_cluster_header {
- __le64 magic;
- __le64 bytenr;
- __le32 nritems;
- u8 compress;
-} __attribute__ ((__packed__));
-
-/* cluster header + index items + buffers */
-struct meta_cluster {
- struct meta_cluster_header header;
- struct meta_cluster_item items[];
-} __attribute__ ((__packed__));
-
-#define ITEMS_PER_CLUSTER ((BLOCK_SIZE - sizeof(struct meta_cluster)) / \
- sizeof(struct meta_cluster_item))
-
-struct fs_chunk {
- u64 logical;
- u64 physical;
- /*
- * physical_dup only store additonal physical for BTRFS_BLOCK_GROUP_DUP
- * currently restore only support single and DUP
- * TODO: modify this structure and the function related to this
- * structure for support RAID*
- */
- u64 physical_dup;
- u64 bytes;
- struct rb_node l;
- struct rb_node p;
- struct list_head list;
-};
-
struct async_work {
struct list_head list;
struct list_head ordered;