The branch main has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=656f7f43f204ad1e6956f8257f66b50e032a6c61

commit 656f7f43f204ad1e6956f8257f66b50e032a6c61
Author:     Wuyang Chung <wy-ch...@outlook.com>
AuthorDate: 2025-07-29 03:42:24 +0000
Commit:     Warner Losh <i...@freebsd.org>
CommitDate: 2025-09-05 18:42:21 +0000

    call g_new_geom instead for callers that pass regular string to g_new_geomf
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1786
---
 sys/geom/cache/g_cache.c         | 4 ++--
 sys/geom/concat/g_concat.c       | 4 ++--
 sys/geom/eli/g_eli.c             | 2 +-
 sys/geom/gate/g_gate.c           | 2 +-
 sys/geom/geom_dev.c              | 2 +-
 sys/geom/geom_slice.c            | 2 +-
 sys/geom/journal/g_journal.c     | 2 +-
 sys/geom/label/g_label.c         | 2 +-
 sys/geom/linux_lvm/g_linux_lvm.c | 4 ++--
 sys/geom/mirror/g_mirror.c       | 4 ++--
 sys/geom/mirror/g_mirror_ctl.c   | 2 +-
 sys/geom/mountver/g_mountver.c   | 2 +-
 sys/geom/multipath/g_multipath.c | 4 ++--
 sys/geom/nop/g_nop.c             | 2 +-
 sys/geom/part/g_part.c           | 4 ++--
 sys/geom/raid/g_raid.c           | 4 ++--
 sys/geom/raid3/g_raid3.c         | 4 ++--
 sys/geom/raid3/g_raid3_ctl.c     | 2 +-
 sys/geom/shsec/g_shsec.c         | 4 ++--
 sys/geom/stripe/g_stripe.c       | 4 ++--
 sys/geom/union/g_union.c         | 2 +-
 sys/geom/virstor/g_virstor.c     | 4 ++--
 sys/geom/zero/g_zero.c           | 2 +-
 23 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/sys/geom/cache/g_cache.c b/sys/geom/cache/g_cache.c
index 9d0b10f4192e..c6b80786ade5 100644
--- a/sys/geom/cache/g_cache.c
+++ b/sys/geom/cache/g_cache.c
@@ -504,7 +504,7 @@ g_cache_create(struct g_class *mp, struct g_provider *pp,
                return (NULL);
        }
 
-       gp = g_new_geomf(mp, "%s", md->md_name);
+       gp = g_new_geom(mp, md->md_name);
        sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
        sc->sc_type = type;
        sc->sc_bshift = bshift;
@@ -665,7 +665,7 @@ g_cache_taste(struct g_class *mp, struct g_provider *pp, 
int flags __unused)
 
        G_CACHE_DEBUG(3, "Tasting %s.", pp->name);
 
-       gp = g_new_geomf(mp, "cache:taste");
+       gp = g_new_geom(mp, "cache:taste");
        gp->start = g_cache_start;
        gp->orphan = g_cache_orphan;
        gp->access = g_cache_access;
diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c
index 2173a84c7acf..fe83b54953cc 100644
--- a/sys/geom/concat/g_concat.c
+++ b/sys/geom/concat/g_concat.c
@@ -646,7 +646,7 @@ g_concat_create(struct g_class *mp, const struct 
g_concat_metadata *md,
                        return (NULL);
                }
        }
-       gp = g_new_geomf(mp, "%s", md->md_name);
+       gp = g_new_geom(mp, md->md_name);
        sc = malloc(sizeof(*sc), M_CONCAT, M_WAITOK | M_ZERO);
        gp->start = g_concat_start;
        gp->spoiled = g_concat_orphan;
@@ -753,7 +753,7 @@ g_concat_taste(struct g_class *mp, struct g_provider *pp, 
int flags __unused)
 
        G_CONCAT_DEBUG(3, "Tasting %s.", pp->name);
 
