summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-01-07 08:43:37 +0100
committerJens Axboe <jaxboe@fusionio.com>2011-01-07 08:43:37 +0100
commit6c23a9681c0fe7fb7dd331b39dda11926f43746e (patch)
treebf113a475a17faa866e7e59806378107dcb3aa40 /fs
parent09e099d4bafea3b15be003d548bdf94b4b6e0e17 (diff)
downloadop-kernel-dev-6c23a9681c0fe7fb7dd331b39dda11926f43746e.zip
op-kernel-dev-6c23a9681c0fe7fb7dd331b39dda11926f43746e.tar.gz
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')
-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 48209f5..011520d 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)
put_device(part_to_dev(part));
}
-void __delete_partition(struct kref *ref)
+void __delete_partition(struct hd_struct *part)
{
- struct hd_struct *part = container_of(ref, struct hd_struct, ref);
-
call_rcu(&part->rcu_head, delete_partition_rcu_cb);
}
@@ -406,7 +404,7 @@ void delete_partition(struct gendisk *disk, int partno)
kobject_put(part->holder_dir);
device_del(part_to_dev(part));
- kref_put(&part->ref, __delete_partition);
+ hd_struct_put(part);
}
static ssize_t whole_disk_show(struct device *dev,
@@ -505,7 +503,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
if (!dev_get_uevent_suppress(ddev))
kobject_uevent(&pdev->kobj, KOBJ_ADD);
- kref_init(&p->ref);
+ hd_ref_init(p);
return p;
out_free_info:
OpenPOWER on IntegriCloud