summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/btrfs_tree.h
diff options
context:
space:
mode:
authorNikolay Borisov2018-10-30 15:43:23 +0100
committerDavid Sterba2018-12-17 14:51:37 +0100
commit7239ff4b2be8ec0c3160da7fdd1475785fdb4cb9 (patch)
tree9f78e24bf85c6d3ec165441ced9fd55d5086e104 /include/uapi/linux/btrfs_tree.h
parentbtrfs: use EXPORT_FOR_TESTS for conditionally exported functions (diff)
downloadkernel-qcow2-linux-7239ff4b2be8ec0c3160da7fdd1475785fdb4cb9.tar.gz
kernel-qcow2-linux-7239ff4b2be8ec0c3160da7fdd1475785fdb4cb9.tar.xz
kernel-qcow2-linux-7239ff4b2be8ec0c3160da7fdd1475785fdb4cb9.zip
btrfs: Introduce support for FSID change without metadata rewrite
This field is going to be used when the user wants to change the UUID of the filesystem without having to rewrite all metadata blocks. This field adds another level of indirection such that when the FSID is changed what really happens is the current UUID (the one with which the fs was created) is copied to the 'metadata_uuid' field in the superblock as well as a new incompat flag is set METADATA_UUID. When the kernel detects this flag is set it knows that the superblock in fact has 2 UUIDs: 1. Is the UUID which is user-visible, currently known as FSID. 2. Metadata UUID - this is the UUID which is stamped into all on-disk datastructures belonging to this file system. When the new incompat flag is present device scanning checks whether both fsid/metadata_uuid of the scanned device match any of the registered filesystems. When the flag is not set then both UUIDs are equal and only the FSID is retained on disk, metadata_uuid is set only in-memory during mount. Additionally a new metadata_uuid field is also added to the fs_info struct. It's initialised either with the FSID in case METADATA_UUID incompat flag is not set or with the metdata_uuid of the superblock otherwise. This commit introduces the new fields as well as the new incompat flag and switches all users of the fsid to the new logic. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> [ minor updates in comments ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/uapi/linux/btrfs_tree.h')
-rw-r--r--include/uapi/linux/btrfs_tree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index aff1356c2bb8..e974f4bb5378 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -458,6 +458,7 @@ struct btrfs_free_space_header {
#define BTRFS_SUPER_FLAG_METADUMP (1ULL << 33)
#define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34)
#define BTRFS_SUPER_FLAG_CHANGING_FSID (1ULL << 35)
+#define BTRFS_SUPER_FLAG_CHANGING_FSID_V2 (1ULL << 36)
/*