aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/genhd.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-03-24 08:25:14 +0100
committerJens Axboe <axboe@kernel.dk>2020-03-24 07:57:07 -0600
commitf17c21c1ecb80e957bafa07d6454836854be7cf2 (patch)
treedefb8d2c974a8ba695f4a109e2217b994142b459 /include/linux/genhd.h
parentblock: move sysfs methods shared by disks and partitions to genhd.c (diff)
downloadwireguard-linux-f17c21c1ecb80e957bafa07d6454836854be7cf2.tar.xz
wireguard-linux-f17c21c1ecb80e957bafa07d6454836854be7cf2.zip
block: remove alloc_part_info and free_part_info
There isn't any good reason not to simply open code the allocation and freeing of the partition_meta_info structure. Especially as one of the branches in alloc_part_info is entirely dead code. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/genhd.h')
-rw-r--r--include/linux/genhd.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 612d38fce55c..77f8bb8edfcd 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -465,19 +465,6 @@ void part_dec_in_flight(struct request_queue *q, struct hd_struct *part,
void part_inc_in_flight(struct request_queue *q, struct hd_struct *part,
int rw);
-static inline struct partition_meta_info *alloc_part_info(struct gendisk *disk)
-{
- if (disk)
- return kzalloc_node(sizeof(struct partition_meta_info),
- GFP_KERNEL, disk->node_id);
- return kzalloc(sizeof(struct partition_meta_info), GFP_KERNEL);
-}
-
-static inline void free_part_info(struct hd_struct *part)
-{
- kfree(part->info);
-}
-
void update_io_ticks(struct hd_struct *part, unsigned long now);
/* block/genhd.c */
@@ -755,7 +742,7 @@ static inline void hd_struct_kill(struct hd_struct *part)
static inline void hd_free_part(struct hd_struct *part)
{
free_part_stats(part);
- free_part_info(part);
+ kfree(part->info);
percpu_ref_exit(&part->ref);
}