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,6 +123,7 @@ void init_mirror_in_sync(int in_sync)
void init_dmeventd_monitor(int reg)
{
if (!memlock_count_daemon())
_dmeventd_monitor = reg;
}
@ -133,6 +134,7 @@ void init_background_polling(int polling)
void init_ignore_suspended_devices(int ignore)
{
if (!memlock_count_daemon())
_ignore_suspended_devices = ignore;
}

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);