summaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-27 16:43:51 +0100
committerJens Axboe <axboe@kernel.dk>2020-12-01 14:53:40 -0700
commit0d02129e76edf91cf04fabf1efbc3a9a1f1d729a (patch)
tree20fd7e1e54d4430038eb74d8e276decee65ee7c3 /fs/block_dev.c
parent9499ffc7521742e3fea32f6ac6c1213b6fc4e914 (diff)
downloadlinux-0d02129e76edf91cf04fabf1efbc3a9a1f1d729a.tar.bz2
block: merge struct block_device and struct hd_struct
Instead of having two structures that represent each block device with different life time rules, merge them into a single one. This also greatly simplifies the reference counting rules, as we can use the inode reference count as the main reference count for the new struct block_device, with the device model reference front ending it for device model interaction. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 61cf33b6284f..a9905d8fd02b 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -39,7 +39,6 @@
struct bdev_inode {
struct block_device bdev;
- struct hd_struct hd;
struct inode vfs_inode;
};
@@ -887,9 +886,6 @@ struct block_device *bdev_alloc(struct gendisk *disk, u8 partno)
iput(inode);
return NULL;
}
- bdev->bd_part = &BDEV_I(inode)->hd;
- memset(bdev->bd_part, 0, sizeof(*bdev->bd_part));
- bdev->bd_part->bdev = bdev;
return bdev;
}
@@ -926,11 +922,6 @@ struct block_device *bdgrab(struct block_device *bdev)
}
EXPORT_SYMBOL(bdgrab);
-struct block_device *bdget_part(struct hd_struct *part)
-{
- return bdget(part_devt(part));
-}
-
long nr_blockdev_pages(void)
{
struct inode *inode;