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

clean: move code to lib part

Move actual processing part of the lvm2_disable_dmeventd_monitoring()
into a /lib part so we can reuse the code later for other cases.
This commit is contained in:
Zdenek Kabelac 2017-01-23 14:21:56 +01:00
parent 2d48317d3a
commit 4a7f2155c1
3 changed files with 13 additions and 4 deletions

View File

@ -1755,6 +1755,15 @@ bad:
return 0; return 0;
} }
int init_run_by_dmeventd(struct cmd_context *cmd)
{
init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE);
init_ignore_suspended_devices(1);
init_disable_dmeventd_monitoring(1); /* Lock settings */
return 0;
}
void destroy_config_context(struct cmd_context *cmd) void destroy_config_context(struct cmd_context *cmd)
{ {
_destroy_config(cmd); _destroy_config(cmd);

View File

@ -233,6 +233,7 @@ int config_files_changed(struct cmd_context *cmd);
int init_lvmcache_orphans(struct cmd_context *cmd); int init_lvmcache_orphans(struct cmd_context *cmd);
int init_filters(struct cmd_context *cmd, unsigned load_persistent_cache); int init_filters(struct cmd_context *cmd, unsigned load_persistent_cache);
int init_connections(struct cmd_context *cmd); int init_connections(struct cmd_context *cmd);
int init_run_by_dmeventd(struct cmd_context *cmd);
/* /*
* A config context is a very light weight cmd struct that * A config context is a very light weight cmd struct that

View File

@ -98,10 +98,9 @@ int lvm2_run(void *handle, const char *cmdline)
return ret; return ret;
} }
void lvm2_disable_dmeventd_monitoring(void *handle) { void lvm2_disable_dmeventd_monitoring(void *handle)
init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE); {
init_ignore_suspended_devices(1); init_run_by_dmeventd((struct cmd_context *) handle);
init_disable_dmeventd_monitoring(1); /* Lock settings */
} }
void lvm2_log_level(void *handle, int level) void lvm2_log_level(void *handle, int level)