Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/usb/storage/ustorage_fs.c
Show First 20 Lines • Show All 375 Lines • ▼ Show 20 Lines | if (unit == 0) { | ||||
if (ustorage_fs_ramdisk == NULL) { | if (ustorage_fs_ramdisk == NULL) { | ||||
/* | /* | ||||
* allocate a memory image for our ramdisk until | * allocate a memory image for our ramdisk until | ||||
* further | * further | ||||
*/ | */ | ||||
ustorage_fs_ramdisk = | ustorage_fs_ramdisk = | ||||
malloc(USTORAGE_FS_RAM_SECT << 9, M_USB, | malloc(USTORAGE_FS_RAM_SECT << 9, M_USB, | ||||
M_ZERO | M_WAITOK); | M_ZERO | M_WAITOK); | ||||
if (ustorage_fs_ramdisk == NULL) { | |||||
return (ENOMEM); | |||||
} | |||||
} | } | ||||
sc->sc_lun[0].memory_image = ustorage_fs_ramdisk; | sc->sc_lun[0].memory_image = ustorage_fs_ramdisk; | ||||
sc->sc_lun[0].num_sectors = USTORAGE_FS_RAM_SECT; | sc->sc_lun[0].num_sectors = USTORAGE_FS_RAM_SECT; | ||||
sc->sc_lun[0].removable = 1; | sc->sc_lun[0].removable = 1; | ||||
} | } | ||||
device_set_usb_desc(dev); | device_set_usb_desc(dev); | ||||
▲ Show 20 Lines • Show All 1,567 Lines • Show Last 20 Lines |