summaryrefslogtreecommitdiffstats
path: root/block/partitions
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-24 09:34:00 +0100
committerJens Axboe <axboe@kernel.dk>2020-12-01 22:53:40 +0100
commit15e3d2c5cd53298272e59ad9072d3468f9dd3781 (patch)
treee526446b6b09c036e9aed966dbe2bdd252f5bb98 /block/partitions
parentblock: remove the nr_sects field in struct hd_struct (diff)
downloadlinux-15e3d2c5cd53298272e59ad9072d3468f9dd3781.tar.xz
linux-15e3d2c5cd53298272e59ad9072d3468f9dd3781.zip
block: move disk stat accounting to struct block_device
Move the dkstats and stamp field to struct block_device in preparation of killing struct hd_struct. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/partitions')
-rw-r--r--block/partitions/core.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c
index bcfa8215bd5e..8924e1ea8b2a 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -409,14 +409,9 @@ static struct hd_struct *add_partition(struct gendisk *disk, int partno,
if (!p)
return ERR_PTR(-EBUSY);
- err = -ENOMEM;
- p->dkstats = alloc_percpu(struct disk_stats);
- if (!p->dkstats)
- goto out_free;
-
bdev = bdev_alloc(disk, partno);
if (!bdev)
- goto out_free_stats;
+ goto out_free;
p->bdev = bdev;
pdev = part_to_dev(p);
@@ -490,8 +485,6 @@ out_free_info:
kfree(p->info);
out_bdput:
bdput(bdev);
-out_free_stats:
- free_percpu(p->dkstats);
out_free:
kfree(p);
return ERR_PTR(err);