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

Thin add thin_pool_metadata_require_separate_pvs

Allow to set different policy for pool from mirrors.
This commit is contained in:
Zdenek Kabelac 2011-11-04 22:44:21 +00:00
parent b8cac455bd
commit bd15208cd7
3 changed files with 11 additions and 2 deletions

View File

@ -213,6 +213,11 @@ devices {
# until version 2.02.85.
#
# mirror_logs_require_separate_pvs = 0
#
# Set to 1 to guarantee that thin pool metadata will always
# be placed on different PVs from the pool data.
#
# thin_pool_metadata_require_separate_pvs = 0
#}
# This section that allows you to configure the nature of the

View File

@ -60,6 +60,7 @@
#define DEFAULT_DMEVENTD_MONITOR 1
#define DEFAULT_BACKGROUND_POLLING 1
#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (16 * 1024 * 1024) /* KB */
#define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048 /* KB */

View File

@ -788,6 +788,8 @@ static struct alloc_handle *_alloc_init(struct cmd_context *cmd,
ah->region_size = region_size;
ah->alloc = alloc;
ah->area_multiple = _calc_area_multiple(segtype, area_count, stripes);
ah->mirror_logs_separate = find_config_tree_bool(cmd, "allocation/mirror_logs_require_separate_pvs",
DEFAULT_MIRROR_LOGS_REQUIRE_SEPARATE_PVS);
if (segtype_is_raid(segtype)) {
if (metadata_area_count) {
@ -813,6 +815,9 @@ static struct alloc_handle *_alloc_init(struct cmd_context *cmd,
/* thin_pool uses region_size to pass metadata size in extents */
ah->log_len = ah->region_size;
ah->region_size = 0;
ah->mirror_logs_separate =
find_config_tree_bool(cmd, "allocation/thin_pool_metadata_require_separate_pvs",
DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS);
} else {
ah->log_area_count = metadata_area_count;
ah->log_len = !metadata_area_count ? 0 :
@ -829,8 +834,6 @@ static struct alloc_handle *_alloc_init(struct cmd_context *cmd,
ah->maximise_cling = find_config_tree_bool(cmd, "allocation/maximise_cling", DEFAULT_MAXIMISE_CLING);
ah->mirror_logs_separate = find_config_tree_bool(cmd, "allocation/mirror_logs_require_separate_pvs", DEFAULT_MIRROR_LOGS_REQUIRE_SEPARATE_PVS);
return ah;
}