diff options
author | Alasdair Kergon <agk@redhat.com> | 2011-12-08 21:24:08 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2011-12-08 21:24:08 +0000 |
commit | 594753751a2a306e6391b2f2bf82e043c86224ff (patch) | |
tree | 1df4ac017c31673317ec9c35205946767bf94851 /lib | |
parent | 585aaa922fed9e74ca44a06d4055d0b85a980106 (diff) | |
download | lvm2-594753751a2a306e6391b2f2bf82e043c86224ff.tar.gz lvm2-594753751a2a306e6391b2f2bf82e043c86224ff.tar.xz lvm2-594753751a2a306e6391b2f2bf82e043c86224ff.zip |
Only use built-in stack size in clvmd - ignore lvm.conf.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/commands/toolcontext.c | 4 | ||||
-rw-r--r-- | lib/commands/toolcontext.h | 4 | ||||
-rw-r--r-- | lib/mm/memlock.c | 7 |
3 files changed, 10 insertions, 5 deletions
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 0bbbc358..c64df84b 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -1224,7 +1224,8 @@ static void _init_globals(struct cmd_context *cmd) /* Entry point */ struct cmd_context *create_toolcontext(unsigned is_long_lived, const char *system_dir, - unsigned set_buffering) + unsigned set_buffering, + unsigned threaded) { struct cmd_context *cmd; @@ -1246,6 +1247,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived, return NULL; } cmd->is_long_lived = is_long_lived; + cmd->threaded = threaded ? 1 : 0; cmd->handles_missing_pvs = 0; cmd->handles_unknown_segments = 0; cmd->independent_metadata_areas = 0; diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h index 143a9a0e..6fba6869 100644 --- a/lib/commands/toolcontext.h +++ b/lib/commands/toolcontext.h @@ -85,6 +85,7 @@ struct cmd_context { unsigned partial_activation:1; unsigned si_unit_consistency:1; unsigned metadata_read_only:1; + unsigned threaded:1; /* Set if running within a thread e.g. clvmd */ unsigned independent_metadata_areas:1; /* Active formats have MDAs outside PVs */ @@ -117,7 +118,8 @@ struct cmd_context { */ struct cmd_context *create_toolcontext(unsigned is_long_lived, const char *system_dir, - unsigned set_buffering); + unsigned set_buffering, + unsigned threaded); void destroy_toolcontext(struct cmd_context *cmd); int refresh_toolcontext(struct cmd_context *cmd); int refresh_filters(struct cmd_context *cmd); diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c index 8bf9f22d..3ef407b7 100644 --- a/lib/mm/memlock.c +++ b/lib/mm/memlock.c @@ -445,9 +445,10 @@ void memlock_dec_daemon(struct cmd_context *cmd) void memlock_init(struct cmd_context *cmd) { - _size_stack = find_config_tree_int(cmd, - "activation/reserved_stack", - DEFAULT_RESERVED_STACK) * 1024; + /* When threaded, caller already limited stack size so just use the default. */ + _size_stack = 1024 * (cmd->threaded ? DEFAULT_RESERVED_STACK : + find_config_tree_int(cmd, "activation/reserved_stack", + DEFAULT_RESERVED_STACK)); _size_malloc_tmp = find_config_tree_int(cmd, "activation/reserved_memory", DEFAULT_RESERVED_MEMORY) * 1024; |