Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Dec 2012 18:25:05 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r244547 - in stable/9/sys: dev/fdc geom geom/bde geom/cache geom/label geom/mountver geom/multipath geom/nop geom/sched vm
Message-ID:  <201212211825.qBLIP5Fr012680@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Fri Dec 21 18:25:05 2012
New Revision: 244547
URL: http://svnweb.freebsd.org/changeset/base/244547

Log:
  MFC r243333:
  
  - Don't pass geom and provider names as format strings.
  - Add __printflike() attributes.
  - Remove an extra argument for the g_new_geomf() call in swapongeom_ev().

Modified:
  stable/9/sys/dev/fdc/fdc.c
  stable/9/sys/geom/bde/g_bde.c
  stable/9/sys/geom/cache/g_cache.c
  stable/9/sys/geom/geom.h
  stable/9/sys/geom/geom_aes.c
  stable/9/sys/geom/geom_dev.c
  stable/9/sys/geom/geom_mbr.c
  stable/9/sys/geom/geom_slice.c
  stable/9/sys/geom/geom_slice.h
  stable/9/sys/geom/label/g_label.c
  stable/9/sys/geom/mountver/g_mountver.c
  stable/9/sys/geom/multipath/g_multipath.c
  stable/9/sys/geom/nop/g_nop.c
  stable/9/sys/geom/sched/g_sched.c
  stable/9/sys/vm/swap_pager.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/fdc/fdc.c
==============================================================================
--- stable/9/sys/dev/fdc/fdc.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/dev/fdc/fdc.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -865,7 +865,7 @@ fdc_worker(struct fdc_data *fdc)
 		g_orphan_provider(fd->fd_provider, ENXIO);
 		fd->fd_provider->flags |= G_PF_WITHER;
 		fd->fd_provider =
-		    g_new_providerf(fd->fd_geom, fd->fd_geom->name);
+		    g_new_providerf(fd->fd_geom, "%s", fd->fd_geom->name);
 		g_error_provider(fd->fd_provider, 0);
 		g_topology_unlock();
 		return (fdc_biodone(fdc, ENXIO));
@@ -2011,7 +2011,7 @@ fd_attach2(void *arg, int flag)
 
 	fd->fd_geom = g_new_geomf(&g_fd_class,
 	    "fd%d", device_get_unit(fd->dev));
-	fd->fd_provider = g_new_providerf(fd->fd_geom, fd->fd_geom->name);
+	fd->fd_provider = g_new_providerf(fd->fd_geom, "%s", fd->fd_geom->name);
 	fd->fd_geom->softc = fd;
 	g_error_provider(fd->fd_provider, 0);
 }

