[lvm-devel] [PATCH vgsplit 1/4] Add is_reserved_name() helper function.

Jun'ichi Nomura j-nomura at ce.jp.nec.com
Tue Mar 25 01:18:17 UTC 2008


Hi,

> Very similar to apply_lvname_restrictions but without the error messages.
...
> +int is_reserved_name(const char *name)
> +{
> +	if (!strncmp(name, "snapshot", 8))
> +		return 1;
> +
> +	if (!strncmp(name, "pvmove", 6))
> +		return 1;
> +
> +	if (strstr(name, "_mlog"))
> +		return 1;
> +
> +	if (strstr(name, "_mimage"))
> +		return 1;
> +
> +	return 0;
> +}

Having this function separately from apply_lvname_restrictions() is
error prone.
e.g. in future, adding a restriction to one but not for the other.

If only log_error() matters, how about adding 'verbose' parameter to
apply_lvname_restrictions() (or to this function) to control it?

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America




More information about the lvm-devel mailing list