#define ADDPART_FLAG_NONE      0
 #define ADDPART_FLAG_RAID      1
 #define ADDPART_FLAG_WHOLEDISK 2
-void __delete_partition(struct percpu_ref *ref);
 void delete_partition(struct gendisk *disk, struct hd_struct *part);
 int bdev_add_partition(struct block_device *bdev, int partno,
                sector_t start, sector_t length);
 int bdev_resize_partition(struct block_device *bdev, int partno,
                sector_t start, sector_t length);
 int disk_expand_part_tbl(struct gendisk *disk, int target);
-
-static inline int hd_ref_init(struct hd_struct *part)
-{
-       if (percpu_ref_init(&part->ref, __delete_partition, 0,
-                               GFP_KERNEL))
-               return -ENOMEM;
-       return 0;
-}
+int hd_ref_init(struct hd_struct *part);
 
 static inline void hd_struct_get(struct hd_struct *part)
 {
 
        .uevent         = part_uevent,
 };
 
-static void delete_partition_work_fn(struct work_struct *work)
+static void hd_struct_free_work(struct work_struct *work)
 {
-       struct hd_struct *part = container_of(to_rcu_work(work), struct hd_struct,
-                                       rcu_work);
+       struct hd_struct *part =
+               container_of(to_rcu_work(work), struct hd_struct, rcu_work);
 
        part->start_sect = 0;
        part->nr_sects = 0;
        put_device(part_to_dev(part));
 }
 
-void __delete_partition(struct percpu_ref *ref)
+static void hd_struct_free(struct percpu_ref *ref)
 {
        struct hd_struct *part = container_of(ref, struct hd_struct, ref);
-       INIT_RCU_WORK(&part->rcu_work, delete_partition_work_fn);
+
+       INIT_RCU_WORK(&part->rcu_work, hd_struct_free_work);
        queue_rcu_work(system_wq, &part->rcu_work);
 }
 
+int hd_ref_init(struct hd_struct *part)
+{
+       if (percpu_ref_init(&part->ref, hd_struct_free, 0, GFP_KERNEL))
+               return -ENOMEM;
+       return 0;
+}
+
 /*
  * Must be called either with bd_mutex held, before a disk can be opened or
  * after all disk users are gone.