-       gp = g_new_geomf(mp, "concat:taste");
+       gp = g_new_geom(mp, "concat:taste");
        gp->start = g_concat_start;
        gp->access = g_concat_access;
        gp->orphan = g_concat_orphan;
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 5bd2d465183e..7fca50e7635c 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -769,7 +769,7 @@ g_eli_read_metadata_offset(struct g_class *mp, struct 
g_provider *pp,
 
        g_topology_assert();
 
-       gp = g_new_geomf(mp, "eli:taste");
+       gp = g_new_geom(mp, "eli:taste");
        gp->start = g_eli_start;
        gp->access = g_std_access;
        /*
diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c
index ecdcacff6707..76a4328227dd 100644
--- a/sys/geom/gate/g_gate.c
+++ b/sys/geom/gate/g_gate.c
@@ -571,7 +571,7 @@ g_gate_create(struct g_gate_ctl_create *ggio)
                }
        }
 
-       gp = g_new_geomf(&g_gate_class, "%s", name);
+       gp = g_new_geom(&g_gate_class, name);
        gp->start = g_gate_start;
        gp->access = g_gate_access;
        gp->orphan = g_gate_orphan;
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 4a2a850c2eab..27c65f15d5e3 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -355,7 +355,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int 
insist __unused)
 
        g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
        g_topology_assert();
-       gp = g_new_geomf(mp, "%s", pp->name);
+       gp = g_new_geom(mp, pp->name);
        sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
        mtx_init(&sc->sc_mtx, "g_dev", NULL, MTX_DEF);
        cp = g_new_consumer(gp);
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c
index 0491b0069be4..935293950c37 100644
--- a/sys/geom/geom_slice.c
+++ b/sys/geom/geom_slice.c
@@ -529,7 +529,7 @@ g_slice_new(struct g_class *mp, u_int slices, struct 
g_provider *pp, struct g_co
 
        g_topology_assert();
        vp = (void **)extrap;
-       gp = g_new_geomf(mp, "%s", pp->name);
+       gp = g_new_geom(mp, pp->name);
        gsp = g_slice_alloc(slices, extra);
        gsp->start = start;
        gp->softc = gsp;
diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c
index 6d9f6239e632..b520194b7d7c 100644
--- a/sys/geom/journal/g_journal.c
+++ b/sys/geom/journal/g_journal.c
@@ -2477,7 +2477,7 @@ g_journal_taste(struct g_class *mp, struct g_provider 
*pp, int flags __unused)
        if (pp->geom->class == mp)
                return (NULL);
 
-       gp = g_new_geomf(mp, "journal:taste");
+       gp = g_new_geom(mp, "journal:taste");
        /* This orphan function should be never called. */
        gp->orphan = g_journal_taste_orphan;
        cp = g_new_consumer(gp);
diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c
index acb17d40914e..faefbd7c2ef6 100644
--- a/sys/geom/label/g_label.c
+++ b/sys/geom/label/g_label.c
@@ -399,7 +399,7 @@ g_label_taste(struct g_class *mp, struct g_provider *pp, 
int flags __unused)
        if (strcmp(pp->geom->class->name, mp->name) == 0)
                return (NULL);
 
-       gp = g_new_geomf(mp, "label:taste");
+       gp = g_new_geom(mp, "label:taste");
        gp->start = g_label_start_taste;
        gp->access = g_label_access_taste;
        gp->orphan = g_label_orphan_taste;
diff --git a/sys/geom/linux_lvm/g_linux_lvm.c b/sys/geom/linux_lvm/g_linux_lvm.c
index c63318fed729..f333c08f45d9 100644
--- a/sys/geom/linux_lvm/g_linux_lvm.c
+++ b/sys/geom/linux_lvm/g_linux_lvm.c
@@ -537,7 +537,7 @@ g_llvm_taste(struct g_class *mp, struct g_provider *pp, int 
flags __unused)
 
        g_topology_assert();
        g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
-       gp = g_new_geomf(mp, "linux_lvm:taste");
+       gp = g_new_geom(mp, "linux_lvm:taste");
        /* This orphan function should be never called. */
        gp->orphan = g_llvm_taste_orphan;
        cp = g_new_consumer(gp);
@@ -557,7 +557,7 @@ g_llvm_taste(struct g_class *mp, struct g_provider *pp, int 
flags __unused)
        vg = md.md_vg;
        if (vg->vg_geom == NULL) {
                /* new volume group */
-               gp = g_new_geomf(mp, "%s", vg->vg_name);
+               gp = g_new_geom(mp, vg->vg_name);
                gp->start = g_llvm_start;
                gp->spoiled = g_llvm_orphan;
                gp->orphan = g_llvm_orphan;
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 25c0490938ef..03902a2f2491 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -3149,7 +3149,7 @@ g_mirror_create(struct g_class *mp, const struct 
g_mirror_metadata *md,
        /*
         * Action geom.
         */
-       gp = g_new_geomf(mp, "%s", md->md_name);
+       gp = g_new_geom(mp, md->md_name);
        sc = malloc(sizeof(*sc), M_MIRROR, M_WAITOK | M_ZERO);
        gp->start = g_mirror_start;
        gp->orphan = g_mirror_orphan;
@@ -3290,7 +3290,7 @@ g_mirror_taste(struct g_class *mp, struct g_provider *pp, 
int flags __unused)
        g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
        G_MIRROR_DEBUG(2, "Tasting %s.", pp->name);
 
-       gp = g_new_geomf(mp, "mirror:taste");
+       gp = g_new_geom(mp, "mirror:taste");
        /*
         * This orphan function should be never called.
         */
diff --git a/sys/geom/mirror/g_mirror_ctl.c b/sys/geom/mirror/g_mirror_ctl.c
index 82bc05a142c0..b31bf098ac4b 100644
--- a/sys/geom/mirror/g_mirror_ctl.c
+++ b/sys/geom/mirror/g_mirror_ctl.c
@@ -433,7 +433,7 @@ g_mirror_ctl_create(struct gctl_req *req, struct g_class 
*mp)
        g_topology_lock();
        mediasize = OFF_MAX;
        sectorsize = 0;
-       gp = g_new_geomf(mp, "%s", md.md_name);
+       gp = g_new_geom(mp, md.md_name);
        gp->orphan = g_mirror_create_orphan;
        cp = g_new_consumer(gp);
        for (no = 1; no < *nargs; no++) {
diff --git a/sys/geom/mountver/g_mountver.c b/sys/geom/mountver/g_mountver.c
index de3a298735d4..c7d55c4734a2 100644
--- a/sys/geom/mountver/g_mountver.c
+++ b/sys/geom/mountver/g_mountver.c
@@ -291,7 +291,7 @@ g_mountver_create(struct gctl_req *req, struct g_class *mp, 
struct g_provider *p
                        return (EEXIST);
                }
        }
-       gp = g_new_geomf(mp, "%s", name);
+       gp = g_new_geom(mp, name);
        sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
        mtx_init(&sc->sc_mtx, "gmountver", NULL, MTX_DEF | MTX_RECURSE);
        TAILQ_INIT(&sc->sc_queue);
diff --git a/sys/geom/multipath/g_multipath.c b/sys/geom/multipath/g_multipath.c
index a4935df7eaa1..250a2c60ffee 100644
--- a/sys/geom/multipath/g_multipath.c
+++ b/sys/geom/multipath/g_multipath.c
@@ -549,7 +549,7 @@ g_multipath_create(struct g_class *mp, struct 
g_multipath_metadata *md)
                }
        }
 
-       gp = g_new_geomf(mp, "%s", md->md_name);
+       gp = g_new_geom(mp, 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));
@@ -821,7 +821,7 @@ g_multipath_taste(struct g_class *mp, struct g_provider 
*pp, int flags __unused)
 
        g_topology_assert();
 
