Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
Show First 20 Lines • Show All 972 Lines • ▼ Show 20 Lines | storvsc_attach(device_t dev) | ||||
/* | /* | ||||
* We need to serialize storvsc attach calls. | * We need to serialize storvsc attach calls. | ||||
*/ | */ | ||||
root_mount_token = root_mount_hold("storvsc"); | root_mount_token = root_mount_hold("storvsc"); | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
if (sc == NULL) { | if (sc == NULL) { | ||||
ret = ENOMEM; | ret = ENOMEM; | ||||
goto cleanup; | return (ret); | ||||
} | } | ||||
stor_type = storvsc_get_storage_type(dev); | stor_type = storvsc_get_storage_type(dev); | ||||
if (stor_type == DRIVER_UNKNOWN) { | if (stor_type == DRIVER_UNKNOWN) { | ||||
ret = ENODEV; | ret = ENODEV; | ||||
goto cleanup; | return (ret); | ||||
} | } | ||||
bzero(sc, sizeof(struct storvsc_softc)); | bzero(sc, sizeof(struct storvsc_softc)); | ||||
/* fill in driver specific properties */ | /* fill in driver specific properties */ | ||||
sc->hs_drv_props = &g_drv_props_table[stor_type]; | sc->hs_drv_props = &g_drv_props_table[stor_type]; | ||||
/* fill in device specific properties */ | /* fill in device specific properties */ | ||||
▲ Show 20 Lines • Show All 1,141 Lines • Show Last 20 Lines |