summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2003-05-05 05:25:49 +0000
committergrog <grog@FreeBSD.org>2003-05-05 05:25:49 +0000
commitcb86eeb7a12218b1f7865892f9fb6278512003ce (patch)
treed14a488564d504c65141298854c2fb218623eef4
parentc4b26960732ebc7654e20056fbe3df60d78ee42f (diff)
downloadFreeBSD-src-cb86eeb7a12218b1f7865892f9fb6278512003ce.zip
FreeBSD-src-cb86eeb7a12218b1f7865892f9fb6278512003ce.tar.gz
Finally implement read policies. The previous "implementation" didn't
work because it referred to plexes which were almost invariably when referred to. Instead, deprecate the "prefer" keyword for volumes (though it's still there for the moment) and add a keyword "preferred" to the plex definition. The relationship is like this: Old: vol foo ... prefer foo.p3 New: plex foo.p3 volume foo preferred printconfig: Print out the "preferred" keyword for plexes where appropriate. Still print out "prefer" for volumes. The kernel module continues to accept this version, but it's probably not going to live much longer.
-rw-r--r--sbin/vinum/list.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sbin/vinum/list.c b/sbin/vinum/list.c
index 1d3b8db..2547743 100644
--- a/sbin/vinum/list.c
+++ b/sbin/vinum/list.c
@@ -1144,13 +1144,14 @@ printconfig(FILE * of, char *comment)
for (i = 0; i < vinum_conf.volumes_allocated; i++) {
get_volume_info(&vol, i);
if (vol.state != volume_unallocated) {
- if (vol.preferred_plex >= 0) /* preferences, */
+ if (vol.preferred_plex >= 0) { /* preferences, */
+ get_plex_info(&plex, vol.plex[vol.preferred_plex]);
fprintf(of,
"%svolume %s readpol prefer %s\n",
comment,
vol.name,
- vinum_conf.plex[vol.preferred_plex].name);
- else /* default round-robin */
+ plex.name);
+ } else /* default round-robin */
fprintf(of, "%svolume %s\n", comment, vol.name);
}
}
@@ -1168,6 +1169,9 @@ printconfig(FILE * of, char *comment)
if (plex.volno >= 0) { /* we have a volume */
get_volume_info(&vol, plex.volno);
fprintf(of, "vol %s ", vol.name);
+ if ((vol.preferred_plex >= 0) /* has a preferred plex */
+ &&vol.plex[vol.preferred_plex] == i) /* and it's us */
+ fprintf(of, "preferred ");
} else
fprintf(of, "detached ");
fprintf(of, "\n");
OpenPOWER on IntegriCloud