mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
block: make add_partition() return pointer to hd_struct
Make add_partition() return pointer to the new hd_struct on success and ERR_PTR() value on failure. This change will be used to fix md autodetection bug. Signed-off-by: Tejun Heo <[email protected]> Cc: Neil Brown <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
eb60fa1066
commit
ba32929a91
3 changed files with 19 additions and 17 deletions
|
|
@ -18,7 +18,6 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
|
|||
struct disk_part_iter piter;
|
||||
long long start, length;
|
||||
int partno;
|
||||
int err;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EACCES;
|
||||
|
|
@ -61,10 +60,10 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
|
|||
disk_part_iter_exit(&piter);
|
||||
|
||||
/* all seems OK */
|
||||
err = add_partition(disk, partno, start, length,
|
||||
ADDPART_FLAG_NONE);
|
||||
part = add_partition(disk, partno, start, length,
|
||||
ADDPART_FLAG_NONE);
|
||||
mutex_unlock(&bdev->bd_mutex);
|
||||
return err;
|
||||
return IS_ERR(part) ? PTR_ERR(part) : 0;
|
||||
case BLKPG_DEL_PARTITION:
|
||||
part = disk_get_part(disk, partno);
|
||||
if (!part)
|
||||
|
|
|
|||
Loading…
Reference in a new issue