btrfs: add members to fs_devices to track fsid changes
authorNikolay Borisov <nborisov@suse.com>
Tue, 30 Oct 2018 14:43:26 +0000 (16:43 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:38 +0000 (14:51 +0100)
commitd1a63002829a4d8014de20dc141b404cc808405e
tree0734637651debfcf49ac8c20c8711a4924d131bd
parentfbc6feaec98ac0c6a615bbe9e17c5689a1a84650
btrfs: add members to fs_devices to track fsid changes

In order to gracefully handle split-brain scenario during fsid change
(which are very unlikely, yet possible), two more pieces of information
will be necessary:

1. The highest generation number among all devices registered to a
   particular btrfs_fs_devices

2. A boolean flag whether a given btrfs_fs_devices was created by a
   device which had the FSID_CHANGING_V2 flag set.

This is a preparatory patch and just introduces the variables as well
as code which sets them, their actual use is going to happen in a later
patch.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c
fs/btrfs/volumes.h