summaryrefslogtreecommitdiff
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2022-01-12 08:06:01 +0300
committerDavid Sterba <dsterba@suse.com>2022-03-14 15:13:47 +0300
commit4889bc05a96e039b055bbd11438c40bf956f057b (patch)
tree161cbf1dca6d039fb8528da67d395e93adbd43ca /fs/btrfs/volumes.h
parent16cab91a0c8fea50a03ef9c49ca829e6c0c4cf66 (diff)
downloadlinux-4889bc05a96e039b055bbd11438c40bf956f057b.tar.xz
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>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r--fs/btrfs/volumes.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 38b898bc5f0e..bd297f23d19e 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -72,6 +72,11 @@ struct btrfs_device {
/* the mode sent to blkdev_get */
fmode_t mode;
+ /*
+ * Device's major-minor number. Must be set even if the device is not
+ * opened (bdev == NULL), unless the device is missing.
+ */
+ dev_t devt;
unsigned long dev_state;
blk_status_t last_flush_error;