aboutsummaryrefslogtreecommitdiffstats
path: root/fs/partitions
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-01-07 02:43:37 -0500
committerJens Axboe <jaxboe@fusionio.com>2011-01-07 02:43:37 -0500
commit6c23a9681c0fe7fb7dd331b39dda11926f43746e (patch)
treebf113a475a17faa866e7e59806378107dcb3aa40 /fs/partitions
parent09e099d4bafea3b15be003d548bdf94b4b6e0e17 (diff)
block: add internal hd part table references
We can't use krefs since it's apparently restricted to very basic reference counting. This reverts commit e4a683c8. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'fs/partitions')
-rw-r--r--fs/partitions/check.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 48209f58522b..011520df71ae 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -381,10 +381,8 @@ static void delete_partition_rcu_cb(struct rcu_head *head)
381 put_device(part_to_dev(part)); 381 put_device(part_to_dev(part));
382} 382}
383 383
384void __delete_partition(struct kref *ref) 384void __delete_partition(struct hd_struct *part)
385{ 385{
386 struct hd_struct *part = container_of(ref, struct hd_struct, ref);
387
388 call_rcu(&part->rcu_head, delete_partition_rcu_cb); 386 call_rcu(&part->rcu_head, delete_partition_rcu_cb);
389} 387}
390 388
@@ -406,7 +404,7 @@ void delete_partition(struct gendisk *disk, int partno)
406 kobject_put(part->holder_dir); 404 kobject_put(part->holder_dir);
407 device_del(part_to_dev(part)); 405 device_del(part_to_dev(part));
408 406
409 kref_put(&part->ref, __delete_partition); 407 hd_struct_put(part);
410} 408}
411 409
412static ssize_t whole_disk_show(struct device *dev, 410static ssize_t whole_disk_show(struct device *dev,
@@ -505,7 +503,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
505 if (!dev_get_uevent_suppress(ddev)) 503 if (!dev_get_uevent_suppress(ddev))
506 kobject_uevent(&pdev->kobj, KOBJ_ADD); 504 kobject_uevent(&pdev->kobj, KOBJ_ADD);
507 505
508 kref_init(&p->ref); 506 hd_ref_init(p);
509 return p; 507 return p;
510 508
511out_free_info: 509out_free_info: