mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-05 20:31:58 +00:00
btrfs-progs: drop argument devid from device_list_add
Drop the devid argument, it can be fetched from the disk_super argument. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
dc9e80192b
commit
60771e72a4
@ -334,11 +334,12 @@ static struct btrfs_fs_devices *find_fsid(u8 *fsid, u8 *metadata_uuid)
|
||||
|
||||
static int device_list_add(const char *path,
|
||||
struct btrfs_super_block *disk_super,
|
||||
u64 devid, struct btrfs_fs_devices **fs_devices_ret)
|
||||
struct btrfs_fs_devices **fs_devices_ret)
|
||||
{
|
||||
struct btrfs_device *device;
|
||||
struct btrfs_fs_devices *fs_devices;
|
||||
u64 found_transid = btrfs_super_generation(disk_super);
|
||||
u64 devid = btrfs_stack_device_id(&disk_super->dev_item);
|
||||
bool metadata_uuid = (btrfs_super_incompat_flags(disk_super) &
|
||||
BTRFS_FEATURE_INCOMPAT_METADATA_UUID);
|
||||
|
||||
@ -545,18 +546,17 @@ int btrfs_scan_one_device(int fd, const char *path,
|
||||
{
|
||||
struct btrfs_super_block disk_super;
|
||||
int ret;
|
||||
u64 devid;
|
||||
|
||||
ret = btrfs_read_dev_super(fd, &disk_super, super_offset, sbflags);
|
||||
if (ret < 0)
|
||||
return -EIO;
|
||||
devid = btrfs_stack_device_id(&disk_super.dev_item);
|
||||
|
||||
if (btrfs_super_flags(&disk_super) & BTRFS_SUPER_FLAG_METADUMP)
|
||||
*total_devs = 1;
|
||||
else
|
||||
*total_devs = btrfs_super_num_devices(&disk_super);
|
||||
|
||||
ret = device_list_add(path, &disk_super, devid, fs_devices_ret);
|
||||
ret = device_list_add(path, &disk_super, fs_devices_ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user