diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-04-28 19:01:39 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-05-03 02:36:21 -0400 |
commit | 2638c20876734f986fd91cfbe196483835ed7095 (patch) | |
tree | 1cb487635c21b1a5bc1a1688f7054dceaba7c4cb /block/partitions/core.c | |
parent | 186ddac2072a8134798d72635d1ed0f29889369d (diff) | |
download | linux-2638c20876734f986fd91cfbe196483835ed7095.tar.gz linux-2638c20876734f986fd91cfbe196483835ed7095.tar.bz2 linux-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/partitions/core.c')
-rw-r--r-- | block/partitions/core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c index b11e88c82c8c..2b75e325c63b 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -243,7 +243,7 @@ static const struct attribute_group *part_attr_groups[] = { static void part_release(struct device *dev) { put_disk(dev_to_bdev(dev)->bd_disk); - iput(dev_to_bdev(dev)->bd_inode); + bdev_drop(dev_to_bdev(dev)); } static int part_uevent(const struct device *dev, struct kobj_uevent_env *env) @@ -469,7 +469,7 @@ int bdev_del_partition(struct gendisk *disk, int partno) * Just delete the partition and invalidate it. */ - remove_inode_hash(part->bd_inode); + bdev_unhash(part); invalidate_bdev(part); drop_partition(part); ret = 0; @@ -655,7 +655,7 @@ rescan: * it cannot be looked up any more even when openers * still hold references. */ - remove_inode_hash(part->bd_inode); + bdev_unhash(part); /* * If @disk->open_partitions isn't elevated but there's |