From owner-p4-projects@FreeBSD.ORG Sun Aug 7 02:22:44 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C709616A454; Sun, 7 Aug 2005 02:22:43 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 680A216A438 for ; Sun, 7 Aug 2005 02:22:43 +0000 (GMT) (envelope-from soc-cjones@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2BA4243D48 for ; Sun, 7 Aug 2005 02:22:43 +0000 (GMT) (envelope-from soc-cjones@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j772MhLt045381 for ; Sun, 7 Aug 2005 02:22:43 GMT (envelope-from soc-cjones@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j772MgMK045377 for perforce@freebsd.org; Sun, 7 Aug 2005 02:22:42 GMT (envelope-from soc-cjones@freebsd.org) Date: Sun, 7 Aug 2005 02:22:42 GMT Message-Id: <200508070222.j772MgMK045377@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-cjones@freebsd.org using -f From: soc-cjones To: Perforce Change Reviews Cc: Subject: PERFORCE change 81585 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2005 02:22:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=81585 Change 81585 by soc-cjones@soc-cjones_ishtar on 2005/08/07 02:22:16 It compiles. Whee. Affected files ... .. //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum_rename.c#2 edit Differences ... ==== //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum_rename.c#2 (text+ko) ==== @@ -45,10 +45,10 @@ static int gv_rename_sd(struct gv_softc *, struct gctl_req *, struct gv_sd *, char *, int); static int gv_rename_vol(struct gv_softc *, struct gctl_req *, - struct gv_vol *, char *, int); + struct gv_volume *, char *, int); void -gv_rename(struct g_geom *, struct gctl_req *) +gv_rename(struct g_geom *gp, struct gctl_req *req) { struct gv_softc *sc; struct gv_volume *v; @@ -66,14 +66,20 @@ argc = gctl_get_paraml(req, "argc", sizeof(*argc)); flags = gctl_get_paraml(req, "flags", sizeof(*flags)); - newname = gctl_get_paraml(req, "newname", sizeof(*newname)); - if (NULL == newname || 0 == *newname) { + newname = gctl_get_param(req, "newname", NULL); + if (NULL == newname) { gctl_error(req, "no new name given"); return; } + type = gv_object_type(sc, newname); + printf("gv_object_type(sc, \"%s\") = %d\n", newname, type); + if (-1 != type) { + gctl_error(req, "new name is already in use"); + return; + } - object = gctl_get_paraml(req, "object", sizeof(*object)); - if (NULL == object || 0 == *object) { + object = gctl_get_param(req, "object", NULL); + if (NULL == object) { gctl_error(req, "no object given"); return; } @@ -96,6 +102,8 @@ gctl_error(req, "unknown plex '%s'", object); return; } + gctl_error(req, "calling gv_rename_plex(,, %s, %s,)", p, newname); + return; err = gv_rename_plex(sc, req, p, newname, *flags); if (err) return; @@ -106,6 +114,8 @@ gctl_error(req, "unknown subdisk '%s'", object); return; } + gctl_error(req, "calling gv_rename_sd(,, %s, %s,)", s, newname); + return; err = gv_rename_sd(sc, req, s, newname, *flags); if (err) return; @@ -116,6 +126,8 @@ gctl_error(req, "unknown drive '%s'", object); return; } + gctl_error(req, "calling gv_rename_drive(,, %s, %s,)", d, newname); + return; err = gv_rename_drive(sc, req, d, newname, *flags); if (err) return; @@ -136,6 +148,8 @@ g_topology_assert(); KASSERT(d != NULL, ("gv_rename_drive: NULL d")); + return (0); + } static int @@ -146,6 +160,7 @@ g_topology_assert(); KASSERT(d != NULL, ("gv_rename_plex: NULL p")); + return (0); } static int @@ -156,14 +171,45 @@ g_topology_assert(); KASSERT(d != NULL, ("gv_rename_sd: NULL s")); + return (0); } static int -gv_rename_vol(struct gv_softc *sc, struct gctl_req *req, struct gv_vol *v, char *newname, int flags) +gv_rename_vol(struct gv_softc *sc, struct gctl_req *req, struct gv_volume *v, char *newname, int flags) { int err; + struct gv_plex *p; + struct gv_sd *s; g_topology_assert(); KASSERT(d != NULL, ("gv_rename_vol: NULL v")); + printf("gv_rename_vol:\n"); + printf("\tsc = %p\n", sc); + printf("\treq = %p\n", req); + printf("\tv = %p\n", v); + printf("\t\tv->name = %s\n", v->name); + printf("\t\tv->size = %d\n", (int) v->size); + printf("\t\tv->plexcount = %d\n", v->plexcount); + printf("\tnewname = \"%s\"\n", newname); + printf("\tflags = %x\n", flags); + + printf("iterating across plexes list...\n"); + LIST_FOREACH(p, &v->plexes, plex) { + if (strcmp(p->volume, v->name)) { + continue; /* Not a plex we're looking for. */ + } + printf("\tp->name = %s\n", p->name); + printf("\tp->size = %d\n", (int) p->size); + printf("\tp->volume = %s\n", p->volume); +/* LIST_FOREACH(s, &p->subdisks, sd) { + printf("\t\ts->name = %s\n", s->name); + printf("\t\ts->size = %d\n", (int) s->size); + printf("\t\ts->drive = %s\n", s->drive); + printf("\t\ts->plex = %s\n", s->plex); + } */ + } + + return (0); + }