summaryrefslogtreecommitdiff
path: root/mkfs/common.h
diff options
context:
space:
mode:
authorMisono, Tomohiro <misono.tomohiro@jp.fujitsu.com>2017-11-24 14:21:15 +0900
committerDavid Sterba <dsterba@suse.com>2018-01-03 17:09:57 +0100
commite460ccd6d13bb2cc4939fb860b50964dfbd3c247 (patch)
treeaa77d4581e99d7e78cb7d01fd411a739cc34c390 /mkfs/common.h
parentdc06cda3d6afb4fad5ddfd1508a33f79c2e68efb (diff)
btrfs-progs: mkfs: check the status of file at mkfs
Currently, only the status of block devices is checked at mkfs, but we should also check for regular files whether they are already formatted or mounted to prevent overwrite accidentally. Device status is checked by test_dev_for_mkfs(). The part which is not related to block device is split from this and used for both block device and regular file. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'mkfs/common.h')
-rw-r--r--mkfs/common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/mkfs/common.h b/mkfs/common.h
index 3757e9e7..d63c5ebb 100644
--- a/mkfs/common.h
+++ b/mkfs/common.h
@@ -72,6 +72,7 @@ int test_minimum_size(const char *file, u64 min_dev_size);
int is_vol_small(const char *file);
int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
u64 dev_cnt, int mixed, int ssd);
+int test_status_for_mkfs(const char *file, bool force_overwrite);
int test_dev_for_mkfs(const char *file, int force_overwrite);
#endif