diff options
Diffstat (limited to 'fs/partitions/check.c')
-rw-r--r-- | fs/partitions/check.c | 8 |
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 | ||
384 | void __delete_partition(struct kref *ref) | 384 | void __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 | ||
412 | static ssize_t whole_disk_show(struct device *dev, | 410 | static 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 | ||
511 | out_free_info: | 509 | out_free_info: |