aboutsummaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-08-25 06:56:11 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:08 -0400
commit4c46501d1659475dc6c89554af6ce7fe6ecf615c (patch)
tree03bfdf77e2d20c3190ba62532c783ab7f6a2640d /fs/block_dev.c
parentb7db9956e57c8151b930d5e5fe5c766e6aad3ff7 (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/block_dev.c')
-rw-r--r--fs/block_dev.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index c982a910797..57d57264285 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -548,14 +548,6 @@ static struct kobject *bdev_get_kobj(struct block_device *bdev)
548 return kobject_get(&disk_to_dev(bdev->bd_disk)->kobj); 548 return kobject_get(&disk_to_dev(bdev->bd_disk)->kobj);
549} 549}
550 550
551static struct kobject *bdev_get_holder(struct block_device *bdev)
552{
553 if (bdev->bd_contains != bdev)
554 return kobject_get(bdev->bd_part->holder_dir);
555 else
556 return kobject_get(bdev->bd_disk->holder_dir);
557}
558
559static int add_symlink(struct kobject *from, struct kobject *to) 551static int add_symlink(struct kobject *from, struct kobject *to)
560{ 552{
561 if (!from || !to) 553 if (!from || !to)
@@ -608,7 +600,7 @@ static int bd_holder_grab_dirs(struct block_device *bdev,
608 if (!bo->sdev) 600 if (!bo->sdev)
609 goto fail_put_hdev; 601 goto fail_put_hdev;
610 602
611 bo->hdir = bdev_get_holder(bdev); 603 bo->hdir = kobject_get(bdev->bd_part->holder_dir);
612 if (!bo->hdir) 604 if (!bo->hdir)
613 goto fail_put_sdev; 605 goto fail_put_sdev;
614 606