summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/utils.h b/utils.h
index 33b410c..d53357a 100644
--- a/utils.h
+++ b/utils.h
@@ -109,12 +109,16 @@ void btrfs_parse_features_to_string(char *buf, u64 flags);
struct btrfs_mkfs_config {
char *label;
char *fs_uuid;
+ char *chunk_uuid;
u64 blocks[8];
u64 num_bytes;
u32 nodesize;
u32 sectorsize;
u32 stripesize;
u64 features;
+
+ /* Super bytenr after make_btrfs */
+ u64 super_bytenr;
};
int make_btrfs(int fd, struct btrfs_mkfs_config *cfg);
@@ -167,7 +171,7 @@ int test_dev_for_mkfs(char *file, int force_overwrite);
int get_label_mounted(const char *mount_path, char *labelp);
int get_label_unmounted(const char *dev, char *label);
int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
- u64 dev_cnt, int mixed);
+ u64 dev_cnt, int mixed, int ssd);
int group_profile_max_safe_loss(u64 flags);
int is_vol_small(char *file);
int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,
@@ -247,7 +251,7 @@ int btrfs_check_nodesize(u32 nodesize, u32 sectorsize, u64 features);
const char *get_argv0_buf(void);
-#define HELPINFO_OUTPUT_UNIT \
+#define HELPINFO_UNITS_LONG \
"--raw raw numbers in bytes", \
"--human-readable human friendly numbers, base 1024 (default)", \
"--iec use 1024 as a base (KiB, MiB, GiB, TiB)", \
@@ -257,7 +261,7 @@ const char *get_argv0_buf(void);
"--gbytes show sizes in GiB, or GB with --si", \
"--tbytes show sizes in TiB, or TB with --si"
-#define HELPINFO_OUTPUT_UNIT_DF \
+#define HELPINFO_UNITS_SHORT_LONG \
"-b|--raw raw numbers in bytes", \
"-h|--human-readable", \
" human friendly numbers, base 1024 (default)", \
@@ -270,8 +274,10 @@ const char *get_argv0_buf(void);
"-t|--tbytes show sizes in TiB, or TB with --si"
unsigned int get_unit_mode_from_arg(int *argc, char *argv[], int df_mode);
+void clean_args_no_options(int argc, char *argv[], const char * const *usage);
int string_is_numerical(const char *str);
+__attribute__ ((format (printf, 1, 2)))
static inline void warning(const char *fmt, ...)
{
va_list args;
@@ -283,6 +289,7 @@ static inline void warning(const char *fmt, ...)
fputc('\n', stderr);
}
+__attribute__ ((format (printf, 1, 2)))
static inline void error(const char *fmt, ...)
{
va_list args;
@@ -294,6 +301,7 @@ static inline void error(const char *fmt, ...)
fputc('\n', stderr);
}
+__attribute__ ((format (printf, 2, 3)))
static inline int warning_on(int condition, const char *fmt, ...)
{
va_list args;
@@ -310,6 +318,7 @@ static inline int warning_on(int condition, const char *fmt, ...)
return 1;
}
+__attribute__ ((format (printf, 2, 3)))
static inline int error_on(int condition, const char *fmt, ...)
{
va_list args;