summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2013-10-08 11:41:38 +0800
committerChris Mason <chris.mason@fusionio.com>2013-10-16 08:23:13 -0400
commit6c2c30ce03c0beba716b5a054b64c6bf62068cb6 (patch)
tree5eafea2455b483a06e7b473b1cd63b84805ce4b7 /utils.h
parenta7131ad1241470829fd5b836ce6cb6c74cdbef45 (diff)
btrfs-progs: use kernel for mounted disk for show
As of now btrfs filesystem show reads directly from disks. So sometimes output can be stale, mainly when user wants to cross verify their operation like, label or device delete or add... etc. so this patch will read from the kernel ioctl if it finds that disk is mounted. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/utils.h b/utils.h
index 7a748266..251ef8e5 100644
--- a/utils.h
+++ b/utils.h
@@ -25,10 +25,17 @@
#define BTRFS_MKFS_SYSTEM_GROUP_SIZE (4 * 1024 * 1024)
-#define BTRFS_SCAN_PROC 1
-#define BTRFS_SCAN_DEV 2
+#define BTRFS_SCAN_PROC (1ULL << 0)
+#define BTRFS_SCAN_DEV (1ULL << 1)
+#define BTRFS_SCAN_MOUNTED (1ULL << 2)
#define BTRFS_SCAN_LBLKID (1ULL << 3)
+#define BTRFS_UPDATE_KERNEL 1
+
+#define BTRFS_ARG_UNKNOWN 0
+#define BTRFS_ARG_PATH 1
+#define BTRFS_ARG_UUID 2
+
int make_btrfs(int fd, const char *device, const char *label,
u64 blocks[6], u64 num_bytes, u32 nodesize,
u32 leafsize, u32 sectorsize, u32 stripesize, u64 features);