PERFORCE change 123433 for review

Ulf Lilleengen lulf at FreeBSD.org
Fri Jul 13 11:34:05 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=123433

Change 123433 by lulf at lulf_carrot on 2007/07/13 11:33:35

	- Remove old comments.
	- Remember to pass the flags to detach command.
	- Update volume size after attach of subdisk.
	- Do not allow attach on concatenated plexes. It doesn't really have any
	  use, and it makes checking plex_offset a bit complicated.

Affected files ...

.. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum.c#28 edit
.. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_subr.c#18 edit

Differences ...

==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum.c#28 (text+ko) ====

@@ -246,8 +246,11 @@
 			return;
 		}
 		p = gv_find_plex(sc, parent);
+		if (p->org == GV_PLEX_CONCAT) {
+			gctl_error(req, "attach on concat plex not allowed");
+			break;
+		}
 		s = gv_find_sd(sc, child);
-		/* XXX: Rename not supported yet. */
 		gv_post_event(sc, GV_EVENT_ATTACH_SD, s, p, *offset, *rename);
 		break;
 	default:
@@ -275,14 +278,12 @@
 	type = gv_object_type(sc, object);
 	switch (type) {
 	case GV_TYPE_PLEX:
-		/* XXX: Support flags. */
 		p = gv_find_plex(sc, object);
-		gv_post_event(sc, GV_EVENT_DETACH_PLEX, p, NULL, 0, 0);
+		gv_post_event(sc, GV_EVENT_DETACH_PLEX, p, NULL, *flags, 0);
 		break;
 	case GV_TYPE_SD:
-		/* XXX: Support flags. */
 		s = gv_find_sd(sc, object);
-		gv_post_event(sc, GV_EVENT_DETACH_SD, s, NULL, 0, 0);
+		gv_post_event(sc, GV_EVENT_DETACH_SD, s, NULL, *flags, 0);
 		break;
 	default:
 		gctl_error(req, "invalid object type");
@@ -745,7 +746,8 @@
 			case GV_EVENT_DETACH_PLEX:
 				printf("VINUM: event 'detach'\n");
 				p = ev->arg1;
-				err = gv_detach_plex(p, 0);
+				flags = ev->arg3;
+				err = gv_detach_plex(p, flags);
 				if (err)
 					printf("VINUM: error detaching %s: "
 					    "error code %d\n", p->name, err);
@@ -754,7 +756,8 @@
 			case GV_EVENT_DETACH_SD:
 				printf("VINUM: event 'detach'\n");
 				s = ev->arg1;
-				err = gv_detach_sd(s, 0);
+				flags = ev->arg3;
+				err = gv_detach_sd(s, flags);
 				if (err)
 					printf("VINUM: error detaching %s: "
 					    "error code %d\n", s->name, err);

==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_subr.c#18 (text+ko) ====

@@ -1108,6 +1108,8 @@
 		snprintf(s->name, GV_MAXSDNAME, "%s.s%d", s->plex,
 		    p->sdcount - 1);
 	}
+	if (p->vol_sc != NULL)
+		gv_update_vol_size(p->vol_sc, gv_vol_size(p->vol_sc));
 	gv_save_config(p->vinumconf);
 	/* We don't update the subdisk state since the user might have to
 	 * initiate a rebuild/sync first. */


More information about the p4-projects mailing list