diff options
author | Stefan Haberland <stefan.haberland@de.ibm.com> | 2011-01-05 06:48:06 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2011-01-05 06:47:30 -0500 |
commit | e4dbb0f2b5dd6a836d0e5c60aa5f573e0bbcf76a (patch) | |
tree | cb18d0b08f2ccc8d6a078456b77f111805777db8 /drivers/s390/block/dasd.c | |
parent | 6f272b9cec285a9610a2acf101f694bc58bed37e (diff) |
[S390] dasd: Add support for raw ECKD access.
Normal I/O operations through the DASD device driver give only access
to the data fields of an ECKD device even for track based I/O.
This patch extends the DASD device driver to give access to whole
ECKD tracks including count, key and data fields.
Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 82d9ce36bd0b..4e266f43332d 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -369,6 +369,11 @@ dasd_state_ready_to_online(struct dasd_device * device) | |||
369 | device->state = DASD_STATE_ONLINE; | 369 | device->state = DASD_STATE_ONLINE; |
370 | if (device->block) { | 370 | if (device->block) { |
371 | dasd_schedule_block_bh(device->block); | 371 | dasd_schedule_block_bh(device->block); |
372 | if ((device->features & DASD_FEATURE_USERAW)) { | ||
373 | disk = device->block->gdp; | ||
374 | kobject_uevent(&disk_to_dev(disk)->kobj, KOBJ_CHANGE); | ||
375 | return 0; | ||
376 | } | ||
372 | disk = device->block->bdev->bd_disk; | 377 | disk = device->block->bdev->bd_disk; |
373 | disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0); | 378 | disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0); |
374 | while ((part = disk_part_iter_next(&piter))) | 379 | while ((part = disk_part_iter_next(&piter))) |
@@ -394,7 +399,7 @@ static int dasd_state_online_to_ready(struct dasd_device *device) | |||
394 | return rc; | 399 | return rc; |
395 | } | 400 | } |
396 | device->state = DASD_STATE_READY; | 401 | device->state = DASD_STATE_READY; |
397 | if (device->block) { | 402 | if (device->block && !(device->features & DASD_FEATURE_USERAW)) { |
398 | disk = device->block->bdev->bd_disk; | 403 | disk = device->block->bdev->bd_disk; |
399 | disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0); | 404 | disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0); |
400 | while ((part = disk_part_iter_next(&piter))) | 405 | while ((part = disk_part_iter_next(&piter))) |
@@ -2258,8 +2263,20 @@ static void dasd_setup_queue(struct dasd_block *block) | |||
2258 | { | 2263 | { |
2259 | int max; | 2264 | int max; |
2260 | 2265 | ||
2261 | blk_queue_logical_block_size(block->request_queue, block->bp_block); | 2266 | if (block->base->features & DASD_FEATURE_USERAW) { |
2262 | max = block->base->discipline->max_blocks << block->s2b_shift; | 2267 | /* |
2268 | * the max_blocks value for raw_track access is 256 | ||
2269 | * it is higher than the native ECKD value because we | ||
2270 | * only need one ccw per track | ||
2271 | * so the max_hw_sectors are | ||
2272 | * 2048 x 512B = 1024kB = 16 tracks | ||
2273 | */ | ||
2274 | max = 2048; | ||
2275 | } else { | ||
2276 | max = block->base->discipline->max_blocks << block->s2b_shift; | ||
2277 | } | ||
2278 | blk_queue_logical_block_size(block->request_queue, | ||
2279 | block->bp_block); | ||
2263 | blk_queue_max_hw_sectors(block->request_queue, max); | 2280 | blk_queue_max_hw_sectors(block->request_queue, max); |
2264 | blk_queue_max_segments(block->request_queue, -1L); | 2281 | blk_queue_max_segments(block->request_queue, -1L); |
2265 | /* with page sized segments we can translate each segement into | 2282 | /* with page sized segments we can translate each segement into |