Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jul 2005 04:45:39 GMT
From:      soc-cjones <soc-cjones@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 79891 for review
Message-ID:  <200507100445.j6A4jdFr021572@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=79891

Change 79891 by soc-cjones@soc-cjones_ides on 2005/07/10 04:45:06

	Flesh out 'rename' plan.

Affected files ...

.. //depot/projects/soc2005/gvinum/docs/PLAN#2 edit

Differences ...

==== //depot/projects/soc2005/gvinum/docs/PLAN#2 (text+ko) ====

@@ -9,15 +9,51 @@
 
   - _move
     - Identify -f flag, drive, object(s) from argv
-    - Do sanity checks (is object already on drive?)
-    - Check whether there's free space
-    - Instantiate a new object on target drive
-    - Copy, verify, remove original object
+    - Do sanity checks (is object already on drive?) [kernel-side]
+    - Check whether there's free space [kernel-side]
+    - Instantiate a new object on target drive [kernel-side]
+    - Copy, verify, remove original object [kernel-side]
+
+	req = gctl_get_handle();
+	gctl_ro_param(req, "class", -1, "VINUM");
+	gctl_ro_param(req, "verb", -1, "move");
 
   - _rename
     - Identify -r flag, object, new name from argv
-    - Rename object
+    - Rename object (call 'move' verb)
     - Recurse over descendants if applicable
 
+	req = gctl_get_handle();
+	gctl_ro_param(req, "class", -1, "VINUM");
+	gctl_ro_param(req, "verb", -1, "rename");
+	gctl_ro_param(req, "cmd", -1, "rename");
+	gctl_ro_param(req, "argc", sizeof(int), &argc);
+	gctl_ro_param(req, "flags", sizeof(int), &flags);
+	gctl_ro_param(req, "argvX", ... argvX ...);
+	gctl_ro_param(req, "object", -1, argv[..]);
+	gctl_ro_param(req, "newname", -1, argv[..]);
+	gctl_issue(req);
+	... error handling
+	gctl_free(req);
+	return;
+
 Kernel
 ======
+
+* Add hooks for 'rename', 'move' verbs in 
+   sys/geom/vinum/geom_vinum.c:gv_config
+
+* Add 'rename' verb to VINUM GEOM class
+  - use 'object' and 'newname' as verb arguments
+  - int gv_rename(struct g_geom *, struct gctl_req *)
+    - Find object (drive, vol, plex, sd) [gv_object_type]
+    - Get {drive, volume, plex, sd} struct pointer
+    - Change name by twiddling ->name
+    - Fix up references in other structures
+      - for gv_drive: FOREACH subdisks, fix ->drive
+      - for gv_plex: FOREACH subsdisks, fix ->plex
+    - Commit to disk
+
+* Add 'move' verb to VINUM GEOM class
+
+  - int gv_move(struct g_geom *, struct gctl_req *)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507100445.j6A4jdFr021572>