Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/xen/blkfront/blkfront.c
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
#define XBD_SECTOR_SHFT 9 | #define XBD_SECTOR_SHFT 9 | ||||
/*---------------------------- Global Static Data ----------------------------*/ | /*---------------------------- Global Static Data ----------------------------*/ | ||||
static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); | static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); | ||||
static int xbd_enable_indirect = 1; | static int xbd_enable_indirect = 1; | ||||
SYSCTL_NODE(_hw, OID_AUTO, xbd, CTLFLAG_RD, 0, "xbd driver parameters"); | SYSCTL_NODE(_hw, OID_AUTO, xbd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | ||||
"xbd driver parameters"); | |||||
SYSCTL_INT(_hw_xbd, OID_AUTO, xbd_enable_indirect, CTLFLAG_RDTUN, | SYSCTL_INT(_hw_xbd, OID_AUTO, xbd_enable_indirect, CTLFLAG_RDTUN, | ||||
&xbd_enable_indirect, 0, "Enable xbd indirect segments"); | &xbd_enable_indirect, 0, "Enable xbd indirect segments"); | ||||
/*---------------------------- Command Processing ----------------------------*/ | /*---------------------------- Command Processing ----------------------------*/ | ||||
static void | static void | ||||
xbd_freeze(struct xbd_softc *sc, xbd_flag_t xbd_flag) | xbd_freeze(struct xbd_softc *sc, xbd_flag_t xbd_flag) | ||||
{ | { | ||||
if (xbd_flag != XBDF_NONE && (sc->xbd_flags & xbd_flag) != 0) | if (xbd_flag != XBDF_NONE && (sc->xbd_flags & xbd_flag) != 0) | ||||
▲ Show 20 Lines • Show All 826 Lines • ▼ Show 20 Lines | SYSCTL_ADD_UINT(sysctl_ctx, children, OID_AUTO, | ||||
"max_request_size", CTLFLAG_RD, &xbd->xbd_max_request_size, 0, | "max_request_size", CTLFLAG_RD, &xbd->xbd_max_request_size, 0, | ||||
"maximum size in bytes of a request (negotiated)"); | "maximum size in bytes of a request (negotiated)"); | ||||
SYSCTL_ADD_UINT(sysctl_ctx, children, OID_AUTO, | SYSCTL_ADD_UINT(sysctl_ctx, children, OID_AUTO, | ||||
"ring_pages", CTLFLAG_RD, &xbd->xbd_ring_pages, 0, | "ring_pages", CTLFLAG_RD, &xbd->xbd_ring_pages, 0, | ||||
"communication channel pages (negotiated)"); | "communication channel pages (negotiated)"); | ||||
SYSCTL_ADD_PROC(sysctl_ctx, children, OID_AUTO, | SYSCTL_ADD_PROC(sysctl_ctx, children, OID_AUTO, | ||||
"features", CTLTYPE_STRING|CTLFLAG_RD, xbd, 0, | "features", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, xbd, | ||||
xbd_sysctl_features, "A", "protocol features (negotiated)"); | 0, xbd_sysctl_features, "A", "protocol features (negotiated)"); | ||||
} | } | ||||
/* | /* | ||||
* Translate Linux major/minor to an appropriate name and unit | * Translate Linux major/minor to an appropriate name and unit | ||||
* number. For HVM guests, this allows us to use the same drive names | * number. For HVM guests, this allows us to use the same drive names | ||||
* with blkfront as the emulated drives, easing transition slightly. | * with blkfront as the emulated drives, easing transition slightly. | ||||
*/ | */ | ||||
static void | static void | ||||
▲ Show 20 Lines • Show All 715 Lines • Show Last 20 Lines |