Fix the maximum transfer size for mfi(4) disk devices to not exceed the

maximum number of scatter/gather elements supported in the bus dma tag.

Reviewed by:	scottl
MFC after:	1 week
This commit is contained in:
John Baldwin 2008-11-17 23:30:19 +00:00
parent c1d393d207
commit d0e14c5099

View File

@ -136,7 +136,8 @@ mfi_disk_attach(device_t dev)
sc->ld_disk = disk_alloc();
sc->ld_disk->d_drv1 = sc;
sc->ld_disk->d_maxsize = sc->ld_controller->mfi_max_io * secsize;
sc->ld_disk->d_maxsize = min(sc->ld_controller->mfi_max_io * secsize,
(sc->ld_controller->mfi_max_sge - 1) * PAGE_SIZE);
sc->ld_disk->d_name = "mfid";
sc->ld_disk->d_open = mfi_disk_open;
sc->ld_disk->d_close = mfi_disk_close;