1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cleanup: drop log_suppress(2) usage

No longer need to use  log_suppress(2) instance so dropped.
This commit is contained in:
Zdenek Kabelac 2015-12-03 17:51:43 +01:00
parent f40b3ba1e9
commit e7978c5ab6
3 changed files with 17 additions and 18 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.137 -
=====================================
Dropped internal usage of log_suppress(2).
Cleaned logging code for buffer size usage.
Added internal id_read_format_try() function to check and read valid UUID.
Use dm_get_status_mirror() instead of individual parsers.

View File

@ -1019,14 +1019,13 @@ static struct volume_group *_read_vg(struct format_instance *fid,
static void _read_desc(struct dm_pool *mem,
const struct dm_config_tree *cft, time_t *when, char **desc)
{
const char *d;
const char *str;
unsigned int u = 0u;
int old_suppress;
old_suppress = log_suppress(1);
d = dm_config_find_str_allow_empty(cft->root, "description", "");
log_suppress(old_suppress);
*desc = dm_pool_strdup(mem, d);
if (!dm_config_get_str(cft->root, "description", &str))
str = "";
*desc = dm_pool_strdup(mem, str);
(void) dm_config_get_uint32(cft->root, "creation_time", &u);
*when = u;
@ -1043,12 +1042,12 @@ static int _read_vgname(const struct format_type *fmt, const struct dm_config_tr
const struct dm_config_node *vgn;
struct dm_pool *mem = fmt->cmd->mem;
const char *str;
int old_suppress;
old_suppress = log_suppress(2);
vgsummary->creation_host =
dm_pool_strdup(mem, dm_config_find_str_allow_empty(cft->root, "creation_host", ""));
log_suppress(old_suppress);
if (!dm_config_get_str(cft->root, "creation_host", &str))
str = "";
if (!(vgsummary->creation_host = dm_pool_strdup(mem, str)))
return_0;
/* skip any top-level values */
for (vgn = cft->root; (vgn && vgn->v); vgn = vgn->sib) ;
@ -1074,11 +1073,13 @@ static int _read_vgname(const struct format_type *fmt, const struct dm_config_tr
return 0;
}
if (dm_config_get_str(vgn, "system_id", &str))
vgsummary->system_id = dm_pool_strdup(mem, str);
if (dm_config_get_str(vgn, "system_id", &str) &&
(!(vgsummary->system_id = dm_pool_strdup(mem, str))))
return_0;
if (dm_config_get_str(vgn, "lock_type", &str))
vgsummary->lock_type = dm_pool_strdup(mem, str);
if (dm_config_get_str(vgn, "lock_type", &str) &&
(!(vgsummary->lock_type = dm_pool_strdup(mem, str))))
return_0;
return 1;
}

View File

@ -299,9 +299,6 @@ void print_log(int level, const char *file, int line, int dm_errno_or_class,
level = _LOG_FATAL;
}
if (_log_suppress == 2)
return;
if (level <= _LOG_ERR)
init_error_message_produced(1);