@@ -332,8 +332,6 @@ void blk_queue_free_zone_bitmaps(struct request_queue *q);
static inline void blk_queue_free_zone_bitmaps(struct request_queue *q) {}
#endif
-struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, sector_t sector);
-
int blk_alloc_devt(struct hd_struct *part, dev_t *devt);
void blk_free_devt(dev_t devt);
void blk_invalidate_devt(dev_t devt);
@@ -358,12 +356,6 @@ static inline int hd_struct_try_get(struct hd_struct *part)
return 1;
}
-static inline void hd_struct_put(struct hd_struct *part)
-{
- if (part->partno)
- percpu_ref_put(&part->ref);
-}
-
static inline void hd_free_part(struct hd_struct *part)
{
free_percpu(part->dkstats);
@@ -349,6 +349,7 @@ struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, sector_t sector)
rcu_read_unlock();
return part;
}
+EXPORT_SYMBOL_GPL(disk_map_sector_rcu);
/**
* disk_has_partitions
@@ -380,6 +380,14 @@ void bd_set_size(struct block_device *bdev, loff_t size);
int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);
long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
+struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, sector_t sector);
+
+static inline void hd_struct_put(struct hd_struct *part)
+{
+ if (part->partno)
+ percpu_ref_put(&part->ref);
+}
+
#ifdef CONFIG_SYSFS
int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk);
void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk);
So they can be used in drivers. Signed-off-by: Song Liu <songliubraving@fb.com> --- block/blk.h | 8 -------- block/genhd.c | 1 + include/linux/genhd.h | 8 ++++++++ 3 files changed, 9 insertions(+), 8 deletions(-)