Changeset View
Changeset View
Standalone View
Standalone View
head/stand/i386/libi386/biosdisk.c
Show First 20 Lines • Show All 876 Lines • ▼ Show 20 Lines | if (diff == 0) { | ||||
tmpbuf = dest; | tmpbuf = dest; | ||||
} else { | } else { | ||||
tmpbuf = malloc(alignblks * BD(dev).bd_sectorsize); | tmpbuf = malloc(alignblks * BD(dev).bd_sectorsize); | ||||
if (tmpbuf == NULL) { | if (tmpbuf == NULL) { | ||||
return (-1); | return (-1); | ||||
} | } | ||||
} | } | ||||
if (alignlba + alignblks > BD(dev).bd_sectors) { | |||||
DEBUG("Shorted read at %llu from %d to %llu blocks", | |||||
alignlba, alignblks, BD(dev).bd_sectors - alignlba); | |||||
alignblks = BD(dev).bd_sectors - alignlba; | |||||
} | |||||
err = bd_io(dev, alignlba, alignblks, tmpbuf, 0); | err = bd_io(dev, alignlba, alignblks, tmpbuf, 0); | ||||
if (err) | if (err) | ||||
return (err); | return (err); | ||||
dskp.drive = bd_unit2bios(dev->dd.d_unit); | dskp.drive = bd_unit2bios(dev->dd.d_unit); | ||||
dskp.type = dev->dd.d_dev->dv_type; | dskp.type = dev->dd.d_dev->dv_type; | ||||
dskp.unit = dev->dd.d_unit; | dskp.unit = dev->dd.d_unit; | ||||
dskp.slice = dev->d_slice; | dskp.slice = dev->d_slice; | ||||
▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines |