Changeset View
Changeset View
Standalone View
Standalone View
head/sys/boot/common/disk.c
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct disk_devdesc *dev; | struct disk_devdesc *dev; | ||||
struct open_disk *od; | struct open_disk *od; | ||||
dev = (struct disk_devdesc *)d; | dev = (struct disk_devdesc *)d; | ||||
od = (struct open_disk *)dev->d_opendata; | od = (struct open_disk *)dev->d_opendata; | ||||
/* | /* | ||||
* The strategy function assumes the offset is in units of 512 byte | |||||
* sectors. For larger sector sizes, we need to adjust the offset to | |||||
* match the actual sector size. | |||||
*/ | |||||
offset *= (od->sectorsize / 512); | |||||
/* | |||||
* As the GPT backup partition is located at the end of the disk, | * As the GPT backup partition is located at the end of the disk, | ||||
* to avoid reading past disk end, flag bcache not to use RA. | * to avoid reading past disk end, flag bcache not to use RA. | ||||
*/ | */ | ||||
return (dev->d_dev->dv_strategy(dev, F_READ | F_NORA, offset, | return (dev->d_dev->dv_strategy(dev, F_READ | F_NORA, offset, | ||||
blocks * od->sectorsize, (char *)buf, NULL)); | blocks * od->sectorsize, (char *)buf, NULL)); | ||||
} | } | ||||
#define PWIDTH 35 | #define PWIDTH 35 | ||||
▲ Show 20 Lines • Show All 327 Lines • Show Last 20 Lines |