Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/xen/blkfront/blkfront.c
Show First 20 Lines • Show All 1,300 Lines • ▼ Show 20 Lines | xbd_connect(struct xbd_softc *sc) | ||||
err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), | err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), | ||||
"feature-max-indirect-segments", "%" PRIu32, | "feature-max-indirect-segments", "%" PRIu32, | ||||
&sc->xbd_max_request_segments, NULL); | &sc->xbd_max_request_segments, NULL); | ||||
if ((err != 0) || (xbd_enable_indirect == 0)) | if ((err != 0) || (xbd_enable_indirect == 0)) | ||||
sc->xbd_max_request_segments = 0; | sc->xbd_max_request_segments = 0; | ||||
if (sc->xbd_max_request_segments > XBD_MAX_INDIRECT_SEGMENTS) | if (sc->xbd_max_request_segments > XBD_MAX_INDIRECT_SEGMENTS) | ||||
sc->xbd_max_request_segments = XBD_MAX_INDIRECT_SEGMENTS; | sc->xbd_max_request_segments = XBD_MAX_INDIRECT_SEGMENTS; | ||||
if (sc->xbd_max_request_segments > XBD_SIZE_TO_SEGS(MAXPHYS)) | if (sc->xbd_max_request_segments > XBD_SIZE_TO_SEGS(maxphys)) | ||||
sc->xbd_max_request_segments = XBD_SIZE_TO_SEGS(MAXPHYS); | sc->xbd_max_request_segments = XBD_SIZE_TO_SEGS(maxphys); | ||||
sc->xbd_max_request_indirectpages = | sc->xbd_max_request_indirectpages = | ||||
XBD_INDIRECT_SEGS_TO_PAGES(sc->xbd_max_request_segments); | XBD_INDIRECT_SEGS_TO_PAGES(sc->xbd_max_request_segments); | ||||
if (sc->xbd_max_request_segments < BLKIF_MAX_SEGMENTS_PER_REQUEST) | if (sc->xbd_max_request_segments < BLKIF_MAX_SEGMENTS_PER_REQUEST) | ||||
sc->xbd_max_request_segments = BLKIF_MAX_SEGMENTS_PER_REQUEST; | sc->xbd_max_request_segments = BLKIF_MAX_SEGMENTS_PER_REQUEST; | ||||
sc->xbd_max_request_size = | sc->xbd_max_request_size = | ||||
XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments); | XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments); | ||||
/* Allocate datastructures based on negotiated values. */ | /* Allocate datastructures based on negotiated values. */ | ||||
▲ Show 20 Lines • Show All 334 Lines • Show Last 20 Lines |