summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-07-13 20:37:59 +0000
committerpjd <pjd@FreeBSD.org>2006-07-13 20:37:59 +0000
commit27c2ca32122c31456d60bac89aae091ff18728b0 (patch)
tree2ecc631709ebc0a17d4e5bd6f3aff8e35ccd458c /sys/geom
parent03e0206d84485a74106dd8900455d6656c09a6f2 (diff)
downloadFreeBSD-src-27c2ca32122c31456d60bac89aae091ff18728b0.zip
FreeBSD-src-27c2ca32122c31456d60bac89aae091ff18728b0.tar.gz
Always allow to specify components with /dev/ prefix.
MFC after: 3 days
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/mirror/g_mirror_ctl.c6
-rw-r--r--sys/geom/raid3/g_raid3_ctl.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/geom/mirror/g_mirror_ctl.c b/sys/geom/mirror/g_mirror_ctl.c
index a986913..9578782 100644
--- a/sys/geom/mirror/g_mirror_ctl.c
+++ b/sys/geom/mirror/g_mirror_ctl.c
@@ -75,6 +75,8 @@ g_mirror_find_disk(struct g_mirror_softc *sc, const char *name)
struct g_mirror_disk *disk;
sx_assert(&sc->sc_lock, SX_XLOCKED);
+ if (strncmp(name, "/dev/", 5) == 0)
+ name += 5;
LIST_FOREACH(disk, &sc->sc_disks, d_next) {
if (disk->d_consumer == NULL)
continue;
@@ -366,12 +368,12 @@ g_mirror_ctl_insert(struct gctl_req *req, struct g_class *mp)
gctl_error(req, "No 'arg%u' argument.", i);
continue;
}
- if (strncmp(name, "/dev/", strlen("/dev/")) == 0)
- name += strlen("/dev/");
if (g_mirror_find_disk(sc, name) != NULL) {
gctl_error(req, "Provider %s already inserted.", name);
continue;
}
+ if (strncmp(name, "/dev/", 5) == 0)
+ name += 5;
pp = g_provider_by_name(name);
if (pp == NULL) {
gctl_error(req, "Unknown provider %s.", name);
diff --git a/sys/geom/raid3/g_raid3_ctl.c b/sys/geom/raid3/g_raid3_ctl.c
index f687f56..2e80390 100644
--- a/sys/geom/raid3/g_raid3_ctl.c
+++ b/sys/geom/raid3/g_raid3_ctl.c
@@ -76,6 +76,8 @@ g_raid3_find_disk(struct g_raid3_softc *sc, const char *name)
u_int n;
sx_assert(&sc->sc_lock, SX_XLOCKED);
+ if (strncmp(name, "/dev/", 5) == 0)
+ name += 5;
for (n = 0; n < sc->sc_ndisks; n++) {
disk = &sc->sc_disks[n];
if (disk->d_state == G_RAID3_DISK_STATE_NODISK)
@@ -401,6 +403,8 @@ g_raid3_ctl_insert(struct gctl_req *req, struct g_class *mp)
gctl_error(req, "No '%s' argument.", "no");
return;
}
+ if (strncmp(name, "/dev/", 5) == 0)
+ name += 5;
g_topology_lock();
pp = g_provider_by_name(name);
if (pp == NULL) {
OpenPOWER on IntegriCloud