summaryrefslogtreecommitdiff
path: root/ctree.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-08-19 16:40:14 +0200
committerDavid Sterba <dsterba@suse.com>2016-08-24 14:36:58 +0200
commit3c350dec06da272fed7ef1ea0eb5031131c77671 (patch)
tree1f5aebbdf12538bd918b45dbc6f3cb1e2ec3c8c7 /ctree.h
parent059832da5f533d5ddf6ba15b7a190efe5a09ea8c (diff)
btrfs-progs: introduce signature for a partially set up filesystem
Currently the superblock is created first, with a valid signaure, but the rest of the filesystem is missing. When the creation process is interrupted, the filesystem still might be considered as valid. To prevent that, create the filesytem with an invalid signature that would be still recognized during the mkfs process, and finalize at the end. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'ctree.h')
-rw-r--r--ctree.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/ctree.h b/ctree.h
index b9fb732c..89e47abd 100644
--- a/ctree.h
+++ b/ctree.h
@@ -40,6 +40,12 @@ struct btrfs_trans_handle;
struct btrfs_free_space_ctl;
#define BTRFS_MAGIC 0x4D5F53665248425FULL /* ascii _BHRfS_M, no null */
+/*
+ * Fake signature for an unfinalized filesystem, structures might be partially
+ * created or missing.
+ */
+#define BTRFS_MAGIC_PARTIAL 0x4D5F536652484221ULL /* ascii !BHRfS_M, no null */
+
#define BTRFS_MAX_MIRRORS 3
#define BTRFS_MAX_LEVEL 8