diff options
author | Tejun Heo <tj@kernel.org> | 2011-08-23 14:01:04 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-08-23 14:01:04 -0400 |
commit | d27769ec3df1a8de9ca450d2dcd72d1ab259ba32 (patch) | |
tree | f17c064e0d8ac26fa80c1c72dccaca053bb55e94 /block/ioctl.c | |
parent | 322a8b034003c0d46d39af85bf24fee27b902f48 (diff) |
block: add GENHD_FL_NO_PART_SCAN
There are cases where suppressing partition scan is useful - e.g. for
lo devices and pseudo SATA devices which advertise to be a disk but
get upset on partition scan (some port multiplier control devices show
such behavior).
This patch adds GENHD_FL_NO_PART_SCAN which suppresses partition scan
regardless of the number of possible partitions. disk_partitionable()
is renamed to disk_part_scan_enabled() as suppressing partition scan
doesn't imply the device can't be partitioned using
BLKPG_ADD/DEL_PARTITION calls from userland. show_partition() now
directly tests disk_max_parts() to maintain backward-compatibility.
-v2: Updated to make it clear that only partition scan is suppressed
not partitioning itself as suggested by Kay Sievers.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/ioctl.c')
-rw-r--r-- | block/ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/ioctl.c b/block/ioctl.c index 1124cd297263..5c74efc01903 100644 --- a/block/ioctl.c +++ b/block/ioctl.c | |||
@@ -101,7 +101,7 @@ static int blkdev_reread_part(struct block_device *bdev) | |||
101 | struct gendisk *disk = bdev->bd_disk; | 101 | struct gendisk *disk = bdev->bd_disk; |
102 | int res; | 102 | int res; |
103 | 103 | ||
104 | if (!disk_partitionable(disk) || bdev != bdev->bd_contains) | 104 | if (!disk_part_scan_enabled(disk) || bdev != bdev->bd_contains) |
105 | return -EINVAL; | 105 | return -EINVAL; |
106 | if (!capable(CAP_SYS_ADMIN)) | 106 | if (!capable(CAP_SYS_ADMIN)) |
107 | return -EACCES; | 107 | return -EACCES; |