-       gp = g_new_geomf(mp, "multipath:taste");
+       gp = g_new_geom(mp, "multipath:taste");
        gp->start = g_multipath_start;
        gp->access = g_multipath_access;
        gp->orphan = g_multipath_orphan;
diff --git a/sys/geom/nop/g_nop.c b/sys/geom/nop/g_nop.c
index a32111e3a29a..1fb99f4a0a5b 100644
--- a/sys/geom/nop/g_nop.c
+++ b/sys/geom/nop/g_nop.c
@@ -416,7 +416,7 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, 
struct g_provider *pp,
                        return (EEXIST);
                }
        }
-       gp = g_new_geomf(mp, "%s", name);
+       gp = g_new_geom(mp, name);
        sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
        sc->sc_offset = offset;
        sc->sc_explicitsize = explicitsize;
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 88e44b335b29..8a7f67d8a313 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -998,7 +998,7 @@ g_part_ctl_create(struct gctl_req *req, struct g_part_parms 
*gpp)
        }
 
        if (null == NULL)
-               gp = g_new_geomf(&g_part_class, "%s", pp->name);
+               gp = g_new_geom(&g_part_class, pp->name);
        gp->softc = kobj_create((kobj_class_t)gpp->gpp_scheme, M_GEOM,
            M_WAITOK);
        table = gp->softc;
