From 09559bfe7bcd43965bf8d3090f6f761fd785d093 Mon Sep 17 00:00:00 2001 From: Andi Drebes Date: Thu, 9 Sep 2010 10:57:02 +0800 Subject: multidevice support for check_mounted Check_mount() should also work with multi device filesystems. This patch adds checks that allow to detect if a file is a device file used by a mounted single or multi device btrfs or if it is a regular file used by a loopback device that is part of a mounted single or multi device btrfs. The single device checks also work for non-btrfs filesystems. This might be helpful to prevent users from running btrfs programs (e.g. mkfs.btrfs) accidentally on a filesystem used somewhere else. Signed-off-by: Andi Drebes --- utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils.h') diff --git a/utils.h b/utils.h index 7ff542ba..9dce5b05 100644 --- a/utils.h +++ b/utils.h @@ -36,7 +36,7 @@ int btrfs_scan_for_fsid(struct btrfs_fs_devices *fs_devices, u64 total_devs, int run_ioctls); void btrfs_register_one_device(char *fname); int btrfs_scan_one_dir(char *dirname, int run_ioctl); -int check_mounted(char *devicename); +int check_mounted(const char *devicename); int btrfs_device_already_in_root(struct btrfs_root *root, int fd, int super_offset); char *pretty_sizes(u64 size); -- cgit v1.2.3