Skip to content

Commit

Permalink
Change separator in rotorvector configuration from : to ;
Browse files Browse the repository at this point in the history
(Squash with earlier parsing commit!)

Example becomes:

ssd<=4;mixed<=64;123,hdd
  • Loading branch information
inkdot7 committed Sep 28, 2016
1 parent 717adea commit 8e0cd9a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions module/zfs/metaslab.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,24 +614,24 @@ metaslab_parse_rotor_config(metaslab_class_t *mc, char *rotorvector)

while (rotorvector < endconfig) {
char *nextrotor;
char *colon, *lessthan;
char *semicolon, *lessthan;
char *endtypes;
int nguids = 0;

nextrotor = endconfig;
colon = strchr(rotorvector, ':');
if (colon == NULL)
colon = endconfig;
semicolon = strchr(rotorvector, ';');
if (semicolon == NULL)
semicolon = endconfig;
else
nextrotor = colon+1;
nextrotor = semicolon+1;
lessthan = strstr(rotorvector, "<=");
if ((lessthan == NULL && colon != endconfig) ||
lessthan > colon)
if ((lessthan == NULL && semicolon != endconfig) ||
lessthan > semicolon)
return; /* malformed, missing '<=' in this item */
if (lessthan != NULL && colon == endconfig)
if (lessthan != NULL && semicolon == endconfig)
return; /* malformed, '<=' for last item */

endtypes = (lessthan) ? lessthan : colon;
endtypes = (lessthan) ? lessthan : semicolon;

while (rotorvector < endtypes) {
char *comma, *nexttype;
Expand Down Expand Up @@ -691,7 +691,7 @@ metaslab_parse_rotor_config(metaslab_class_t *mc, char *rotorvector)
uint64_t threshold;
#ifdef _KERNEL
char tmpstr[64];
size_t len = colon-(lessthan+2);
size_t len = semicolon-(lessthan+2);
strncpy(tmpstr, lessthan+2, len);
tmpstr[len] = 0;
#endif
Expand All @@ -701,7 +701,7 @@ metaslab_parse_rotor_config(metaslab_class_t *mc, char *rotorvector)
#else
char *endptr;
threshold = strtoull(lessthan+2, &endptr, 0);
if (endptr != colon)
if (endptr != semicolon)
return; /* malformed configuration */
#endif
/*
Expand Down

0 comments on commit 8e0cd9a

Please sign in to comment.