[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]