summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-02-19 05:47:46 +0000
committerimp <imp@FreeBSD.org>2003-02-19 05:47:46 +0000
commitcf874b345d0f766fb64cf4737e1c85ccc78d2bee (patch)
tree9e20e320fe15ae4bf68f8335fcf9d3e71d3b3614 /sys/geom
parentb72619cecb8265d3efb3781b0acff1380762c173 (diff)
downloadFreeBSD-src-cf874b345d0f766fb64cf4737e1c85ccc78d2bee.zip
FreeBSD-src-cf874b345d0f766fb64cf4737e1c85ccc78d2bee.tar.gz
Back out M_* changes, per decision of the TRB.
Approved by: trb
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/bde/g_bde.c2
-rw-r--r--sys/geom/geom_aes.c6
-rw-r--r--sys/geom/geom_ccd.c21
-rw-r--r--sys/geom/geom_ctl.c2
-rw-r--r--sys/geom/geom_dev.c2
-rw-r--r--sys/geom/geom_disk.c2
-rw-r--r--sys/geom/geom_event.c2
-rw-r--r--sys/geom/geom_gpt.c2
-rw-r--r--sys/geom/geom_io.c2
-rw-r--r--sys/geom/geom_mirror.c2
-rw-r--r--sys/geom/geom_slice.c8
-rw-r--r--sys/geom/geom_subr.c14
12 files changed, 33 insertions, 32 deletions
diff --git a/sys/geom/bde/g_bde.c b/sys/geom/bde/g_bde.c
index 8a39926..4d7f615 100644
--- a/sys/geom/bde/g_bde.c
+++ b/sys/geom/bde/g_bde.c
@@ -212,7 +212,7 @@ g_bde_config(struct g_configargs *ga)
while (1) {
sectorsize = cp->provider->sectorsize;
mediasize = cp->provider->mediasize;
- sc = g_malloc(sizeof(struct g_bde_softc), M_ZERO);
+ sc = g_malloc(sizeof(struct g_bde_softc), M_WAITOK | M_ZERO);
gp->softc = sc;
sc->geom = gp;
sc->consumer = cp;
diff --git a/sys/geom/geom_aes.c b/sys/geom/geom_aes.c
index 5471cbf..72f0d3d 100644
--- a/sys/geom/geom_aes.c
+++ b/sys/geom/geom_aes.c
@@ -148,7 +148,7 @@ g_aes_read_done(struct bio *bp)
gp = bp->bio_from->geom;
sc = gp->softc;
- sb = g_malloc(sc->sectorsize, 0);
+ sb = g_malloc(sc->sectorsize, M_WAITOK);
b = bp->bio_data;
e = bp->bio_data;
e += bp->bio_length;
@@ -211,7 +211,7 @@ g_aes_start(struct bio *bp)
}
bp2->bio_done = g_aes_write_done;
bp2->bio_offset += sc->sectorsize;
- bp2->bio_data = g_malloc(bp->bio_length, 0);
+ bp2->bio_data = g_malloc(bp->bio_length, M_WAITOK);
b = bp->bio_data;
e = bp->bio_data;
e += bp->bio_length;
@@ -322,7 +322,7 @@ g_aes_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
if (buf == NULL || error != 0) {
break;
}
- sc = g_malloc(sizeof(struct g_aes_softc), M_ZERO);
+ sc = g_malloc(sizeof(struct g_aes_softc), M_WAITOK | M_ZERO);
if (!memcmp(buf, aes_magic, strlen(aes_magic))) {
sc->keying = KEY_ZERO;
} else if (!memcmp(buf, aes_magic_random,
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c
index c7f6591..d947708 100644
--- a/sys/geom/geom_ccd.c
+++ b/sys/geom/geom_ccd.c
@@ -186,7 +186,7 @@ ccdnew(int unit)
if (IS_ALLOCATED(unit) || unit > 32)
return (NULL);
- MALLOC(sc, struct ccd_s *, sizeof(*sc), M_CCD, M_ZERO);
+ MALLOC(sc, struct ccd_s *, sizeof(*sc), M_CCD, M_WAITOK | M_ZERO);
sc->sc_unit = unit;
LIST_INSERT_HEAD(&ccd_softc_list, sc, list);
/* XXX: UNLOCK(unique unit numbers) */
@@ -263,7 +263,7 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td)
/* Allocate space for the component info. */
cs->sc_cinfo = malloc(cs->sc_nccdisks * sizeof(struct ccdcinfo),
- M_CCD, 0);
+ M_CCD, M_WAITOK);
/*
* Verify that each component piece exists and record
@@ -271,7 +271,7 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td)
*/
maxsecsize = 0;
minsize = 0;
- tmppath = malloc(MAXPATHLEN, M_CCD, 0);
+ tmppath = malloc(MAXPATHLEN, M_CCD, M_WAITOK);
for (ix = 0; ix < cs->sc_nccdisks; ix++) {
vp = cs->sc_vpp[ix];
ci = &cs->sc_cinfo[ix];
@@ -284,7 +284,7 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td)
MAXPATHLEN, &ci->ci_pathlen)) != 0) {
goto fail;
}
- ci->ci_path = malloc(ci->ci_pathlen, M_CCD, 0);
+ ci->ci_path = malloc(ci->ci_pathlen, M_CCD, M_WAITOK);
bcopy(tmppath, ci->ci_path, ci->ci_pathlen);
ci->ci_dev = vn_todev(vp);
@@ -439,7 +439,7 @@ ccdinterleave(struct ccd_s *cs, int unit)
*/
size = (cs->sc_nccdisks + 1) * sizeof(struct ccdiinfo);
cs->sc_itable = (struct ccdiinfo *)malloc(size, M_CCD,
- M_ZERO);
+ M_WAITOK | M_ZERO);
/*
* Trivial case: no interleave (actually interleave of disk size).
@@ -453,7 +453,7 @@ ccdinterleave(struct ccd_s *cs, int unit)
for (ix = 0; ix < cs->sc_nccdisks; ix++) {
/* Allocate space for ii_index. */
- ii->ii_index = malloc(sizeof(int), M_CCD, 0);
+ ii->ii_index = malloc(sizeof(int), M_CCD, M_WAITOK);
ii->ii_ndisk = 1;
ii->ii_startblk = bn;
ii->ii_startoff = 0;
@@ -476,7 +476,7 @@ ccdinterleave(struct ccd_s *cs, int unit)
* we use.
*/
ii->ii_index = malloc((sizeof(int) * cs->sc_nccdisks),
- M_CCD, 0);
+ M_CCD, M_WAITOK);
/*
* Locate the smallest of the remaining components
@@ -1066,9 +1066,9 @@ ccdioctltoo(int unit, u_long cmd, caddr_t data, int flag, struct thread *td)
* componet pathnames and device numbers.
*/
cpp = malloc(ccio->ccio_ndisks * sizeof(char *),
- M_CCD, 0);
+ M_CCD, M_WAITOK);
vpp = malloc(ccio->ccio_ndisks * sizeof(struct vnode *),
- M_CCD, 0);
+ M_CCD, M_WAITOK);
error = copyin((caddr_t)ccio->ccio_disks, (caddr_t)cpp,
ccio->ccio_ndisks * sizeof(char **));
@@ -1124,7 +1124,8 @@ ccdioctltoo(int unit, u_long cmd, caddr_t data, int flag, struct thread *td)
ccio->ccio_unit = unit;
ccio->ccio_size = cs->sc_size;
ccg = &cs->sc_geom;
- cs->sc_disk = malloc(sizeof(struct disk), M_CCD, M_ZERO);
+ cs->sc_disk = malloc(sizeof(struct disk), M_CCD,
+ M_ZERO | M_WAITOK);
cs->sc_disk->d_strategy = ccdstrategy;
cs->sc_disk->d_name = "ccd";
cs->sc_disk->d_sectorsize = ccg->ccg_secsize;
diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c
index b3cd331..48bac22 100644
--- a/sys/geom/geom_ctl.c
+++ b/sys/geom/geom_ctl.c
@@ -174,7 +174,7 @@ g_ctl_ioctl_configgeom(dev_t dev, u_long cmd, caddr_t data, int fflag, struct th
else if (gcp->len == 0) {
ga.ptr = NULL;
} else {
- ga.ptr = g_malloc(gcp->len, 0);
+ ga.ptr = g_malloc(gcp->len, M_WAITOK);
error = copyin(gcp->ptr, ga.ptr, gcp->len);
if (error) {
g_free(ga.ptr);
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 2bb3ac6..55a9058 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -305,7 +305,7 @@ g_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
break;
default:
- gio = g_malloc(sizeof *gio, M_ZERO);
+ gio = g_malloc(sizeof *gio, M_WAITOK | M_ZERO);
gio->cmd = cmd;
gio->data = data;
gio->fflag = fflag;
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 4688bcf..1f7e8b0 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -337,7 +337,7 @@ disk_create(int unit, struct disk *dp, int flags, struct cdevsw *cdevsw, void *
{
dev_t dev;
- dev = g_malloc(sizeof *dev, M_ZERO);
+ dev = g_malloc(sizeof *dev, M_WAITOK | M_ZERO);
dp->d_unit = unit;
dp->d_dev = dev;
dp->d_flags = flags;
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c
index 228bc06..1b657e9 100644
--- a/sys/geom/geom_event.c
+++ b/sys/geom/geom_event.c
@@ -266,7 +266,7 @@ g_post_event(enum g_events ev, struct g_class *mp, struct g_geom *gp, struct g_p
g_trace(G_T_TOPOLOGY, "g_post_event(%d, %p, %p, %p, %p)",
ev, mp, gp, pp, cp);
g_topology_assert();
- ep = g_malloc(sizeof *ep, M_ZERO);
+ ep = g_malloc(sizeof *ep, M_WAITOK | M_ZERO);
ep->event = ev;
if (mp != NULL) {
ep->class = mp;
diff --git a/sys/geom/geom_gpt.c b/sys/geom/geom_gpt.c
index a54d9a2..6b046c4 100644
--- a/sys/geom/geom_gpt.c
+++ b/sys/geom/geom_gpt.c
@@ -220,7 +220,7 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist)
ent = (void*)(buf + i * hdr->hdr_entsz);
if (!memcmp(&ent->ent_type, &unused, sizeof(unused)))
continue;
- gs->part[i] = g_malloc(hdr->hdr_entsz, 0);
+ gs->part[i] = g_malloc(hdr->hdr_entsz, M_WAITOK);
if (gs->part[i] == NULL)
break;
bcopy(ent, gs->part[i], hdr->hdr_entsz);
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index dc42637..399df59 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -493,7 +493,7 @@ g_read_data(struct g_consumer *cp, off_t offset, off_t length, int *error)
bp->bio_done = NULL;
bp->bio_offset = offset;
bp->bio_length = length;
- ptr = g_malloc(length, 0);
+ ptr = g_malloc(length, M_WAITOK);
bp->bio_data = ptr;
g_io_request(bp, cp);
errorc = biowait(bp, "gread");
diff --git a/sys/geom/geom_mirror.c b/sys/geom/geom_mirror.c
index db426cd..23e2f52 100644
--- a/sys/geom/geom_mirror.c
+++ b/sys/geom/geom_mirror.c
@@ -214,7 +214,7 @@ g_mirror_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
g_topology_unlock();
break;
}
- gp->softc = g_malloc(sizeof(struct g_mirror_softc), 0);
+ gp->softc = g_malloc(sizeof(struct g_mirror_softc), M_WAITOK);
sc = gp->softc;
memcpy(sc->magic, buf + 16, sizeof sc->magic);
g_topology_lock();
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c
index 43fbc5f..0a23751 100644
--- a/sys/geom/geom_slice.c
+++ b/sys/geom/geom_slice.c
@@ -71,10 +71,10 @@ g_slice_init(unsigned nslice, unsigned scsize)
{
struct g_slicer *gsp;
- gsp = g_malloc(sizeof *gsp, M_ZERO);
- gsp->softc = g_malloc(scsize, M_ZERO);
+ gsp = g_malloc(sizeof *gsp, M_WAITOK | M_ZERO);
+ gsp->softc = g_malloc(scsize, M_WAITOK | M_ZERO);
gsp->slices = g_malloc(nslice * sizeof(struct g_slice),
- M_ZERO);
+ M_WAITOK | M_ZERO);
gsp->nslice = nslice;
return (gsp);
}
@@ -377,7 +377,7 @@ g_slice_conf_hot(struct g_geom *gp, u_int idx, off_t offset, off_t length)
gsp = gp->softc;
gsl = gsp->hot;
if(idx >= gsp->nhot) {
- gsl2 = g_malloc((idx + 1) * sizeof *gsl2, M_ZERO);
+ gsl2 = g_malloc((idx + 1) * sizeof *gsl2, M_WAITOK | M_ZERO);
if (gsp->hot != NULL)
bcopy(gsp->hot, gsl2, gsp->nhot * sizeof *gsl2);
gsp->hot = gsl2;
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index e2209fc..1b9c01e 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -100,9 +100,9 @@ g_new_geomf(struct g_class *mp, const char *fmt, ...)
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_vprintf(sb, fmt, ap);
sbuf_finish(sb);
- gp = g_malloc(sizeof *gp, M_ZERO);
+ gp = g_malloc(sizeof *gp, M_WAITOK | M_ZERO);
gp->protect = 0x020016601;
- gp->name = g_malloc(sbuf_len(sb) + 1, M_ZERO);
+ gp->name = g_malloc(sbuf_len(sb) + 1, M_WAITOK | M_ZERO);
gp->class = mp;
gp->rank = 1;
LIST_INIT(&gp->consumer);
@@ -143,7 +143,7 @@ g_new_consumer(struct g_geom *gp)
("g_new_consumer on geom(%s) (class %s) without orphan",
gp->name, gp->class->name));
- cp = g_malloc(sizeof *cp, M_ZERO);
+ cp = g_malloc(sizeof *cp, M_WAITOK | M_ZERO);
cp->protect = 0x020016602;
cp->geom = gp;
cp->stat = g_stat_new(cp);
@@ -179,7 +179,7 @@ g_new_providerf(struct g_geom *gp, const char *fmt, ...)
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_vprintf(sb, fmt, ap);
sbuf_finish(sb);
- pp = g_malloc(sizeof *pp + sbuf_len(sb) + 1, M_ZERO);
+ pp = g_malloc(sizeof *pp + sbuf_len(sb) + 1, M_WAITOK | M_ZERO);
pp->protect = 0x020016603;
pp->name = (char *)(pp + 1);
strcpy(pp->name, sbuf_data(sb));
@@ -684,7 +684,7 @@ g_idclass(struct geomidorname *p)
return (mp);
return (NULL);
}
- n = g_malloc(p->len + 1, 0);
+ n = g_malloc(p->len + 1, M_WAITOK);
if (copyin(p->u.name, n, p->len) == 0) {
n[p->len] = '\0';
LIST_FOREACH(mp, &g_classes, class)
@@ -711,7 +711,7 @@ g_idgeom(struct geomidorname *p)
return (gp);
return (NULL);
}
- n = g_malloc(p->len + 1, 0);
+ n = g_malloc(p->len + 1, M_WAITOK);
if (copyin(p->u.name, n, p->len) == 0) {
n[p->len] = '\0';
LIST_FOREACH(mp, &g_classes, class)
@@ -741,7 +741,7 @@ g_idprovider(struct geomidorname *p)
return (pp);
return (NULL);
}
- n = g_malloc(p->len + 1, 0);
+ n = g_malloc(p->len + 1, M_WAITOK);
if (copyin(p->u.name, n, p->len) == 0) {
n[p->len] = '\0';
LIST_FOREACH(mp, &g_classes, class)
OpenPOWER on IntegriCloud