mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-27 18:04:20 +03:00
tdata->tpool
This commit is contained in:
parent
f5a8f2d2ca
commit
77729280f6
@ -95,58 +95,40 @@ int validate_name(const char *n)
|
|||||||
|
|
||||||
int apply_lvname_restrictions(const char *name)
|
int apply_lvname_restrictions(const char *name)
|
||||||
{
|
{
|
||||||
if (!strncmp(name, "snapshot", 8)) {
|
const char *reserved_prefixes[] = {
|
||||||
log_error("Names starting \"snapshot\" are reserved. "
|
"snapshot",
|
||||||
"Please choose a different LV name.");
|
"pvmove",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *reserved_strings[] = {
|
||||||
|
"_mlog",
|
||||||
|
"_mimage",
|
||||||
|
"_rimage",
|
||||||
|
"_rmeta",
|
||||||
|
"_vorigin",
|
||||||
|
"_tpool",
|
||||||
|
"_tmeta",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
unsigned i;
|
||||||
|
const char *s;
|
||||||
|
|
||||||
|
for (i = 0; (s = reserved_prefixes[i]); i++) {
|
||||||
|
if (!strncmp(name, s, strlen(s))) {
|
||||||
|
log_error("Names starting \"%s\" are reserved. "
|
||||||
|
"Please choose a different LV name.", s);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strncmp(name, "pvmove", 6)) {
|
|
||||||
log_error("Names starting \"pvmove\" are reserved. "
|
|
||||||
"Please choose a different LV name.");
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strstr(name, "_mlog")) {
|
for (i = 0; (s = reserved_strings[i]); i++) {
|
||||||
log_error("Names including \"_mlog\" are reserved. "
|
if (strstr(name, s)) {
|
||||||
"Please choose a different LV name.");
|
log_error("Names including \"%s\" are reserved. "
|
||||||
|
"Please choose a different LV name.", s);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strstr(name, "_mimage")) {
|
|
||||||
log_error("Names including \"_mimage\" are reserved. "
|
|
||||||
"Please choose a different LV name.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strstr(name, "_rimage")) {
|
|
||||||
log_error("Names including \"_rimage\" are reserved. "
|
|
||||||
"Please choose a different LV name.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strstr(name, "_rmeta")) {
|
|
||||||
log_error("Names including \"_rmeta\" are reserved. "
|
|
||||||
"Please choose a different LV name.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strstr(name, "_vorigin")) {
|
|
||||||
log_error("Names including \"_vorigin\" are reserved. "
|
|
||||||
"Please choose a different LV name.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strstr(name, "_tdata")) {
|
|
||||||
log_error("Names including \"_tpool\" are reserved. "
|
|
||||||
"Please choose a different LV name.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strstr(name, "_tmeta")) {
|
|
||||||
log_error("Names including \"_tpool\" are reserved. "
|
|
||||||
"Please choose a different LV name.");
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user