Skip to content

Commit daa991b

Browse files
stefan-haberlandMartin Schwidefsky
authored andcommitted
dasd: use aliases for formatted devices during format
Formatting of a previously formatted device is slower than newly format a device when alias devices are available. For already formatted devices the alias devices are not used for formatting. Fix the alias handling for already formatted devices. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 896cb7e commit daa991b

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎drivers/s390/block/dasd.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,12 @@ static int dasd_state_basic_to_known(struct dasd_device *device)
285285
{
286286
int rc;
287287

288+
if (device->discipline->basic_to_known) {
289+
rc = device->discipline->basic_to_known(device);
290+
if (rc)
291+
return rc;
292+
}
293+
288294
if (device->block) {
289295
dasd_profile_exit(&device->block->profile);
290296
debugfs_remove(device->block->debugfs_dentry);
@@ -375,11 +381,6 @@ static int dasd_state_ready_to_basic(struct dasd_device *device)
375381
{
376382
int rc;
377383

378-
if (device->discipline->ready_to_basic) {
379-
rc = device->discipline->ready_to_basic(device);
380-
if (rc)
381-
return rc;
382-
}
383384
device->state = DASD_STATE_BASIC;
384385
if (device->block) {
385386
struct dasd_block *block = device->block;

‎drivers/s390/block/dasd_eckd.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ static int dasd_eckd_online_to_ready(struct dasd_device *device)
20392039
return 0;
20402040
};
20412041

2042-
static int dasd_eckd_ready_to_basic(struct dasd_device *device)
2042+
static int dasd_eckd_basic_to_known(struct dasd_device *device)
20432043
{
20442044
return dasd_alias_remove_device(device);
20452045
};
@@ -4511,7 +4511,7 @@ static struct dasd_discipline dasd_eckd_discipline = {
45114511
.verify_path = dasd_eckd_verify_path,
45124512
.basic_to_ready = dasd_eckd_basic_to_ready,
45134513
.online_to_ready = dasd_eckd_online_to_ready,
4514-
.ready_to_basic = dasd_eckd_ready_to_basic,
4514+
.basic_to_known = dasd_eckd_basic_to_known,
45154515
.fill_geometry = dasd_eckd_fill_geometry,
45164516
.start_IO = dasd_start_IO,
45174517
.term_IO = dasd_term_IO,

‎drivers/s390/block/dasd_int.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ struct dasd_discipline {
304304
*/
305305
int (*basic_to_ready) (struct dasd_device *);
306306
int (*online_to_ready) (struct dasd_device *);
307-
int (*ready_to_basic) (struct dasd_device *);
307+
int (*basic_to_known)(struct dasd_device *);
308308

309309
/* (struct dasd_device *);
310310
* Device operation functions. build_cp creates a ccw chain for

0 commit comments

Comments
 (0)