summaryrefslogtreecommitdiff
path: root/block/genhd.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-04-28 19:01:39 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2024-05-03 02:36:21 -0400
commit2638c20876734f986fd91cfbe196483835ed7095 (patch)
tree1cb487635c21b1a5bc1a1688f7054dceaba7c4cb /block/genhd.c
parent186ddac2072a8134798d72635d1ed0f29889369d (diff)
downloadlwn-2638c20876734f986fd91cfbe196483835ed7095.tar.gz
lwn-2638c20876734f986fd91cfbe196483835ed7095.zip
missing helpers: bdev_unhash(), bdev_drop()
bdev_unhash(): make block device invisible to lookups by device number bdev_drop(): drop reference to associated inode. Both are internal, for use by genhd and partition-related code - similar to bdev_add(). The logics in there (especially the lifetime-related parts of it) ought to be cleaned up, but that's a separate story; here we just encapsulate getting to associated inode. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c
index bb29a68e1d67..93f5118b7d41 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -656,7 +656,7 @@ void del_gendisk(struct gendisk *disk)
*/
mutex_lock(&disk->open_mutex);
xa_for_each(&disk->part_tbl, idx, part)
- remove_inode_hash(part->bd_inode);
+ bdev_unhash(part);
mutex_unlock(&disk->open_mutex);
/*
@@ -1191,7 +1191,7 @@ static void disk_release(struct device *dev)
if (test_bit(GD_ADDED, &disk->state) && disk->fops->free_disk)
disk->fops->free_disk(disk);
- iput(disk->part0->bd_inode); /* frees the disk */
+ bdev_drop(disk->part0); /* frees the disk */
}
static int block_uevent(const struct device *dev, struct kobj_uevent_env *env)
@@ -1381,7 +1381,7 @@ out_erase_part0:
out_destroy_part_tbl:
xa_destroy(&disk->part_tbl);
disk->part0->bd_disk = NULL;
- iput(disk->part0->bd_inode);
+ bdev_drop(disk->part0);
out_free_bdi:
bdi_put(disk->bdi);
out_free_bioset: