Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/eli/g_eli_ctl.c
Show First 20 Lines • Show All 612 Lines • ▼ Show 20 Lines | g_eli_ctl_setkey(struct gctl_req *req, struct g_class *mp) | ||||
} | } | ||||
valp = gctl_get_paraml(req, "iterations", sizeof(*valp)); | valp = gctl_get_paraml(req, "iterations", sizeof(*valp)); | ||||
if (valp == NULL) { | if (valp == NULL) { | ||||
gctl_error(req, "No '%s' argument.", "iterations"); | gctl_error(req, "No '%s' argument.", "iterations"); | ||||
return; | return; | ||||
} | } | ||||
/* Check if iterations number should and can be changed. */ | /* Check if iterations number should and can be changed. */ | ||||
if (*valp != -1) { | if (*valp != -1 && md.md_iterations == -1) { | ||||
md.md_iterations = *valp; | |||||
} else if (*valp != -1 && *valp != md.md_iterations) { | |||||
if (bitcount32(md.md_keys) != 1) { | if (bitcount32(md.md_keys) != 1) { | ||||
gctl_error(req, "To be able to use '-i' option, only " | gctl_error(req, "To be able to use '-i' option, only " | ||||
"one key can be defined."); | "one key can be defined."); | ||||
return; | return; | ||||
} | } | ||||
if (md.md_keys != (1 << nkey)) { | if (md.md_keys != (1 << nkey)) { | ||||
gctl_error(req, "Only already defined key can be " | gctl_error(req, "Only already defined key can be " | ||||
"changed when '-i' option is used."); | "changed when '-i' option is used."); | ||||
▲ Show 20 Lines • Show All 499 Lines • Show Last 20 Lines |