#define ADDPART_FLAG_WHOLEDISK 2
int bdev_add_partition(struct gendisk *disk, int partno, sector_t start,
sector_t length);
#define ADDPART_FLAG_WHOLEDISK 2
int bdev_add_partition(struct gendisk *disk, int partno, sector_t start,
sector_t length);
-int bdev_del_partition(struct block_device *bdev, int partno);
+int bdev_del_partition(struct gendisk *disk, int partno);
int bdev_resize_partition(struct block_device *bdev, int partno,
sector_t start, sector_t length);
int bdev_resize_partition(struct block_device *bdev, int partno,
sector_t start, sector_t length);
return -EINVAL;
if (op == BLKPG_DEL_PARTITION)
return -EINVAL;
if (op == BLKPG_DEL_PARTITION)
- return bdev_del_partition(bdev, p.pno);
+ return bdev_del_partition(disk, p.pno);
start = p.start >> SECTOR_SHIFT;
length = p.length >> SECTOR_SHIFT;
start = p.start >> SECTOR_SHIFT;
length = p.length >> SECTOR_SHIFT;
-int bdev_del_partition(struct block_device *bdev, int partno)
+int bdev_del_partition(struct gendisk *disk, int partno)
{
struct block_device *part = NULL;
int ret = -ENXIO;
{
struct block_device *part = NULL;
int ret = -ENXIO;
- mutex_lock(&bdev->bd_disk->open_mutex);
- part = xa_load(&bdev->bd_disk->part_tbl, partno);
+ mutex_lock(&disk->open_mutex);
+ part = xa_load(&disk->part_tbl, partno);
if (!part)
goto out_unlock;
if (!part)
goto out_unlock;
delete_partition(part);
ret = 0;
out_unlock:
delete_partition(part);
ret = 0;
out_unlock:
- mutex_unlock(&bdev->bd_disk->open_mutex);
+ mutex_unlock(&disk->open_mutex);