@@ -1979,7 +1979,7 @@ g_part_taste(struct g_class *mp, struct g_provider *pp, 
int flags __unused)
         * With that we become part of the topology. Obtain read access
         * to the provider.
         */
-       gp = g_new_geomf(mp, "%s", pp->name);
+       gp = g_new_geom(mp, pp->name);
        cp = g_new_consumer(gp);
        cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
        error = g_attach(cp, pp);
diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c
index a483622d14a5..590f28aaa46c 100644
--- a/sys/geom/raid/g_raid.c
+++ b/sys/geom/raid/g_raid.c
@@ -1876,7 +1876,7 @@ g_raid_create_node(struct g_class *mp,
        g_topology_assert();
        G_RAID_DEBUG(1, "Creating array %s.", name);
 
-       gp = g_new_geomf(mp, "%s", name);
+       gp = g_new_geom(mp, name);
        sc = malloc(sizeof(*sc), M_RAID, M_WAITOK | M_ZERO);
        gp->start = g_raid_start;
        gp->orphan = g_raid_orphan;
@@ -2217,7 +2217,7 @@ g_raid_taste(struct g_class *mp, struct g_provider *pp, 
int flags __unused)
 
        geom = NULL;
        status = G_RAID_MD_TASTE_FAIL;
-       gp = g_new_geomf(mp, "raid:taste");
+       gp = g_new_geom(mp, "raid:taste");
        /*
         * This orphan function should be never called.
         */
diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c
index c2d05b48d80d..64951bd01deb 100644
--- a/sys/geom/raid3/g_raid3.c
+++ b/sys/geom/raid3/g_raid3.c
@@ -3164,7 +3164,7 @@ g_raid3_create(struct g_class *mp, const struct 
g_raid3_metadata *md)
        /*
         * Action geom.
         */
-       gp = g_new_geomf(mp, "%s", md->md_name);
+       gp = g_new_geom(mp, md->md_name);
        sc = malloc(sizeof(*sc), M_RAID3, M_WAITOK | M_ZERO);
        sc->sc_disks = malloc(sizeof(struct g_raid3_disk) * md->md_all, M_RAID3,
            M_WAITOK | M_ZERO);
@@ -3338,7 +3338,7 @@ g_raid3_taste(struct g_class *mp, struct g_provider *pp, 
int flags __unused)
        g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
        G_RAID3_DEBUG(2, "Tasting %s.", pp->name);
 
-       gp = g_new_geomf(mp, "raid3:taste");
+       gp = g_new_geom(mp, "raid3:taste");
        /* This orphan function should be never called. */
        gp->orphan = g_raid3_taste_orphan;
        cp = g_new_consumer(gp);
diff --git a/sys/geom/raid3/g_raid3_ctl.c b/sys/geom/raid3/g_raid3_ctl.c
index 824de07e4836..5eafcce917cf 100644
--- a/sys/geom/raid3/g_raid3_ctl.c
+++ b/sys/geom/raid3/g_raid3_ctl.c
@@ -425,7 +425,7 @@ g_raid3_ctl_insert(struct gctl_req *req, struct g_class *mp)
                no = gctl_get_paraml(req, "number", sizeof(*no));
        else
                no = NULL;
-       gp = g_new_geomf(mp, "raid3:insert");
+       gp = g_new_geom(mp, "raid3:insert");
        gp->orphan = g_raid3_ctl_insert_orphan;
        cp = g_new_consumer(gp);
        error = g_attach(cp, pp);
diff --git a/sys/geom/shsec/g_shsec.c b/sys/geom/shsec/g_shsec.c
index 3ccc23e7eb8b..9da814e5eb34 100644
--- a/sys/geom/shsec/g_shsec.c
+++ b/sys/geom/shsec/g_shsec.c
@@ -545,7 +545,7 @@ g_shsec_create(struct g_class *mp, const struct 
g_shsec_metadata *md)
                        return (NULL);
                }
        }
-       gp = g_new_geomf(mp, "%s", md->md_name);
+       gp = g_new_geom(mp, md->md_name);
        sc = malloc(sizeof(*sc), M_SHSEC, M_WAITOK | M_ZERO);
        gp->start = g_shsec_start;
        gp->spoiled = g_shsec_orphan;
