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
31 struct btrfs_mkfs_config {
32 /* Label of the new filesystem */
38 /* Bitfield of incompat features, BTRFS_FEATURE_INCOMPAT_* */
40 /* Size of the filesystem in bytes */
42 /* Logical addresses of superblock [0] and other tree roots */
45 /* Output fields, set during creation */
46 char fs_uuid[BTRFS_UUID_UNPARSED_SIZE];
47 char chunk_uuid[BTRFS_UUID_UNPARSED_SIZE];
49 /* Superblock offset after make_btrfs */
53 int make_btrfs(int fd, struct btrfs_mkfs_config *cfg);
54 u64 btrfs_min_dev_size(u32 nodesize);
55 u64 btrfs_min_global_blk_rsv_size(u32 nodesize);
56 int test_minimum_size(const char *file, u32 nodesize);
57 int is_vol_small(const char *file);
58 int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
59 u64 dev_cnt, int mixed, int ssd);
60 int test_dev_for_mkfs(const char *file, int force_overwrite);