summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2023-09-06 19:16:41 +0300
committerDavid Sterba <dsterba@suse.com>2023-10-12 17:44:04 +0300
commitcb6eb4757e1ea7867bcfe4b8a8b6199cc803b8c2 (patch)
treeb2b58187b5183d6e58e3751bbf44987418cddce1 /fs
parent1246873114cf6e4cfbd9530ba70911f6c802510d (diff)
downloadlinux-cb6eb4757e1ea7867bcfe4b8a8b6199cc803b8c2.tar.xz
btrfs: comment about fsid and metadata_uuid relationship
Add a comment explaining the relationship between fsid and metadata_uuid in the on-disk superblock and the in-memory struct btrfs_fs_devices. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/volumes.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 2128a032c3b7..576bfcb5b764 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -290,6 +290,15 @@ struct btrfs_fs_devices {
* - Following shall be true at all times:
* - metadata_uuid == btrfs_header::fsid
* - metadata_uuid == btrfs_dev_item::fsid
+ *
+ * - Relations between fsid and metadata_uuid in sb and fs_devices:
+ * - Normal:
+ * fs_devices->fsid == fs_devices->metadata_uuid == sb->fsid
+ * sb->metadata_uuid == 0
+ *
+ * - When the BTRFS_FEATURE_INCOMPAT_METADATA_UUID flag is set:
+ * fs_devices->fsid == sb->fsid
+ * fs_devices->metadata_uuid == sb->metadata_uuid
*/
u8 metadata_uuid[BTRFS_FSID_SIZE];