diff options
author | Christoph Hellwig <hch@lst.de> | 2020-04-14 09:28:53 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-04-20 11:32:59 -0600 |
commit | fa9156ae597c244df4e12891dc8329f649970d9a (patch) | |
tree | fec1b378659b83f4e755e8d0788dde9dfaa81f0d /block/blk.h | |
parent | b4fd63f42647110c963d4bfcd526ac48f5a5faff (diff) |
block: refactor blkpg_ioctl
Split each sub-command out into a separate helper, and move those helpers
to block/partitions/core.c instead of having a lot of partition
manipulation logic open coded in block/ioctl.c.
Signed-off-by: Christoph Hellwig <hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk.h')
-rw-r--r-- | block/blk.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/block/blk.h b/block/blk.h index 0a94ec68af32..305e0ac22bf7 100644 --- a/block/blk.h +++ b/block/blk.h @@ -389,11 +389,13 @@ char *disk_name(struct gendisk *hd, int partno, char *buf); #define ADDPART_FLAG_NONE 0 #define ADDPART_FLAG_RAID 1 #define ADDPART_FLAG_WHOLEDISK 2 -struct hd_struct *__must_check add_partition(struct gendisk *disk, int partno, - sector_t start, sector_t len, int flags, - struct partition_meta_info *info); void __delete_partition(struct percpu_ref *ref); void delete_partition(struct gendisk *disk, int partno); +int bdev_add_partition(struct block_device *bdev, int partno, + sector_t start, sector_t length); +int bdev_del_partition(struct block_device *bdev, int partno); +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) |