Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/geom_subr.c
Show First 20 Lines • Show All 870 Lines • ▼ Show 20 Lines | |||||
* Access-check with delta values. The question asked is "can provider | * Access-check with delta values. The question asked is "can provider | ||||
* "cp" change the access counters by the relative amounts dc[rwe] ?" | * "cp" change the access counters by the relative amounts dc[rwe] ?" | ||||
*/ | */ | ||||
int | int | ||||
g_access(struct g_consumer *cp, int dcr, int dcw, int dce) | g_access(struct g_consumer *cp, int dcr, int dcw, int dce) | ||||
{ | { | ||||
struct g_provider *pp; | struct g_provider *pp; | ||||
int pr,pw,pe; | int pw, pe; | ||||
int error; | int error; | ||||
g_topology_assert(); | g_topology_assert(); | ||||
G_VALID_CONSUMER(cp); | G_VALID_CONSUMER(cp); | ||||
pp = cp->provider; | pp = cp->provider; | ||||
KASSERT(pp != NULL, ("access but not attached")); | KASSERT(pp != NULL, ("access but not attached")); | ||||
G_VALID_PROVIDER(pp); | G_VALID_PROVIDER(pp); | ||||
Show All 14 Lines | g_access(struct g_consumer *cp, int dcr, int dcw, int dce) | ||||
if (cp->geom->spoiled != NULL && (cp->flags & G_CF_SPOILED) && | if (cp->geom->spoiled != NULL && (cp->flags & G_CF_SPOILED) && | ||||
(dcr > 0 || dcw > 0 || dce > 0)) | (dcr > 0 || dcw > 0 || dce > 0)) | ||||
return (ENXIO); | return (ENXIO); | ||||
/* | /* | ||||
* Figure out what counts the provider would have had, if this | * Figure out what counts the provider would have had, if this | ||||
* consumer had (r0w0e0) at this time. | * consumer had (r0w0e0) at this time. | ||||
*/ | */ | ||||
pr = pp->acr - cp->acr; | |||||
pw = pp->acw - cp->acw; | pw = pp->acw - cp->acw; | ||||
pe = pp->ace - cp->ace; | pe = pp->ace - cp->ace; | ||||
g_trace(G_T_ACCESS, | g_trace(G_T_ACCESS, | ||||
"open delta:[r%dw%de%d] old:[r%dw%de%d] provider:[r%dw%de%d] %p(%s)", | "open delta:[r%dw%de%d] old:[r%dw%de%d] provider:[r%dw%de%d] %p(%s)", | ||||
dcr, dcw, dce, | dcr, dcw, dce, | ||||
cp->acr, cp->acw, cp->ace, | cp->acr, cp->acw, cp->ace, | ||||
pp->acr, pp->acw, pp->ace, | pp->acr, pp->acw, pp->ace, | ||||
▲ Show 20 Lines • Show All 654 Lines • Show Last 20 Lines |