Changeset View
Changeset View
Standalone View
Standalone View
head/stand/libsa/zfs/zfs.c
Show First 20 Lines • Show All 582 Lines • ▼ Show 20 Lines | zfs_probe_dev(const char *devname, uint64_t *pool_guid) | ||||
* disks and some systems will misreport the disk sizes and will | * disks and some systems will misreport the disk sizes and will | ||||
* hang while accessing the disk. | * hang while accessing the disk. | ||||
*/ | */ | ||||
if (archsw.arch_getdev((void **)&dev, devname, NULL) == 0) { | if (archsw.arch_getdev((void **)&dev, devname, NULL) == 0) { | ||||
int partition = dev->d_partition; | int partition = dev->d_partition; | ||||
int slice = dev->d_slice; | int slice = dev->d_slice; | ||||
free(dev); | free(dev); | ||||
if (partition != -1 && slice != -1) { | if (partition != D_PARTNONE && slice != D_SLICENONE) { | ||||
ret = zfs_probe(pa.fd, pool_guid); | ret = zfs_probe(pa.fd, pool_guid); | ||||
if (ret == 0) | if (ret == 0) | ||||
return (0); | return (0); | ||||
} | } | ||||
} | } | ||||
/* Probe each partition */ | /* Probe each partition */ | ||||
ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz); | ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz); | ||||
▲ Show 20 Lines • Show All 467 Lines • Show Last 20 Lines |