mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
block: move holder_dir from disk to part0
Move disk->holder_dir to part0->holder_dir. Kill now mostly superflous bdev_get_holder(). While at it, kill superflous kobject_get/put() around holder_dir, slave_dir and cmd_filter creation and collapse disk_sysfs_add_subdirs() into register_disk(). These serve no purpose but obfuscating the code. Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
b7db9956e5
commit
4c46501d16
4 changed files with 6 additions and 29 deletions
|
|
@ -305,16 +305,6 @@ struct device_type part_type = {
|
|||
.release = part_release,
|
||||
};
|
||||
|
||||
static inline void disk_sysfs_add_subdirs(struct gendisk *disk)
|
||||
{
|
||||
struct kobject *k;
|
||||
|
||||
k = kobject_get(&disk_to_dev(disk)->kobj);
|
||||
disk->holder_dir = kobject_create_and_add("holders", k);
|
||||
disk->slave_dir = kobject_create_and_add("slaves", k);
|
||||
kobject_put(k);
|
||||
}
|
||||
|
||||
static void delete_partition_rcu_cb(struct rcu_head *head)
|
||||
{
|
||||
struct hd_struct *part = container_of(head, struct hd_struct, rcu_head);
|
||||
|
|
@ -464,7 +454,8 @@ void register_disk(struct gendisk *disk)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
disk_sysfs_add_subdirs(disk);
|
||||
disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj);
|
||||
disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj);
|
||||
|
||||
/* No minors to use for partitions */
|
||||
if (!disk_partitionable(disk))
|
||||
|
|
@ -592,7 +583,7 @@ void del_gendisk(struct gendisk *disk)
|
|||
disk_stat_set_all(disk, 0);
|
||||
disk->stamp = 0;
|
||||
|
||||
kobject_put(disk->holder_dir);
|
||||
kobject_put(disk->part0.holder_dir);
|
||||
kobject_put(disk->slave_dir);
|
||||
disk->driverfs_dev = NULL;
|
||||
#ifndef CONFIG_SYSFS_DEPRECATED
|
||||
|
|
|
|||
Loading…
Reference in a new issue