Modified: stable/9/sys/geom/bde/g_bde.c
==============================================================================
--- stable/9/sys/geom/bde/g_bde.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/bde/g_bde.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -188,7 +188,7 @@ g_bde_create_geom(struct gctl_req *req, 
 		/* XXX: error check */
 		kproc_create(g_bde_worker, gp, &sc->thread, 0, 0,
 			"g_bde %s", gp->name);
-		pp = g_new_providerf(gp, gp->name);
+		pp = g_new_providerf(gp, "%s", gp->name);
 #if 0
 		/*
 		 * XXX: Disable this for now.  Appearantly UFS no longer

Modified: stable/9/sys/geom/cache/g_cache.c
==============================================================================
--- stable/9/sys/geom/cache/g_cache.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/cache/g_cache.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -501,7 +501,7 @@ g_cache_create(struct g_class *mp, struc
 		return (NULL);
 	}
 
-	gp = g_new_geomf(mp, md->md_name);
+	gp = g_new_geomf(mp, "%s", md->md_name);
 	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
 	sc->sc_type = type;
 	sc->sc_bshift = bshift;

Modified: stable/9/sys/geom/geom.h
==============================================================================
--- stable/9/sys/geom/geom.h	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/geom.h	Fri Dec 21 18:25:05 2012	(r244547)
@@ -263,8 +263,10 @@ int g_handleattr_int(struct bio *bp, con
 int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val);
 int g_handleattr_str(struct bio *bp, const char *attribute, const char *str);
 struct g_consumer * g_new_consumer(struct g_geom *gp);
-struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...);
-struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...);
+struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...)
+    __printflike(2, 3);
+struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...)
+    __printflike(2, 3);
 int g_retaste(struct g_class *mp);
 void g_spoil(struct g_provider *pp, struct g_consumer *cp);
 int g_std_access(struct g_provider *pp, int dr, int dw, int de);

Modified: stable/9/sys/geom/geom_aes.c
==============================================================================
--- stable/9/sys/geom/geom_aes.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/geom_aes.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -344,7 +344,7 @@ g_aes_taste(struct g_class *mp, struct g
 			}
 		}
 		g_topology_lock();
-		pp = g_new_providerf(gp, gp->name);
+		pp = g_new_providerf(gp, "%s", gp->name);
 		pp->mediasize = mediasize - sectorsize;
 		pp->sectorsize = sectorsize;
 		g_error_provider(pp, 0);

Modified: stable/9/sys/geom/geom_dev.c
==============================================================================
--- stable/9/sys/geom/geom_dev.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/geom_dev.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -164,7 +164,7 @@ g_dev_taste(struct g_class *mp, struct g
 	LIST_FOREACH(cp, &pp->consumers, consumers)
 		if (cp->geom->class == mp)
 			return (NULL);
-	gp = g_new_geomf(mp, pp->name);
+	gp = g_new_geomf(mp, "%s", pp->name);
 	cp = g_new_consumer(gp);
 	error = g_attach(cp, pp);
 	KASSERT(error == 0,

Modified: stable/9/sys/geom/geom_mbr.c
==============================================================================
--- stable/9/sys/geom/geom_mbr.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/geom_mbr.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -483,8 +483,8 @@ g_mbrext_taste(struct g_class *mp, struc
 				    ((off_t)dp[0].dp_size) << 9ULL,
 				    sectorsize,
 				    "%*.*s%d",
-				    strlen(gp->name) - 1,
-				    strlen(gp->name) - 1,
+				    (int)strlen(gp->name) - 1,
+				    (int)strlen(gp->name) - 1,
 				    gp->name,
 				    slice + 5);
 				g_topology_unlock();

Modified: stable/9/sys/geom/geom_slice.c
==============================================================================
--- stable/9/sys/geom/geom_slice.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/geom_slice.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -390,7 +390,7 @@ g_slice_config(struct g_geom *gp, u_int 
 	sbuf_vprintf(sb, fmt, ap);
 	va_end(ap);
 	sbuf_finish(sb);
-	pp = g_new_providerf(gp, sbuf_data(sb));
+	pp = g_new_providerf(gp, "%s", sbuf_data(sb));
 	pp2 = LIST_FIRST(&gp->consumer)->provider;
 	pp->flags = pp2->flags & G_PF_CANDELETE;
 	pp->stripesize = pp2->stripesize;

Modified: stable/9/sys/geom/geom_slice.h
==============================================================================
--- stable/9/sys/geom/geom_slice.h	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/geom_slice.h	Fri Dec 21 18:25:05 2012	(r244547)
@@ -69,7 +69,7 @@ struct g_slicer {
 };
 
 g_dumpconf_t g_slice_dumpconf;
-int g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length, u_int sectorsize, const char *fmt, ...);
+int g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length, u_int sectorsize, const char *fmt, ...) __printflike(7, 8);
 void g_slice_spoiled(struct g_consumer *cp);
 void g_slice_orphan(struct g_consumer *cp);
 #define G_SLICE_CONFIG_CHECK	0

Modified: stable/9/sys/geom/label/g_label.c
==============================================================================
--- stable/9/sys/geom/label/g_label.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/label/g_label.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -187,7 +187,7 @@ g_label_create(struct gctl_req *req, str
 	gp->spoiled = g_label_spoiled;
 	g_access(cp, -1, 0, 0);
 	g_slice_config(gp, 0, G_SLICE_CONFIG_SET, (off_t)0, mediasize,
-	    pp->sectorsize, name);
+	    pp->sectorsize, "%s", name);
 	G_LABEL_DEBUG(1, "Label for provider %s is %s.", pp->name, name);
 	return (gp);
 }

Modified: stable/9/sys/geom/mountver/g_mountver.c
==============================================================================
--- stable/9/sys/geom/mountver/g_mountver.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/mountver/g_mountver.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -249,7 +249,7 @@ g_mountver_create(struct gctl_req *req, 
 			return (EEXIST);
 		}
 	}
-	gp = g_new_geomf(mp, name);
+	gp = g_new_geomf(mp, "%s", name);
 	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
 	mtx_init(&sc->sc_mtx, "gmountver", NULL, MTX_DEF);
 	TAILQ_INIT(&sc->sc_queue);
@@ -260,7 +260,7 @@ g_mountver_create(struct gctl_req *req, 
 	gp->access = g_mountver_access;
 	gp->dumpconf = g_mountver_dumpconf;
 
-	newpp = g_new_providerf(gp, gp->name);
+	newpp = g_new_providerf(gp, "%s", gp->name);
 	newpp->mediasize = pp->mediasize;
 	newpp->sectorsize = pp->sectorsize;
 

Modified: stable/9/sys/geom/multipath/g_multipath.c
==============================================================================
--- stable/9/sys/geom/multipath/g_multipath.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/multipath/g_multipath.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -429,7 +429,7 @@ g_multipath_create(struct g_class *mp, s
 		}
 	}
 
-	gp = g_new_geomf(mp, md->md_name);
+	gp = g_new_geomf(mp, "%s", md->md_name);
 	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
 	mtx_init(&sc->sc_mtx, "multipath", NULL, MTX_DEF);
 	memcpy(sc->sc_uuid, md->md_uuid, sizeof (sc->sc_uuid));

Modified: stable/9/sys/geom/nop/g_nop.c
==============================================================================
--- stable/9/sys/geom/nop/g_nop.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/nop/g_nop.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -189,7 +189,7 @@ g_nop_create(struct gctl_req *req, struc
 			return (EEXIST);
 		}
 	}
-	gp = g_new_geomf(mp, name);
+	gp = g_new_geomf(mp, "%s", name);
 	sc = g_malloc(sizeof(*sc), M_WAITOK);
 	sc->sc_offset = offset;
 	sc->sc_error = ioerror;
@@ -205,7 +205,7 @@ g_nop_create(struct gctl_req *req, struc
 	gp->access = g_nop_access;
 	gp->dumpconf = g_nop_dumpconf;
 
-	newpp = g_new_providerf(gp, gp->name);
+	newpp = g_new_providerf(gp, "%s", gp->name);
 	newpp->mediasize = size;
 	newpp->sectorsize = secsize;
 

Modified: stable/9/sys/geom/sched/g_sched.c
==============================================================================
--- stable/9/sys/geom/sched/g_sched.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/geom/sched/g_sched.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -1003,7 +1003,7 @@ g_sched_create(struct gctl_req *req, str
 		}
 	}
 
-	gp = g_new_geomf(mp, name);
+	gp = g_new_geomf(mp, "%s", name);
 	dstgp = proxy ? pp->geom : gp; /* where do we link the provider */
 
 	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
@@ -1029,7 +1029,7 @@ g_sched_create(struct gctl_req *req, str
 	gp->access = g_sched_access;
 	gp->dumpconf = g_sched_dumpconf;
 
-	newpp = g_new_providerf(dstgp, gp->name);
+	newpp = g_new_providerf(dstgp, "%s", gp->name);
 	newpp->mediasize = pp->mediasize;
 	newpp->sectorsize = pp->sectorsize;
 

Modified: stable/9/sys/vm/swap_pager.c
==============================================================================
--- stable/9/sys/vm/swap_pager.c	Fri Dec 21 18:00:11 2012	(r244546)
+++ stable/9/sys/vm/swap_pager.c	Fri Dec 21 18:25:05 2012	(r244547)
@@ -2612,7 +2612,7 @@ swapongeom_ev(void *arg, int flags)
 	}
 	mtx_unlock(&sw_dev_mtx);
 	if (gp == NULL)
-		gp = g_new_geomf(&g_swap_class, "swap", NULL);
+		gp = g_new_geomf(&g_swap_class, "swap");
 	cp = g_new_consumer(gp);
 	g_attach(cp, pp);
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212211825.qBLIP5Fr012680>