mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
hints: enhance debug messages
This commit is contained in:
parent
491eb25832
commit
46f43589d0
@ -192,7 +192,7 @@ static int _hints_exists(void)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (errno != ENOENT)
|
if (errno != ENOENT)
|
||||||
log_sys_debug("stat", _hints_file);
|
log_debug("hints_exist errno %d %s", errno, _hints_file);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -205,7 +205,7 @@ static int _nohints_exists(void)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (errno != ENOENT)
|
if (errno != ENOENT)
|
||||||
log_sys_debug("stat", _nohints_file);
|
log_debug("nohints_exist errno %d %s", errno, _nohints_file);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -218,7 +218,7 @@ static int _newhints_exists(void)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (errno != ENOENT)
|
if (errno != ENOENT)
|
||||||
log_sys_debug("stat", _newhints_file);
|
log_debug("newhints_exist errno %d %s", errno, _newhints_file);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -250,11 +250,11 @@ static int _touch_hints(void)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
if (!(fp = fopen(_hints_file, "w"))) {
|
if (!(fp = fopen(_hints_file, "w"))) {
|
||||||
log_sys_debug("fopen", _hints_file);
|
log_debug("touch_hints errno %d %s", errno, _hints_file);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (fclose(fp))
|
if (fclose(fp))
|
||||||
log_sys_debug("fclose", _hints_file);
|
log_debug("touch_hints close errno %d %s", errno, _hints_file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -262,20 +262,20 @@ static int _touch_hints(void)
|
|||||||
static void _unlink_nohints(void)
|
static void _unlink_nohints(void)
|
||||||
{
|
{
|
||||||
if (unlink(_nohints_file))
|
if (unlink(_nohints_file))
|
||||||
log_sys_debug("unlink", _nohints_file);
|
log_debug("unlink_nohints errno %d %s", errno, _nohints_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _unlink_hints(void)
|
static void _unlink_hints(void)
|
||||||
{
|
{
|
||||||
if (unlink(_hints_file))
|
if (unlink(_hints_file))
|
||||||
log_sys_debug("unlink", _hints_file);
|
log_debug("unlink_hints errno %d %s", errno, _hints_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _unlink_newhints(void)
|
static void _unlink_newhints(void)
|
||||||
{
|
{
|
||||||
if (unlink(_newhints_file))
|
if (unlink(_newhints_file))
|
||||||
log_sys_debug("unlink", _newhints_file);
|
log_debug("unlink_newhints errno %d %s", errno, _newhints_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _clear_hints(struct cmd_context *cmd)
|
static int _clear_hints(struct cmd_context *cmd)
|
||||||
@ -295,10 +295,10 @@ static int _clear_hints(struct cmd_context *cmd)
|
|||||||
fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
|
fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
|
||||||
|
|
||||||
if (fflush(fp))
|
if (fflush(fp))
|
||||||
log_debug("clear_hints flush errno %d", errno);
|
log_debug("clear_hints flush errno %d %s", errno, _hints_file);
|
||||||
|
|
||||||
if (fclose(fp))
|
if (fclose(fp))
|
||||||
log_debug("clear_hints close errno %d", errno);
|
log_debug("clear_hints close errno %d %s", errno, _hints_file);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -322,7 +322,7 @@ static int _lock_hints(struct cmd_context *cmd, int mode, int nonblock)
|
|||||||
|
|
||||||
fd = open(_hints_file, O_RDWR);
|
fd = open(_hints_file, O_RDWR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
log_sys_debug("open", _hints_file);
|
log_debug("lock_hints open errno %d %s", errno, _hints_file);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ static int _lock_hints(struct cmd_context *cmd, int mode, int nonblock)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (close(fd))
|
if (close(fd))
|
||||||
log_sys_debug("close", _hints_file);
|
log_debug("lock_hints close errno %d %s", errno, _hints_file);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -810,7 +810,7 @@ static int _read_hint_file(struct cmd_context *cmd, struct dm_list *hints, int *
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fclose(fp))
|
if (fclose(fp))
|
||||||
log_sys_debug("fclose", _hints_file);
|
log_debug("read_hint_file close errno %d", errno);
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1031,7 +1031,7 @@ int write_hint_file(struct cmd_context *cmd, int newhints)
|
|||||||
|
|
||||||
out_close:
|
out_close:
|
||||||
if (fclose(fp))
|
if (fclose(fp))
|
||||||
log_sys_debug("fclose", _hints_file);
|
log_debug("write_hint_file close errno %d", errno);
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
/* get_hints() took ex lock before returning with newhints set */
|
/* get_hints() took ex lock before returning with newhints set */
|
||||||
|
Loading…
Reference in New Issue
Block a user