Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/virtio/scsi/virtio_scsi.c
Show First 20 Lines • Show All 444 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
vtscsi_maximum_segments(struct vtscsi_softc *sc, int seg_max) | vtscsi_maximum_segments(struct vtscsi_softc *sc, int seg_max) | ||||
{ | { | ||||
int nsegs; | int nsegs; | ||||
nsegs = VTSCSI_MIN_SEGMENTS; | nsegs = VTSCSI_MIN_SEGMENTS; | ||||
if (seg_max > 0) { | if (seg_max > 0) { | ||||
nsegs += MIN(seg_max, MAXPHYS / PAGE_SIZE + 1); | nsegs += MIN(seg_max, maxphys / PAGE_SIZE + 1); | ||||
if (sc->vtscsi_flags & VTSCSI_FLAG_INDIRECT) | if (sc->vtscsi_flags & VTSCSI_FLAG_INDIRECT) | ||||
nsegs = MIN(nsegs, VIRTIO_MAX_INDIRECT); | nsegs = MIN(nsegs, VIRTIO_MAX_INDIRECT); | ||||
} else | } else | ||||
nsegs += 1; | nsegs += 1; | ||||
return (nsegs); | return (nsegs); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,879 Lines • Show Last 20 Lines |