summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-23 21:00:13 +0300
committerJens Axboe <axboe@kernel.dk>2020-12-02 00:53:40 +0300
commit1bdd5ae0251d678488dffcf455d4633c2beef1bc (patch)
tree61e622b31db1406030e2c60225278a0439069a1f /block
parent231926dbf0f084211e4ec4f4c006f0bf1f47809a (diff)
downloadlinux-1bdd5ae0251d678488dffcf455d4633c2beef1bc.tar.xz
block: move holder_dir to struct block_device
Move the holder_dir field to struct block_device in preparation for kill struct hd_struct. 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 'block')
-rw-r--r--block/genhd.c5
-rw-r--r--block/partitions/core.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 4273e89f07e8..0bd7026cee62 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -681,7 +681,8 @@ static void register_disk(struct device *parent, struct gendisk *disk,
*/
pm_runtime_set_memalloc_noio(ddev, true);
- disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj);
+ disk->part0.bdev->bd_holder_dir =
+ kobject_create_and_add("holders", &ddev->kobj);
disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj);
if (disk->flags & GENHD_FL_HIDDEN) {
@@ -887,7 +888,7 @@ void del_gendisk(struct gendisk *disk)
blk_unregister_queue(disk);
- kobject_put(disk->part0.holder_dir);
+ kobject_put(disk->part0.bdev->bd_holder_dir);
kobject_put(disk->slave_dir);
part_stat_set_all(&disk->part0, 0);
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 07df9ff55462..c068471fa654 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -344,7 +344,7 @@ void delete_partition(struct hd_struct *part)
*/
get_device(disk_to_dev(disk));
rcu_assign_pointer(ptbl->part[part->partno], NULL);
- kobject_put(part->holder_dir);
+ kobject_put(part->bdev->bd_holder_dir);
device_del(part_to_dev(part));
/*
@@ -452,8 +452,8 @@ static struct hd_struct *add_partition(struct gendisk *disk, int partno,
goto out_put;
err = -ENOMEM;
- p->holder_dir = kobject_create_and_add("holders", &pdev->kobj);
- if (!p->holder_dir)
+ bdev->bd_holder_dir = kobject_create_and_add("holders", &pdev->kobj);
+ if (!bdev->bd_holder_dir)
goto out_del;
dev_set_uevent_suppress(pdev, 0);
@@ -487,7 +487,7 @@ out_free:
out_remove_file:
device_remove_file(pdev, &dev_attr_whole_disk);
out_del:
- kobject_put(p->holder_dir);
+ kobject_put(bdev->bd_holder_dir);
device_del(pdev);
out_put:
put_device(pdev);