aboutsummaryrefslogtreecommitdiff
path: root/include/linux/blk_types.h
diff options
context:
space:
mode:
authorGravatar Christoph Hellwig <hch@lst.de> 2020-11-23 13:29:55 +0100
committerGravatar Jens Axboe <axboe@kernel.dk> 2020-12-01 14:53:39 -0700
commita954ea812018a84d350b316c39a2be3edc4b7ca8 (patch)
treedeb9b830784f4dba4b77e12a5a81d757ef64db5a /include/linux/blk_types.h
parentblock: simplify bdev/disk lookup in blkdev_get (diff)
downloadlinux-a954ea812018a84d350b316c39a2be3edc4b7ca8.tar.gz
linux-a954ea812018a84d350b316c39a2be3edc4b7ca8.tar.bz2
linux-a954ea812018a84d350b316c39a2be3edc4b7ca8.zip
block: remove ->bd_contains
Now that each hd_struct has a reference to the corresponding block_device, there is no need for the bd_contains pointer. Add a bdev_whole() helper to look up the whole device block_device struture instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blk_types.h')
-rw-r--r--include/linux/blk_types.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 9698f459cc65..2e0a9bd9688d 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -32,7 +32,6 @@ struct block_device {
#ifdef CONFIG_SYSFS
struct list_head bd_holder_disks;
#endif
- struct block_device * bd_contains;
u8 bd_partno;
struct hd_struct * bd_part;
/* number of times partitions within this device have been opened. */
@@ -49,6 +48,9 @@ struct block_device {
struct super_block *bd_fsfreeze_sb;
} __randomize_layout;
+#define bdev_whole(_bdev) \
+ ((_bdev)->bd_disk->part0.bdev)
+
#define bdev_kobj(_bdev) \
(&part_to_dev((_bdev)->bd_part)->kobj)