diff options
author | pjd <pjd@FreeBSD.org> | 2006-07-13 20:37:59 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-07-13 20:37:59 +0000 |
commit | 27c2ca32122c31456d60bac89aae091ff18728b0 (patch) | |
tree | 2ecc631709ebc0a17d4e5bd6f3aff8e35ccd458c /sys/geom/mirror/g_mirror_ctl.c | |
parent | 03e0206d84485a74106dd8900455d6656c09a6f2 (diff) | |
download | FreeBSD-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/mirror/g_mirror_ctl.c')
-rw-r--r-- | sys/geom/mirror/g_mirror_ctl.c | 6 |
1 files changed, 4 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); |