btrfs-progs: kernel-shared: track total_devs in fs devices
Similar to the kernel, introduce the btrfs_fs_devices::total_devs attribute to know the overall count of devices that are expected to be present per filesystem. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
cb53874f6d
commit
26f25402ff
|
@ -367,7 +367,8 @@ static int device_list_add(const char *path,
|
|||
BTRFS_FSID_SIZE);
|
||||
|
||||
fs_devices->latest_devid = devid;
|
||||
fs_devices->latest_trans = found_transid;
|
||||
/* Below we would set this to found_transid */
|
||||
fs_devices->latest_trans = 0;
|
||||
fs_devices->lowest_devid = (u64)-1;
|
||||
fs_devices->chunk_alloc_policy = BTRFS_CHUNK_ALLOC_REGULAR;
|
||||
device = NULL;
|
||||
|
@ -437,6 +438,7 @@ static int device_list_add(const char *path,
|
|||
if (found_transid > fs_devices->latest_trans) {
|
||||
fs_devices->latest_devid = devid;
|
||||
fs_devices->latest_trans = found_transid;
|
||||
fs_devices->total_devices = device->total_devs;
|
||||
}
|
||||
if (fs_devices->lowest_devid > devid) {
|
||||
fs_devices->lowest_devid = devid;
|
||||
|
|
|
@ -91,6 +91,7 @@ struct btrfs_fs_devices {
|
|||
u64 missing_devices;
|
||||
u64 total_rw_bytes;
|
||||
|
||||
u64 total_devices;
|
||||
int latest_bdev;
|
||||
int lowest_bdev;
|
||||
struct list_head devices;
|
||||
|
|
Loading…
Reference in New Issue