@@ -643,7 +643,7 @@ g_shsec_taste(struct g_class *mp, struct g_provider *pp, 
int flags __unused)
 
        G_SHSEC_DEBUG(3, "Tasting %s.", pp->name);
 
-       gp = g_new_geomf(mp, "shsec:taste");
+       gp = g_new_geom(mp, "shsec:taste");
        gp->start = g_shsec_start;
        gp->access = g_shsec_access;
        gp->orphan = g_shsec_orphan;
diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c
index 669936ba0dbf..ba1953f036d3 100644
--- a/sys/geom/stripe/g_stripe.c
+++ b/sys/geom/stripe/g_stripe.c
@@ -862,7 +862,7 @@ g_stripe_create(struct g_class *mp, const struct 
g_stripe_metadata *md,
                        return (NULL);
                }
        }
-       gp = g_new_geomf(mp, "%s", md->md_name);
+       gp = g_new_geom(mp, md->md_name);
        sc = malloc(sizeof(*sc), M_STRIPE, M_WAITOK | M_ZERO);
        gp->start = g_stripe_start;
        gp->spoiled = g_stripe_orphan;
@@ -963,7 +963,7 @@ g_stripe_taste(struct g_class *mp, struct g_provider *pp, 
int flags __unused)
 
        G_STRIPE_DEBUG(3, "Tasting %s.", pp->name);
 
-       gp = g_new_geomf(mp, "stripe:taste");
+       gp = g_new_geom(mp, "stripe:taste");
        gp->start = g_stripe_start;
        gp->access = g_stripe_access;
        gp->orphan = g_stripe_orphan;
diff --git a/sys/geom/union/g_union.c b/sys/geom/union/g_union.c
index 0701e76db671..302761597f6f 100644
--- a/sys/geom/union/g_union.c
+++ b/sys/geom/union/g_union.c
@@ -246,7 +246,7 @@ g_union_ctl_create(struct gctl_req *req, struct g_class 
*mp, bool verbose)
                        return;
                }
        }
-       gp = g_new_geomf(mp, "%s", name);
+       gp = g_new_geom(mp, name);
        sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
        rw_init(&sc->sc_rwlock, "gunion");
        TAILQ_INIT(&sc->sc_wiplist);
diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c
index c7d737493f11..1490ed103329 100644
--- a/sys/geom/virstor/g_virstor.c
+++ b/sys/geom/virstor/g_virstor.c
@@ -771,7 +771,7 @@ g_virstor_taste(struct g_class *mp, struct g_provider *pp, 
int flags)
        LOG_MSG(LVL_DEBUG, "Tasting %s", pp->name);
 
        /* We need a dummy geom to attach a consumer to the given provider */
-       gp = g_new_geomf(mp, "virstor:taste.helper");
+       gp = g_new_geom(mp, "virstor:taste.helper");
        gp->start = (void *)invalid_call;       /* XXX: hacked up so the        
*/
        gp->access = (void *)invalid_call;      /* compiler doesn't complain.   
*/
        gp->orphan = (void *)invalid_call;      /* I really want these to fail. 
*/
@@ -1085,7 +1085,7 @@ create_virstor_geom(struct g_class *mp, struct 
g_virstor_metadata *md)
                        return (NULL);
                }
        }
-       gp = g_new_geomf(mp, "%s", md->md_name);
+       gp = g_new_geom(mp, md->md_name);
        gp->softc = NULL; /* to circumevent races that test softc */
 
        gp->start = g_virstor_start;
diff --git a/sys/geom/zero/g_zero.c b/sys/geom/zero/g_zero.c
index 91ef0fb1ef95..e9934ba6c784 100644
--- a/sys/geom/zero/g_zero.c
+++ b/sys/geom/zero/g_zero.c
@@ -102,7 +102,7 @@ g_zero_init(struct g_class *mp)
        struct g_provider *pp;
 
        g_topology_assert();
-       gp = g_new_geomf(mp, "gzero");
+       gp = g_new_geom(mp, "gzero");
        gp->start = g_zero_start;
        gp->access = g_std_access;
        gpp = pp = g_new_providerf(gp, "%s", gp->name);

Reply via email to