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.
This commit is contained in:
grog 2003-05-05 05:25:49 +00:00
parent c4b2696073
commit cb86eeb7a1

View File

@ -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");