1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-25 07:49:18 +00:00

Remove the absolute count g_access_abs() function since experience has

shown that it is not useful.

Rename the relative count g_access_rel() function to g_access(), only
the name has changed.

Change all g_access_rel() calls in our CVS tree to call g_access() instead.

Add an #ifndef BURN_BRIDGES #define of g_access_rel() for source
code compatibility.
This commit is contained in:
Poul-Henning Kamp 2004-02-12 22:42:11 +00:00
parent 63dfee8866
commit d2bae332d6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125755
17 changed files with 55 additions and 71 deletions

View File

@ -108,7 +108,7 @@ g_bde_access(struct g_provider *pp, int dr, int dw, int de)
de--; de--;
dr--; dr--;
} }
return (g_access_rel(cp, dr, dw, de)); return (g_access(cp, dr, dw, de));
} }
static void static void
@ -136,7 +136,7 @@ g_bde_create_geom(struct gctl_req *req, struct g_class *mp, struct g_provider *p
gp->spoiled = g_std_spoiled; gp->spoiled = g_std_spoiled;
cp = g_new_consumer(gp); cp = g_new_consumer(gp);
g_attach(cp, pp); g_attach(cp, pp);
error = g_access_rel(cp, 1, 1, 1); error = g_access(cp, 1, 1, 1);
if (error) { if (error) {
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);
@ -211,7 +211,7 @@ g_bde_create_geom(struct gctl_req *req, struct g_class *mp, struct g_provider *p
bzero(key, 16); bzero(key, 16);
if (error == 0) if (error == 0)
return; return;
g_access_rel(cp, -1, -1, -1); g_access(cp, -1, -1, -1);
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);
if (gp->softc != NULL) if (gp->softc != NULL)
@ -244,7 +244,7 @@ g_bde_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp)
KASSERT(cp != NULL, ("NULL consumer")); KASSERT(cp != NULL, ("NULL consumer"));
sc->dead = 1; sc->dead = 1;
wakeup(sc); wakeup(sc);
error = g_access_rel(cp, -1, -1, -1); error = g_access(cp, -1, -1, -1);
KASSERT(error == 0, ("error on close")); KASSERT(error == 0, ("error on close"));
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);

View File

@ -202,8 +202,10 @@ void g_orphan_provider(struct g_provider *pp, int error);
void g_waitidle(void); void g_waitidle(void);
/* geom_subr.c */ /* geom_subr.c */
int g_access_abs(struct g_consumer *cp, int nread, int nwrite, int nexcl); int g_access(struct g_consumer *cp, int nread, int nwrite, int nexcl);
int g_access_rel(struct g_consumer *cp, int nread, int nwrite, int nexcl); #ifndef BURN_BRIDGES
#define g_access_rel(a, b, c, d) g_access(a, b, c, d)
#endif
int g_attach(struct g_consumer *cp, struct g_provider *pp); int g_attach(struct g_consumer *cp, struct g_provider *pp);
void g_destroy_consumer(struct g_consumer *cp); void g_destroy_consumer(struct g_consumer *cp);
void g_destroy_geom(struct g_geom *pp); void g_destroy_geom(struct g_geom *pp);

View File

@ -266,7 +266,7 @@ g_aes_access(struct g_provider *pp, int dr, int dw, int de)
/* ... and let go of it on last close */ /* ... and let go of it on last close */
if ((cp->acr + dr) == 0 && (cp->acw + dw) == 0 && (cp->ace + de) == 1) if ((cp->acr + dr) == 0 && (cp->acw + dw) == 0 && (cp->ace + de) == 1)
de--; de--;
return (g_access_rel(cp, dr, dw, de)); return (g_access(cp, dr, dw, de));
} }
static struct g_geom * static struct g_geom *
@ -288,7 +288,7 @@ g_aes_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
gp->spoiled = g_std_spoiled; gp->spoiled = g_std_spoiled;
cp = g_new_consumer(gp); cp = g_new_consumer(gp);
g_attach(cp, pp); g_attach(cp, pp);
error = g_access_rel(cp, 1, 0, 0); error = g_access(cp, 1, 0, 0);
if (error) { if (error) {
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);
@ -357,7 +357,7 @@ g_aes_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
g_topology_lock(); g_topology_lock();
if (buf) if (buf)
g_free(buf); g_free(buf);
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (gp->softc != NULL) if (gp->softc != NULL)
return (gp); return (gp);
g_detach(cp); g_detach(cp);

View File

@ -243,7 +243,7 @@ g_apple_taste(struct g_class *mp, struct g_provider *pp, int insist)
break; break;
} while(0); } while(0);
g_topology_lock(); g_topology_lock();
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (LIST_EMPTY(&gp->provider)) { if (LIST_EMPTY(&gp->provider)) {
g_slice_spoiled(cp); g_slice_spoiled(cp);
return (NULL); return (NULL);

View File

@ -569,7 +569,7 @@ g_bsd_taste(struct g_class *mp, struct g_provider *pp, int flags)
} while (0); } while (0);
/* Success or failure, we can close our provider now. */ /* Success or failure, we can close our provider now. */
error = g_access_rel(cp, -1, 0, 0); error = g_access(cp, -1, 0, 0);
/* If we have configured any providers, return the new geom. */ /* If we have configured any providers, return the new geom. */
if (gsp->nprovider > 0) { if (gsp->nprovider > 0) {
@ -639,26 +639,26 @@ g_bsd_config(struct gctl_req *req, struct g_class *mp, char const *verb)
h0h0.label = label; h0h0.label = label;
h0h0.error = -1; h0h0.error = -1;
/* XXX: Does this reference register with our selfdestruct code ? */ /* XXX: Does this reference register with our selfdestruct code ? */
error = g_access_rel(cp, 1, 1, 1); error = g_access(cp, 1, 1, 1);
if (error) { if (error) {
gctl_error(req, "could not access consumer"); gctl_error(req, "could not access consumer");
return; return;
} }
g_bsd_callconfig(&h0h0, 0); g_bsd_callconfig(&h0h0, 0);
error = h0h0.error; error = h0h0.error;
g_access_rel(cp, -1, -1, -1); g_access(cp, -1, -1, -1);
} else if (!strcmp(verb, "write bootcode")) { } else if (!strcmp(verb, "write bootcode")) {
label = gctl_get_paraml(req, "bootcode", BBSIZE); label = gctl_get_paraml(req, "bootcode", BBSIZE);
if (label == NULL) if (label == NULL)
return; return;
/* XXX: Does this reference register with our selfdestruct code ? */ /* XXX: Does this reference register with our selfdestruct code ? */
error = g_access_rel(cp, 1, 1, 1); error = g_access(cp, 1, 1, 1);
if (error) { if (error) {
gctl_error(req, "could not access consumer"); gctl_error(req, "could not access consumer");
return; return;
} }
error = g_bsd_writelabel(gp, label); error = g_bsd_writelabel(gp, label);
g_access_rel(cp, -1, -1, -1); g_access(cp, -1, -1, -1);
} else { } else {
gctl_error(req, "Unknown verb parameter"); gctl_error(req, "Unknown verb parameter");
} }

View File

@ -168,12 +168,12 @@ g_ccd_access(struct g_provider *pp, int dr, int dw, int de)
gp = pp->geom; gp = pp->geom;
error = ENXIO; error = ENXIO;
LIST_FOREACH(cp1, &gp->consumer, consumer) { LIST_FOREACH(cp1, &gp->consumer, consumer) {
error = g_access_rel(cp1, dr, dw, de); error = g_access(cp1, dr, dw, de);
if (error) { if (error) {
LIST_FOREACH(cp2, &gp->consumer, consumer) { LIST_FOREACH(cp2, &gp->consumer, consumer) {
if (cp1 == cp2) if (cp1 == cp2)
break; break;
g_access_rel(cp2, -dr, -dw, -de); g_access(cp2, -dr, -dw, -de);
} }
break; break;
} }

View File

@ -213,7 +213,7 @@ g_dev_open(dev_t dev, int flags, int fmt, struct thread *td)
if (dev->si_devsw == NULL) if (dev->si_devsw == NULL)
error = ENXIO; /* We were orphaned */ error = ENXIO; /* We were orphaned */
else else
error = g_access_rel(cp, r, w, e); error = g_access(cp, r, w, e);
g_topology_unlock(); g_topology_unlock();
g_waitidle(); g_waitidle();
if (!error) if (!error)
@ -245,7 +245,7 @@ g_dev_close(dev_t dev, int flags, int fmt, struct thread *td)
if (dev->si_devsw == NULL) if (dev->si_devsw == NULL)
error = ENXIO; /* We were orphaned */ error = ENXIO; /* We were orphaned */
else else
error = g_access_rel(cp, r, w, e); error = g_access(cp, r, w, e);
for (i = 0; i < 10 * hz;) { for (i = 0; i < 10 * hz;) {
if (cp->acr != 0 || cp->acw != 0) if (cp->acr != 0 || cp->acw != 0)
break; break;
@ -434,7 +434,7 @@ g_dev_orphan(struct g_consumer *cp)
msleep(&dev, NULL, PRIBIO, "gdevorphan", hz / 10); msleep(&dev, NULL, PRIBIO, "gdevorphan", hz / 10);
if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
g_access_rel(cp, -cp->acr, -cp->acw, -cp->ace); g_access(cp, -cp->acr, -cp->acw, -cp->ace);
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);

View File

@ -90,13 +90,13 @@ g_fox_select_path(void *arg, int flag)
cp1 = LIST_NEXT(sc->opath, consumer); cp1 = LIST_NEXT(sc->opath, consumer);
error = g_access_rel(sc->opath, -sc->cr, -sc->cw, -(sc->ce + 1)); error = g_access(sc->opath, -sc->cr, -sc->cw, -(sc->ce + 1));
KASSERT(error == 0, ("Failed close of old path %d", error)); KASSERT(error == 0, ("Failed close of old path %d", error));
/* /*
* The attempt to reopen it with a exclusive count * The attempt to reopen it with a exclusive count
*/ */
error = g_access_rel(sc->opath, 0, 0, 1); error = g_access(sc->opath, 0, 0, 1);
if (error) { if (error) {
/* /*
* Ok, ditch this consumer, we can't use it. * Ok, ditch this consumer, we can't use it.
@ -130,7 +130,7 @@ g_fox_select_path(void *arg, int flag)
cp1 = LIST_FIRST(&gp->consumer); cp1 = LIST_FIRST(&gp->consumer);
printf("Open new path (%s) on fox (%s)\n", printf("Open new path (%s) on fox (%s)\n",
cp1->provider->name, gp->name); cp1->provider->name, gp->name);
error = g_access_rel(cp1, sc->cr, sc->cw, sc->ce); error = g_access(cp1, sc->cr, sc->cw, sc->ce);
if (error) { if (error) {
/* /*
* If we failed, we take another trip through here * If we failed, we take another trip through here
@ -179,7 +179,7 @@ g_fox_orphan(struct g_consumer *cp)
} }
mtx_unlock(&sc->lock); mtx_unlock(&sc->lock);
g_access_rel(cp, -cp->acr, -cp->acw, -cp->ace); g_access(cp, -cp->acr, -cp->acw, -cp->ace);
error = cp->provider->error; error = cp->provider->error;
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);
@ -299,7 +299,7 @@ g_fox_access(struct g_provider *pp, int dr, int dw, int de)
*/ */
error = 0; error = 0;
LIST_FOREACH(cp1, &gp->consumer, consumer) { LIST_FOREACH(cp1, &gp->consumer, consumer) {
error = g_access_rel(cp1, 0, 0, 1); error = g_access(cp1, 0, 0, 1);
if (error) { if (error) {
printf("FOX: access(%s,0,0,1) = %d\n", printf("FOX: access(%s,0,0,1) = %d\n",
cp1->provider->name, error); cp1->provider->name, error);
@ -309,7 +309,7 @@ g_fox_access(struct g_provider *pp, int dr, int dw, int de)
if (error) { if (error) {
LIST_FOREACH(cp1, &gp->consumer, consumer) { LIST_FOREACH(cp1, &gp->consumer, consumer) {
if (cp1->ace) if (cp1->ace)
g_access_rel(cp1, 0, 0, -1); g_access(cp1, 0, 0, -1);
} }
return (error); return (error);
} }
@ -319,7 +319,7 @@ g_fox_access(struct g_provider *pp, int dr, int dw, int de)
if (sc->path == NULL) if (sc->path == NULL)
error = ENXIO; error = ENXIO;
else else
error = g_access_rel(sc->path, dr, dw, de); error = g_access(sc->path, dr, dw, de);
if (error == 0) { if (error == 0) {
sc->cr += dr; sc->cr += dr;
sc->cw += dw; sc->cw += dw;
@ -329,7 +329,7 @@ g_fox_access(struct g_provider *pp, int dr, int dw, int de)
* Last close, remove e-bit on all consumers * Last close, remove e-bit on all consumers
*/ */
LIST_FOREACH(cp1, &gp->consumer, consumer) LIST_FOREACH(cp1, &gp->consumer, consumer)
g_access_rel(cp1, 0, 0, -1); g_access(cp1, 0, 0, -1);
} }
} }
return (error); return (error);
@ -360,7 +360,7 @@ g_fox_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
gp->access= g_fox_access; gp->access= g_fox_access;
cp = g_new_consumer(gp); cp = g_new_consumer(gp);
g_attach(cp, pp); g_attach(cp, pp);
error = g_access_rel(cp, 1, 0, 0); error = g_access(cp, 1, 0, 0);
if (error) { if (error) {
g_free(sc); g_free(sc);
g_detach(cp); g_detach(cp);
@ -401,7 +401,7 @@ g_fox_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
g_attach(cp2, pp); g_attach(cp2, pp);
pp2 = LIST_FIRST(&gp2->provider); pp2 = LIST_FIRST(&gp2->provider);
if (pp2->acr > 0 || pp2->acw > 0 || pp2->ace > 0) { if (pp2->acr > 0 || pp2->acw > 0 || pp2->ace > 0) {
error = g_access_rel(cp2, 0, 0, 1); error = g_access(cp2, 0, 0, 1);
if (error) { if (error) {
/* /*
* This is bad, or more likely, * This is bad, or more likely,
@ -433,7 +433,7 @@ printf("fox %s lock %p\n", gp->name, &sc->lock);
} while (0); } while (0);
if (buf != NULL) if (buf != NULL)
g_free(buf); g_free(buf);
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (!LIST_EMPTY(&gp->provider)) if (!LIST_EMPTY(&gp->provider))
return (gp); return (gp);

View File

@ -211,7 +211,7 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist)
g_free(mbr); g_free(mbr);
g_topology_lock(); g_topology_lock();
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (LIST_EMPTY(&gp->provider)) { if (LIST_EMPTY(&gp->provider)) {
g_slice_spoiled(cp); g_slice_spoiled(cp);
return (NULL); return (NULL);

View File

@ -263,7 +263,7 @@ g_mbr_taste(struct g_class *mp, struct g_provider *pp, int insist)
break; break;
} while (0); } while (0);
g_topology_lock(); g_topology_lock();
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (LIST_EMPTY(&gp->provider)) { if (LIST_EMPTY(&gp->provider)) {
g_slice_spoiled(cp); g_slice_spoiled(cp);
return (NULL); return (NULL);
@ -403,7 +403,7 @@ g_mbrext_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
break; break;
} while (0); } while (0);
g_topology_lock(); g_topology_lock();
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (LIST_EMPTY(&gp->provider)) { if (LIST_EMPTY(&gp->provider)) {
g_slice_spoiled(cp); g_slice_spoiled(cp);
return (NULL); return (NULL);

View File

@ -73,7 +73,7 @@ g_mirror_orphan(struct g_consumer *cp)
g_topology_assert(); g_topology_assert();
gp = cp->geom; gp = cp->geom;
g_access_rel(cp, -cp->acr, -cp->acw, -cp->ace); g_access(cp, -cp->acr, -cp->acw, -cp->ace);
error = cp->provider->error; error = cp->provider->error;
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);
@ -143,12 +143,12 @@ g_mirror_access(struct g_provider *pp, int dr, int dw, int de)
gp = pp->geom; gp = pp->geom;
error = ENXIO; error = ENXIO;
LIST_FOREACH(cp1, &gp->consumer, consumer) { LIST_FOREACH(cp1, &gp->consumer, consumer) {
error = g_access_rel(cp1, dr, dw, de); error = g_access(cp1, dr, dw, de);
if (error) { if (error) {
LIST_FOREACH(cp2, &gp->consumer, consumer) { LIST_FOREACH(cp2, &gp->consumer, consumer) {
if (cp2 == cp1) if (cp2 == cp1)
break; break;
g_access_rel(cp2, -dr, -dw, -de); g_access(cp2, -dr, -dw, -de);
} }
return (error); return (error);
} }
@ -177,7 +177,7 @@ g_mirror_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
gp->access= g_mirror_access; gp->access= g_mirror_access;
cp = g_new_consumer(gp); cp = g_new_consumer(gp);
g_attach(cp, pp); g_attach(cp, pp);
error = g_access_rel(cp, 1, 0, 0); error = g_access(cp, 1, 0, 0);
if (error) { if (error) {
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);
@ -220,7 +220,7 @@ g_mirror_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
g_topology_lock(); g_topology_lock();
if (buf != NULL) if (buf != NULL)
g_free(buf); g_free(buf);
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (gp->softc != NULL) if (gp->softc != NULL)
return (gp); return (gp);
g_detach(cp); g_detach(cp);

View File

@ -273,7 +273,7 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags)
break; break;
} while (0); } while (0);
g_topology_lock(); g_topology_lock();
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (LIST_EMPTY(&gp->provider)) { if (LIST_EMPTY(&gp->provider)) {
g_slice_spoiled(cp); g_slice_spoiled(cp);
return (NULL); return (NULL);

View File

@ -119,7 +119,7 @@ g_slice_access(struct g_provider *pp, int dr, int dw, int de)
/* ... and let go of it on last close */ /* ... and let go of it on last close */
if ((cp->acr + dr) == 0 && (cp->acw + dw) == 0 && (cp->ace + de) == 1) if ((cp->acr + dr) == 0 && (cp->acw + dw) == 0 && (cp->ace + de) == 1)
de--; de--;
error = g_access_rel(cp, dr, dw, de); error = g_access(cp, dr, dw, de);
return (error); return (error);
} }
@ -463,7 +463,7 @@ g_slice_new(struct g_class *mp, u_int slices, struct g_provider *pp, struct g_co
cp = g_new_consumer(gp); cp = g_new_consumer(gp);
error = g_attach(cp, pp); error = g_attach(cp, pp);
if (error == 0) if (error == 0)
error = g_access_rel(cp, 1, 0, 0); error = g_access(cp, 1, 0, 0);
if (error) { if (error) {
g_wither_geom(gp, ENXIO); g_wither_geom(gp, ENXIO);
return (NULL); return (NULL);

View File

@ -558,33 +558,15 @@ g_detach(struct g_consumer *cp)
redo_rank(cp->geom); redo_rank(cp->geom);
} }
/* /*
* g_access_abs() * g_access()
*
* Access-check with absolute new values: Just fall through
* and use the relative version.
*/
int
g_access_abs(struct g_consumer *cp, int acr, int acw, int ace)
{
g_topology_assert();
return(g_access_rel(cp,
acr - cp->acr,
acw - cp->acw,
ace - cp->ace));
}
/*
* g_access_rel()
* *
* 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_rel(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 pr,pw,pe;
@ -592,7 +574,7 @@ g_access_rel(struct g_consumer *cp, int dcr, int dcw, int dce)
pp = cp->provider; pp = cp->provider;
g_trace(G_T_ACCESS, "g_access_rel(%p(%s), %d, %d, %d)", g_trace(G_T_ACCESS, "g_access(%p(%s), %d, %d, %d)",
cp, pp->name, dcr, dcw, dce); cp, pp->name, dcr, dcw, dce);
g_topology_assert(); g_topology_assert();

View File

@ -194,19 +194,19 @@ g_sunlabel_config(struct gctl_req *req, struct g_class *mp, const char *verb)
h0h0.label = label; h0h0.label = label;
h0h0.error = -1; h0h0.error = -1;
/* XXX: Does this reference register with our selfdestruct code ? */ /* XXX: Does this reference register with our selfdestruct code ? */
error = g_access_rel(cp, 1, 1, 1); error = g_access(cp, 1, 1, 1);
if (error) { if (error) {
gctl_error(req, "could not access consumer"); gctl_error(req, "could not access consumer");
return; return;
} }
g_sunlabel_callconfig(&h0h0, 0); g_sunlabel_callconfig(&h0h0, 0);
g_access_rel(cp, -1, -1, -1); g_access(cp, -1, -1, -1);
} else if (!strcmp(verb, "write bootcode")) { } else if (!strcmp(verb, "write bootcode")) {
label = gctl_get_paraml(req, "bootcode", SUN_BOOTSIZE); label = gctl_get_paraml(req, "bootcode", SUN_BOOTSIZE);
if (label == NULL) if (label == NULL)
return; return;
/* XXX: Does this reference register with our selfdestruct code ? */ /* XXX: Does this reference register with our selfdestruct code ? */
error = g_access_rel(cp, 1, 1, 1); error = g_access(cp, 1, 1, 1);
if (error) { if (error) {
gctl_error(req, "could not access consumer"); gctl_error(req, "could not access consumer");
return; return;
@ -218,7 +218,7 @@ g_sunlabel_config(struct gctl_req *req, struct g_class *mp, const char *verb)
gsp->slices[i].offset + SUN_SIZE, label + SUN_SIZE, gsp->slices[i].offset + SUN_SIZE, label + SUN_SIZE,
SUN_BOOTSIZE - SUN_SIZE); SUN_BOOTSIZE - SUN_SIZE);
} }
g_access_rel(cp, -1, -1, -1); g_access(cp, -1, -1, -1);
} else { } else {
gctl_error(req, "Unknown verb parameter"); gctl_error(req, "Unknown verb parameter");
} }
@ -261,7 +261,7 @@ g_sunlabel_taste(struct g_class *mp, struct g_provider *pp, int flags)
break; break;
} while (0); } while (0);
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (LIST_EMPTY(&gp->provider)) { if (LIST_EMPTY(&gp->provider)) {
g_slice_spoiled(cp); g_slice_spoiled(cp);
return (NULL); return (NULL);

View File

@ -127,7 +127,7 @@ g_vol_ffs_taste(struct g_class *mp, struct g_provider *pp, int flags)
break; break;
} }
g_topology_lock(); g_topology_lock();
g_access_rel(cp, -1, 0, 0); g_access(cp, -1, 0, 0);
if (LIST_EMPTY(&gp->provider)) { if (LIST_EMPTY(&gp->provider)) {
g_slice_spoiled(cp); g_slice_spoiled(cp);
return (NULL); return (NULL);

View File

@ -2449,7 +2449,7 @@ swapgeom_close_ev(void *arg, int flags)
struct g_consumer *cp; struct g_consumer *cp;
cp = arg; cp = arg;
g_access_rel(cp, -1, -1, 0); g_access(cp, -1, -1, 0);
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);
} }
@ -2509,7 +2509,7 @@ swapongeom_ev(void *arg, int flags)
* savecore(8) wants to write to our swapdev so we cannot * savecore(8) wants to write to our swapdev so we cannot
* set an exclusive count :-( * set an exclusive count :-(
*/ */
error = g_access_rel(cp, 1, 1, 0); error = g_access(cp, 1, 1, 0);
if (error) { if (error) {
g_detach(cp); g_detach(cp);
g_destroy_consumer(cp); g_destroy_consumer(cp);