diff options
author | Tejun Heo <tj@kernel.org> | 2008-08-25 06:56:11 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:08 -0400 |
commit | 4c46501d1659475dc6c89554af6ce7fe6ecf615c (patch) | |
tree | 03bfdf77e2d20c3190ba62532c783ab7f6a2640d /fs/partitions/check.c | |
parent | b7db9956e57c8151b930d5e5fe5c766e6aad3ff7 (diff) |
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 <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/partitions/check.c')
-rw-r--r-- | fs/partitions/check.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index ace6d03602c7..f0f604950ff4 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -305,16 +305,6 @@ struct device_type part_type = { | |||
305 | .release = part_release, | 305 | .release = part_release, |
306 | }; | 306 | }; |
307 | 307 | ||
308 | static inline void disk_sysfs_add_subdirs(struct gendisk *disk) | ||
309 | { | ||
310 | struct kobject *k; | ||
311 | |||
312 | k = kobject_get(&disk_to_dev(disk)->kobj); | ||
313 | disk->holder_dir = kobject_create_and_add("holders", k); | ||
314 | disk->slave_dir = kobject_create_and_add("slaves", k); | ||
315 | kobject_put(k); | ||
316 | } | ||
317 | |||
318 | static void delete_partition_rcu_cb(struct rcu_head *head) | 308 | static void delete_partition_rcu_cb(struct rcu_head *head) |
319 | { | 309 | { |
320 | struct hd_struct *part = container_of(head, struct hd_struct, rcu_head); | 310 | struct hd_struct *part = container_of(head, struct hd_struct, rcu_head); |
@@ -464,7 +454,8 @@ void register_disk(struct gendisk *disk) | |||
464 | return; | 454 | return; |
465 | } | 455 | } |
466 | #endif | 456 | #endif |
467 | disk_sysfs_add_subdirs(disk); | 457 | disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj); |
458 | disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); | ||
468 | 459 | ||
469 | /* No minors to use for partitions */ | 460 | /* No minors to use for partitions */ |
470 | if (!disk_partitionable(disk)) | 461 | if (!disk_partitionable(disk)) |
@@ -592,7 +583,7 @@ void del_gendisk(struct gendisk *disk) | |||
592 | disk_stat_set_all(disk, 0); | 583 | disk_stat_set_all(disk, 0); |
593 | disk->stamp = 0; | 584 | disk->stamp = 0; |
594 | 585 | ||
595 | kobject_put(disk->holder_dir); | 586 | kobject_put(disk->part0.holder_dir); |
596 | kobject_put(disk->slave_dir); | 587 | kobject_put(disk->slave_dir); |
597 | disk->driverfs_dev = NULL; | 588 | disk->driverfs_dev = NULL; |
598 | #ifndef CONFIG_SYSFS_DEPRECATED | 589 | #ifndef CONFIG_SYSFS_DEPRECATED |