|
Lines 96-101
Link Here
|
| 96 |
adp->heads = atadev->param->heads; |
96 |
adp->heads = atadev->param->heads; |
| 97 |
adp->sectors = atadev->param->sectors; |
97 |
adp->sectors = atadev->param->sectors; |
| 98 |
adp->total_secs = atadev->param->cylinders * adp->heads * adp->sectors; |
98 |
adp->total_secs = atadev->param->cylinders * adp->heads * adp->sectors; |
|
|
99 |
/* if the total sectors is zero, the size of the disk is zero |
| 100 |
* and there's little good in attaching it (besides the fact |
| 101 |
* that this would generate divide by zero errors later. |
| 102 |
*/ |
| 103 |
if (adp->total_secs == 0) { |
| 104 |
ata_prtdev(atadev, "FAILURE - total sectors 0\n"); |
| 105 |
free(adp, M_AD); |
| 106 |
atadev->attach = NULL; |
| 107 |
return; |
| 108 |
} |
| 99 |
if (adp->device->channel->flags & ATA_USE_PC98GEOM && |
109 |
if (adp->device->channel->flags & ATA_USE_PC98GEOM && |
| 100 |
adp->total_secs < 17 * 8 * 65536) { |
110 |
adp->total_secs < 17 * 8 * 65536) { |
| 101 |
adp->sectors = 17; |
111 |
adp->sectors = 17; |