2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public
4 * License v2 as published by the Free Software Foundation.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 * General Public License for more details.
11 * You should have received a copy of the GNU General Public
12 * License along with this program; if not, write to the
13 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
14 * Boston, MA 021110-1307, USA.
17 #ifndef __BTRFS_IMAGE_METADUMP_H__
18 #define __BTRFS_IMAGE_METADUMP_H__
20 #include "kerncompat.h"
21 #include "kernel-lib/rbtree.h"
22 #include "kernel-lib/list.h"
25 #define HEADER_MAGIC 0xbd5c25e27295668bULL
26 #define MAX_PENDING_SIZE (256 * 1024)
27 #define BLOCK_SIZE 1024
28 #define BLOCK_MASK (BLOCK_SIZE - 1)
30 #define ITEMS_PER_CLUSTER ((BLOCK_SIZE - sizeof(struct meta_cluster)) / \
31 sizeof(struct meta_cluster_item))
33 #define COMPRESS_NONE 0
34 #define COMPRESS_ZLIB 1
36 struct meta_cluster_item
{
39 } __attribute__ ((__packed__
));
41 struct meta_cluster_header
{
46 } __attribute__ ((__packed__
));
48 /* cluster header + index items + buffers */
50 struct meta_cluster_header header
;
51 struct meta_cluster_item items
[];
52 } __attribute__ ((__packed__
));
58 * physical_dup only store additonal physical for BTRFS_BLOCK_GROUP_DUP
59 * currently restore only support single and DUP
60 * TODO: modify this structure and the function related to this
61 * structure for support RAID*
67 struct list_head list
;