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.
18 * Defines and function declarations for users of the mkfs API, no internal
22 #ifndef __BTRFS_MKFS_COMMON_H__
23 #define __BTRFS_MKFS_COMMON_H__
25 #include "kerncompat.h"
26 #include "common-defs.h"
28 #define BTRFS_MKFS_SYSTEM_GROUP_SIZE SZ_4M
29 #define BTRFS_MKFS_SMALL_VOLUME_SIZE SZ_1G
32 * Tree root blocks created during mkfs
34 enum btrfs_mkfs_block
{
45 struct btrfs_mkfs_config
{
46 /* Label of the new filesystem */
52 /* Bitfield of incompat features, BTRFS_FEATURE_INCOMPAT_* */
54 /* Size of the filesystem in bytes */
57 /* Output fields, set during creation */
59 /* Logical addresses of superblock [0] and other tree roots */
60 u64 blocks
[MKFS_BLOCK_COUNT
+ 1];
61 char fs_uuid
[BTRFS_UUID_UNPARSED_SIZE
];
62 char chunk_uuid
[BTRFS_UUID_UNPARSED_SIZE
];
64 /* Superblock offset after make_btrfs */
68 int make_btrfs(int fd
, struct btrfs_mkfs_config
*cfg
);
69 u64
btrfs_min_dev_size(u32 nodesize
, int mixed
, u64 meta_profile
,
71 int test_minimum_size(const char *file
, u64 min_dev_size
);
72 int is_vol_small(const char *file
);
73 int test_num_disk_vs_raid(u64 metadata_profile
, u64 data_profile
,
74 u64 dev_cnt
, int mixed
, int ssd
);
75 int test_status_for_mkfs(const char *file
, bool force_overwrite
);
76 int test_dev_for_mkfs(const char *file
, int force_overwrite
);