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

tools: preselect some setting for memlocked daemons

When our daemon is locked into memory - avoid
communication with dmeventd and also skip
suspended devices.
This commit is contained in:
Zdenek Kabelac 2015-10-22 10:44:38 +02:00
parent 7b78d496bf
commit d2c4ce254b
2 changed files with 8 additions and 4 deletions

View File

@ -123,7 +123,8 @@ void init_mirror_in_sync(int in_sync)
void init_dmeventd_monitor(int reg)
{
_dmeventd_monitor = reg;
if (!memlock_count_daemon())
_dmeventd_monitor = reg;
}
void init_background_polling(int polling)
@ -133,7 +134,8 @@ void init_background_polling(int polling)
void init_ignore_suspended_devices(int ignore)
{
_ignore_suspended_devices = ignore;
if (!memlock_count_daemon())
_ignore_suspended_devices = ignore;
}
void init_ignore_lvm_mirrors(int scan)

View File

@ -79,9 +79,11 @@ int lvm2_run(void *handle, const char *cmdline)
/* FIXME Temporary - move to libdevmapper */
ret = ECMD_PROCESSED;
if (!strcmp(cmdline, "_memlock_inc"))
if (!strcmp(cmdline, "_memlock_inc")) {
init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE);
init_ignore_suspended_devices(1);
memlock_inc_daemon(cmd);
else if (!strcmp(cmdline, "_memlock_dec"))
} else if (!strcmp(cmdline, "_memlock_dec"))
memlock_dec_daemon(cmd);
else
ret = lvm_run_command(cmd, argc, argv);