summaryrefslogtreecommitdiff
path: root/sbin/geom/class
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2017-04-27 19:03:08 +0000
committerAlexander Motin <mav@FreeBSD.org>2017-04-27 19:03:08 +0000
commit5e50c20ea1e239e3e1672804e72cd6a15a036f18 (patch)
treef2f8ce38bbacd42cdfa080f551469162f9303946 /sbin/geom/class
parent24b55fb76dbda93e35ac35be71b64bf0fabd5e54 (diff)
Notes
Diffstat (limited to 'sbin/geom/class')
-rw-r--r--sbin/geom/class/part/geom_part.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c
index c6bd6d48765d4..d21e5eb6b6577 100644
--- a/sbin/geom/class/part/geom_part.c
+++ b/sbin/geom/class/part/geom_part.c
@@ -73,6 +73,7 @@ volatile sig_atomic_t undo_restore;
static struct gclass *find_class(struct gmesh *, const char *);
static struct ggeom * find_geom(struct gclass *, const char *);
+static int geom_is_withered(struct ggeom *);
static const char *find_geomcfg(struct ggeom *, const char *);
static const char *find_provcfg(struct gprovider *, const char *);
static struct gprovider *find_provider(struct ggeom *, off_t);
@@ -215,7 +216,7 @@ find_geom(struct gclass *classp, const char *name)
LIST_FOREACH(gp, &classp->lg_geom, lg_geom) {
if (strcmp(gp->lg_name, name) != 0)
continue;
- if (find_geomcfg(gp, "wither") == NULL)
+ if (!geom_is_withered(gp))
return (gp);
else
wgp = gp;
@@ -223,6 +224,18 @@ find_geom(struct gclass *classp, const char *name)
return (wgp);
}
+static int
+geom_is_withered(struct ggeom *gp)
+{
+ struct gconfig *gc;
+
+ LIST_FOREACH(gc, &gp->lg_config, lg_config) {
+ if (!strcmp(gc->lg_name, "wither"))
+ return (1);
+ }
+ return (0);
+}
+
static const char *
find_geomcfg(struct ggeom *gp, const char *cfg)
{
@@ -614,7 +627,7 @@ gpart_show_geom(struct ggeom *gp, const char *element, int show_providers)
off_t length, secsz;
int idx, wblocks, wname, wmax;
- if (find_geomcfg(gp, "wither"))
+ if (geom_is_withered(gp))
return;
scheme = find_geomcfg(gp, "scheme");
if (scheme == NULL)