summaryrefslogtreecommitdiffstats
path: root/block
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 14:57:07 +0100
commitf17c21c1ecb80e957bafa07d6454836854be7cf2 (patch)
treedefb8d2c974a8ba695f4a109e2217b994142b459 /block
parentblock: move sysfs methods shared by disks and partitions to genhd.c (diff)
downloadlinux-f17c21c1ecb80e957bafa07d6454836854be7cf2.tar.xz
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 'block')
-rw-r--r--block/partition-generic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block/partition-generic.c b/block/partition-generic.c
index e6fd2226a639..f2004f3bd6f7 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -249,7 +249,9 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
p->policy = get_disk_ro(disk);
if (info) {
- struct partition_meta_info *pinfo = alloc_part_info(disk);
+ struct partition_meta_info *pinfo;
+
+ pinfo = kzalloc_node(sizeof(*pinfo), GFP_KERNEL, disk->node_id);
if (!pinfo) {
err = -ENOMEM;
goto out_free_stats;
@@ -308,7 +310,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
return p;
out_free_info:
- free_part_info(p);
+ kfree(p->info);
out_free_stats:
free_part_stats(p);
out_free: