Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/nop/g_nop.c
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | g_nop_access(struct g_provider *pp, int dr, int dw, int de) | ||||
error = g_access(cp, dr, dw, de); | error = g_access(cp, dr, dw, de); | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, | g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, | ||||
int ioerror, u_int rfailprob, u_int wfailprob, off_t offset, off_t size, | int ioerror, u_int rfailprob, u_int wfailprob, off_t offset, off_t size, | ||||
u_int secsize, u_int stripesize, u_int stripeoffset, const char *physpath) | u_int secsize, off_t stripesize, off_t stripeoffset, const char *physpath) | ||||
{ | { | ||||
struct g_nop_softc *sc; | struct g_nop_softc *sc; | ||||
struct g_geom *gp; | struct g_geom *gp; | ||||
struct g_provider *newpp; | struct g_provider *newpp; | ||||
struct g_consumer *cp; | struct g_consumer *cp; | ||||
char name[64]; | char name[64]; | ||||
int error; | int error; | ||||
off_t explicitsize; | off_t explicitsize; | ||||
▲ Show 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | if (pp == NULL) { | ||||
gctl_error(req, "Provider %s is invalid.", name); | gctl_error(req, "Provider %s is invalid.", name); | ||||
return; | return; | ||||
} | } | ||||
if (g_nop_create(req, mp, pp, | if (g_nop_create(req, mp, pp, | ||||
*error == -1 ? EIO : (int)*error, | *error == -1 ? EIO : (int)*error, | ||||
*rfailprob == -1 ? 0 : (u_int)*rfailprob, | *rfailprob == -1 ? 0 : (u_int)*rfailprob, | ||||
*wfailprob == -1 ? 0 : (u_int)*wfailprob, | *wfailprob == -1 ? 0 : (u_int)*wfailprob, | ||||
(off_t)*offset, (off_t)*size, (u_int)*secsize, | (off_t)*offset, (off_t)*size, (u_int)*secsize, | ||||
(u_int)*stripesize, (u_int)*stripeoffset, | (off_t)*stripesize, (off_t)*stripeoffset, | ||||
physpath) != 0) { | physpath) != 0) { | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
g_nop_ctl_configure(struct gctl_req *req, struct g_class *mp) | g_nop_ctl_configure(struct gctl_req *req, struct g_class *mp) | ||||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |