diff options
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/bde/g_bde.c | 8 | ||||
-rw-r--r-- | sys/geom/geom.h | 6 | ||||
-rw-r--r-- | sys/geom/geom_aes.c | 6 | ||||
-rw-r--r-- | sys/geom/geom_apple.c | 2 | ||||
-rw-r--r-- | sys/geom/geom_bsd.c | 10 | ||||
-rw-r--r-- | sys/geom/geom_ccd.c | 4 | ||||
-rw-r--r-- | sys/geom/geom_dev.c | 6 | ||||
-rw-r--r-- | sys/geom/geom_fox.c | 22 | ||||
-rw-r--r-- | sys/geom/geom_gpt.c | 2 | ||||
-rw-r--r-- | sys/geom/geom_mbr.c | 4 | ||||
-rw-r--r-- | sys/geom/geom_mirror.c | 10 | ||||
-rw-r--r-- | sys/geom/geom_pc98.c | 2 | ||||
-rw-r--r-- | sys/geom/geom_slice.c | 4 | ||||
-rw-r--r-- | sys/geom/geom_subr.c | 24 | ||||
-rw-r--r-- | sys/geom/geom_sunlabel.c | 10 | ||||
-rw-r--r-- | sys/geom/geom_vol_ffs.c | 2 |
16 files changed, 53 insertions, 69 deletions
diff --git a/sys/geom/bde/g_bde.c b/sys/geom/bde/g_bde.c index 1e53875..4b4e947 100644 --- a/sys/geom/bde/g_bde.c +++ b/sys/geom/bde/g_bde.c @@ -108,7 +108,7 @@ g_bde_access(struct g_provider *pp, int dr, int dw, int de) de--; dr--; } - return (g_access_rel(cp, dr, dw, de)); + return (g_access(cp, dr, dw, de)); } 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; cp = g_new_consumer(gp); g_attach(cp, pp); - error = g_access_rel(cp, 1, 1, 1); + error = g_access(cp, 1, 1, 1); if (error) { g_detach(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); if (error == 0) return; - g_access_rel(cp, -1, -1, -1); + g_access(cp, -1, -1, -1); g_detach(cp); g_destroy_consumer(cp); 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")); sc->dead = 1; wakeup(sc); - error = g_access_rel(cp, -1, -1, -1); + error = g_access(cp, -1, -1, -1); KASSERT(error == 0, ("error on close")); g_detach(cp); g_destroy_consumer(cp); diff --git a/sys/geom/geom.h b/sys/geom/geom.h index 0514a19..63db46a 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -202,8 +202,10 @@ void g_orphan_provider(struct g_provider *pp, int error); void g_waitidle(void); /* geom_subr.c */ -int g_access_abs(struct g_consumer *cp, int nread, int nwrite, int nexcl); -int g_access_rel(struct g_consumer *cp, int nread, int nwrite, int nexcl); +int g_access(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); void g_destroy_consumer(struct g_consumer *cp); void g_destroy_geom(struct g_geom *pp); diff --git a/sys/geom/geom_aes.c b/sys/geom/geom_aes.c index 867efd9..1ac425a 100644 --- a/sys/geom/geom_aes.c +++ b/sys/geom/geom_aes.c @@ -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 */ if ((cp->acr + dr) == 0 && (cp->acw + dw) == 0 && (cp->ace + de) == 1) de--; - return (g_access_rel(cp, dr, dw, de)); + return (g_access(cp, dr, dw, de)); } 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; cp = g_new_consumer(gp); g_attach(cp, pp); - error = g_access_rel(cp, 1, 0, 0); + error = g_access(cp, 1, 0, 0); if (error) { g_detach(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(); if (buf) g_free(buf); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (gp->softc != NULL) return (gp); g_detach(cp); diff --git a/sys/geom/geom_apple.c b/sys/geom/geom_apple.c index 328b835..f076a3a 100644 --- a/sys/geom/geom_apple.c +++ b/sys/geom/geom_apple.c @@ -243,7 +243,7 @@ g_apple_taste(struct g_class *mp, struct g_provider *pp, int insist) break; } while(0); g_topology_lock(); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { g_slice_spoiled(cp); return (NULL); diff --git a/sys/geom/geom_bsd.c b/sys/geom/geom_bsd.c index 1a309eb..ce74c9f 100644 --- a/sys/geom/geom_bsd.c +++ b/sys/geom/geom_bsd.c @@ -569,7 +569,7 @@ g_bsd_taste(struct g_class *mp, struct g_provider *pp, int flags) } while (0); /* 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 (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.error = -1; /* 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) { gctl_error(req, "could not access consumer"); return; } g_bsd_callconfig(&h0h0, 0); error = h0h0.error; - g_access_rel(cp, -1, -1, -1); + g_access(cp, -1, -1, -1); } else if (!strcmp(verb, "write bootcode")) { label = gctl_get_paraml(req, "bootcode", BBSIZE); if (label == NULL) return; /* 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) { gctl_error(req, "could not access consumer"); return; } error = g_bsd_writelabel(gp, label); - g_access_rel(cp, -1, -1, -1); + g_access(cp, -1, -1, -1); } else { gctl_error(req, "Unknown verb parameter"); } diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index bd58410..7ec3d2e 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -168,12 +168,12 @@ g_ccd_access(struct g_provider *pp, int dr, int dw, int de) gp = pp->geom; error = ENXIO; LIST_FOREACH(cp1, &gp->consumer, consumer) { - error = g_access_rel(cp1, dr, dw, de); + error = g_access(cp1, dr, dw, de); if (error) { LIST_FOREACH(cp2, &gp->consumer, consumer) { if (cp1 == cp2) break; - g_access_rel(cp2, -dr, -dw, -de); + g_access(cp2, -dr, -dw, -de); } break; } diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index baad2ee..97abc2a 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -213,7 +213,7 @@ g_dev_open(dev_t dev, int flags, int fmt, struct thread *td) if (dev->si_devsw == NULL) error = ENXIO; /* We were orphaned */ else - error = g_access_rel(cp, r, w, e); + error = g_access(cp, r, w, e); g_topology_unlock(); g_waitidle(); if (!error) @@ -245,7 +245,7 @@ g_dev_close(dev_t dev, int flags, int fmt, struct thread *td) if (dev->si_devsw == NULL) error = ENXIO; /* We were orphaned */ else - error = g_access_rel(cp, r, w, e); + error = g_access(cp, r, w, e); for (i = 0; i < 10 * hz;) { if (cp->acr != 0 || cp->acw != 0) break; @@ -434,7 +434,7 @@ g_dev_orphan(struct g_consumer *cp) msleep(&dev, NULL, PRIBIO, "gdevorphan", hz / 10); 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_destroy_consumer(cp); diff --git a/sys/geom/geom_fox.c b/sys/geom/geom_fox.c index df4b68c..2c4b3d0 100644 --- a/sys/geom/geom_fox.c +++ b/sys/geom/geom_fox.c @@ -90,13 +90,13 @@ g_fox_select_path(void *arg, int flag) 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)); /* * 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) { /* * 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); printf("Open new path (%s) on fox (%s)\n", 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 we failed, we take another trip through here @@ -179,7 +179,7 @@ g_fox_orphan(struct g_consumer *cp) } 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; g_detach(cp); g_destroy_consumer(cp); @@ -299,7 +299,7 @@ g_fox_access(struct g_provider *pp, int dr, int dw, int de) */ error = 0; LIST_FOREACH(cp1, &gp->consumer, consumer) { - error = g_access_rel(cp1, 0, 0, 1); + error = g_access(cp1, 0, 0, 1); if (error) { printf("FOX: access(%s,0,0,1) = %d\n", cp1->provider->name, error); @@ -309,7 +309,7 @@ g_fox_access(struct g_provider *pp, int dr, int dw, int de) if (error) { LIST_FOREACH(cp1, &gp->consumer, consumer) { if (cp1->ace) - g_access_rel(cp1, 0, 0, -1); + g_access(cp1, 0, 0, -1); } return (error); } @@ -319,7 +319,7 @@ g_fox_access(struct g_provider *pp, int dr, int dw, int de) if (sc->path == NULL) error = ENXIO; else - error = g_access_rel(sc->path, dr, dw, de); + error = g_access(sc->path, dr, dw, de); if (error == 0) { sc->cr += dr; 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 */ LIST_FOREACH(cp1, &gp->consumer, consumer) - g_access_rel(cp1, 0, 0, -1); + g_access(cp1, 0, 0, -1); } } 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; cp = g_new_consumer(gp); g_attach(cp, pp); - error = g_access_rel(cp, 1, 0, 0); + error = g_access(cp, 1, 0, 0); if (error) { g_free(sc); 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); pp2 = LIST_FIRST(&gp2->provider); 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) { /* * This is bad, or more likely, @@ -433,7 +433,7 @@ printf("fox %s lock %p\n", gp->name, &sc->lock); } while (0); if (buf != NULL) g_free(buf); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (!LIST_EMPTY(&gp->provider)) return (gp); diff --git a/sys/geom/geom_gpt.c b/sys/geom/geom_gpt.c index 52951c4..601d7e8 100644 --- a/sys/geom/geom_gpt.c +++ b/sys/geom/geom_gpt.c @@ -211,7 +211,7 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist) g_free(mbr); g_topology_lock(); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { g_slice_spoiled(cp); return (NULL); diff --git a/sys/geom/geom_mbr.c b/sys/geom/geom_mbr.c index 877f090..9ba0815 100644 --- a/sys/geom/geom_mbr.c +++ b/sys/geom/geom_mbr.c @@ -263,7 +263,7 @@ g_mbr_taste(struct g_class *mp, struct g_provider *pp, int insist) break; } while (0); g_topology_lock(); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { g_slice_spoiled(cp); return (NULL); @@ -403,7 +403,7 @@ g_mbrext_taste(struct g_class *mp, struct g_provider *pp, int insist __unused) break; } while (0); g_topology_lock(); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { g_slice_spoiled(cp); return (NULL); diff --git a/sys/geom/geom_mirror.c b/sys/geom/geom_mirror.c index 092947e..ea14ae9 100644 --- a/sys/geom/geom_mirror.c +++ b/sys/geom/geom_mirror.c @@ -73,7 +73,7 @@ g_mirror_orphan(struct g_consumer *cp) g_topology_assert(); 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; g_detach(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; error = ENXIO; LIST_FOREACH(cp1, &gp->consumer, consumer) { - error = g_access_rel(cp1, dr, dw, de); + error = g_access(cp1, dr, dw, de); if (error) { LIST_FOREACH(cp2, &gp->consumer, consumer) { if (cp2 == cp1) break; - g_access_rel(cp2, -dr, -dw, -de); + g_access(cp2, -dr, -dw, -de); } 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; cp = g_new_consumer(gp); g_attach(cp, pp); - error = g_access_rel(cp, 1, 0, 0); + error = g_access(cp, 1, 0, 0); if (error) { g_detach(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(); if (buf != NULL) g_free(buf); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (gp->softc != NULL) return (gp); g_detach(cp); diff --git a/sys/geom/geom_pc98.c b/sys/geom/geom_pc98.c index 667e866..2e0c212 100644 --- a/sys/geom/geom_pc98.c +++ b/sys/geom/geom_pc98.c @@ -273,7 +273,7 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags) break; } while (0); g_topology_lock(); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { g_slice_spoiled(cp); return (NULL); diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 64c000e..8a76910 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -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 */ if ((cp->acr + dr) == 0 && (cp->acw + dw) == 0 && (cp->ace + de) == 1) de--; - error = g_access_rel(cp, dr, dw, de); + error = g_access(cp, dr, dw, de); 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); error = g_attach(cp, pp); if (error == 0) - error = g_access_rel(cp, 1, 0, 0); + error = g_access(cp, 1, 0, 0); if (error) { g_wither_geom(gp, ENXIO); return (NULL); diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index a56c0af..b6a9c7f 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -558,33 +558,15 @@ g_detach(struct g_consumer *cp) redo_rank(cp->geom); } - -/* - * g_access_abs() - * - * 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() + * g_access() * * Access-check with delta values. The question asked is "can provider * "cp" change the access counters by the relative amounts dc[rwe] ?" */ 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; int pr,pw,pe; @@ -592,7 +574,7 @@ g_access_rel(struct g_consumer *cp, int dcr, int dcw, int dce) 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); g_topology_assert(); diff --git a/sys/geom/geom_sunlabel.c b/sys/geom/geom_sunlabel.c index 0718056..8b11dd9 100644 --- a/sys/geom/geom_sunlabel.c +++ b/sys/geom/geom_sunlabel.c @@ -194,19 +194,19 @@ g_sunlabel_config(struct gctl_req *req, struct g_class *mp, const char *verb) h0h0.label = label; h0h0.error = -1; /* 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) { gctl_error(req, "could not access consumer"); return; } g_sunlabel_callconfig(&h0h0, 0); - g_access_rel(cp, -1, -1, -1); + g_access(cp, -1, -1, -1); } else if (!strcmp(verb, "write bootcode")) { label = gctl_get_paraml(req, "bootcode", SUN_BOOTSIZE); if (label == NULL) return; /* 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) { gctl_error(req, "could not access consumer"); 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, SUN_BOOTSIZE - SUN_SIZE); } - g_access_rel(cp, -1, -1, -1); + g_access(cp, -1, -1, -1); } else { gctl_error(req, "Unknown verb parameter"); } @@ -261,7 +261,7 @@ g_sunlabel_taste(struct g_class *mp, struct g_provider *pp, int flags) break; } while (0); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { g_slice_spoiled(cp); return (NULL); diff --git a/sys/geom/geom_vol_ffs.c b/sys/geom/geom_vol_ffs.c index de046ed..afc4148 100644 --- a/sys/geom/geom_vol_ffs.c +++ b/sys/geom/geom_vol_ffs.c @@ -127,7 +127,7 @@ g_vol_ffs_taste(struct g_class *mp, struct g_provider *pp, int flags) break; } g_topology_lock(); - g_access_rel(cp, -1, 0, 0); + g_access(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { g_slice_spoiled(cp); return (NULL); |