Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135589
b: refs/heads/master
c: f9a28f7
h: refs/heads/master
i:
  135587: fa5b7ef
v: v3
  • Loading branch information
Jean-Baptiste Joret authored and Martin Schwidefsky committed Mar 26, 2009
1 parent a3933fe commit 03b0ccb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0000d031703c33b9ea909ad81f03762db66135e1
refs/heads/master: f9a28f7bc5225af476f8d4bb669038da8801b7c4
25 changes: 19 additions & 6 deletions trunk/drivers/s390/block/dasd_eckd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,8 @@ dasd_eckd_format_device(struct dasd_device * device,
int rpt, cyl, head;
int cplength, datasize;
int i;
int intensity = 0;
int r0_perm;

private = (struct dasd_eckd_private *) device->private;
rpt = recs_per_track(&private->rdc_data, 0, fdata->blksize);
Expand Down Expand Up @@ -1296,9 +1298,17 @@ dasd_eckd_format_device(struct dasd_device * device,
* Bit 1: write home address, currently not supported
* Bit 2: invalidate tracks
* Bit 3: use OS/390 compatible disk layout (cdl)
* Bit 4: do not allow storage subsystem to modify record zero
* Only some bit combinations do make sense.
*/
switch (fdata->intensity) {
if (fdata->intensity & 0x10) {
r0_perm = 0;
intensity = fdata->intensity & ~0x10;
} else {
r0_perm = 1;
intensity = fdata->intensity;
}
switch (intensity) {
case 0x00: /* Normal format */
case 0x08: /* Normal format, use cdl. */
cplength = 2 + rpt;
Expand Down Expand Up @@ -1335,11 +1345,14 @@ dasd_eckd_format_device(struct dasd_device * device,
data = fcp->data;
ccw = fcp->cpaddr;

switch (fdata->intensity & ~0x08) {
switch (intensity & ~0x08) {
case 0x00: /* Normal format. */
define_extent(ccw++, (struct DE_eckd_data *) data,
fdata->start_unit, fdata->start_unit,
DASD_ECKD_CCW_WRITE_CKD, device);
/* grant subsystem permission to format R0 */
if (r0_perm)
((struct DE_eckd_data *)data)->ga_extended |= 0x04;
data += sizeof(struct DE_eckd_data);
ccw[-1].flags |= CCW_FLAG_CC;
locate_record(ccw++, (struct LO_eckd_data *) data,
Expand Down Expand Up @@ -1373,7 +1386,7 @@ dasd_eckd_format_device(struct dasd_device * device,
data += sizeof(struct LO_eckd_data);
break;
}
if (fdata->intensity & 0x01) { /* write record zero */
if (intensity & 0x01) { /* write record zero */
ect = (struct eckd_count *) data;
data += sizeof(struct eckd_count);
ect->cyl = cyl;
Expand All @@ -1388,7 +1401,7 @@ dasd_eckd_format_device(struct dasd_device * device,
ccw->cda = (__u32)(addr_t) ect;
ccw++;
}
if ((fdata->intensity & ~0x08) & 0x04) { /* erase track */
if ((intensity & ~0x08) & 0x04) { /* erase track */
ect = (struct eckd_count *) data;
data += sizeof(struct eckd_count);
ect->cyl = cyl;
Expand All @@ -1411,14 +1424,14 @@ dasd_eckd_format_device(struct dasd_device * device,
ect->kl = 0;
ect->dl = fdata->blksize;
/* Check for special tracks 0-1 when formatting CDL */
if ((fdata->intensity & 0x08) &&
if ((intensity & 0x08) &&
fdata->start_unit == 0) {
if (i < 3) {
ect->kl = 4;
ect->dl = sizes_trk0[i] - 4;
}
}
if ((fdata->intensity & 0x08) &&
if ((intensity & 0x08) &&
fdata->start_unit == 1) {
ect->kl = 44;
ect->dl = LABEL_SIZE - 44;
Expand Down

0 comments on commit 03b0ccb

Please sign in to comment.