btrfs: add device major-minor info in the struct btrfs_device
authorAnand Jain <anand.jain@oracle.com>
Wed, 12 Jan 2022 05:06:01 +0000 (13:06 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 Feb 2022 15:19:47 +0000 (16:19 +0100)
commit7380537ce730e5d921a979a58174289b8c5ad6fb
tree128fe7912a2766a26fea17da75af2099099edc54
parentb4813c7f0d49fbfc351d953bf8b3bad4005c02e0
btrfs: add device major-minor info in the struct btrfs_device

Internally it is common to use the major-minor number to identify a
device and, at a few locations in btrfs, we use the major-minor number
to match the device.

So when we identify a new btrfs device through device add or device
replace or device-scan/ready save the device's major-minor (dev_t) in the
struct btrfs_device so that we don't have to call lookup_bdev() again.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/dev-replace.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h