From 3f53c059e91eaf57ead3b084fed0a4d1607f6c21 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 20 Oct 2011 10:28:41 +0000 Subject: [PATCH] Add _BLOCK_ to define Use DM_THIN_MIN_DATA_BLOCK_SIZE and DM_THIN_MAX_DATA_BLOCK_SIZE to make it more obvious, for which this define is useful in thin API. --- lib/metadata/merge.c | 4 ++-- lib/thin/thin.c | 4 ++-- libdm/libdevmapper.h | 4 ++-- libdm/libdm-deptree.c | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/metadata/merge.c b/lib/metadata/merge.c index 44be79c54..2ee4a396d 100644 --- a/lib/metadata/merge.c +++ b/lib/metadata/merge.c @@ -202,8 +202,8 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg) inc_error_count; } - if (seg->data_block_size < DM_THIN_MIN_DATA_SIZE || - seg->data_block_size > DM_THIN_MAX_DATA_SIZE) { + if (seg->data_block_size < DM_THIN_MIN_DATA_BLOCK_SIZE || + seg->data_block_size > DM_THIN_MAX_DATA_BLOCK_SIZE) { log_error("LV %s: thin pool segment %u data block size %d is out of range", lv->name, seg_count, seg->data_block_size); inc_error_count; diff --git a/lib/thin/thin.c b/lib/thin/thin.c index 236308047..698f8431b 100644 --- a/lib/thin/thin.c +++ b/lib/thin/thin.c @@ -119,8 +119,8 @@ static int _thin_pool_text_import(struct lv_segment *seg, if (!dm_config_get_uint32(sn, "data_block_size", &seg->data_block_size)) return SEG_LOG_ERROR("Could not read data_block_size"); - if ((seg->data_block_size < DM_THIN_MIN_DATA_SIZE) || - (seg->data_block_size > DM_THIN_MAX_DATA_SIZE)) + if ((seg->data_block_size < DM_THIN_MIN_DATA_BLOCK_SIZE) || + (seg->data_block_size > DM_THIN_MAX_DATA_BLOCK_SIZE)) return SEG_LOG_ERROR("Unsupported value %u for data_block_size", seg->device_id); diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index f10c8caaf..87d6936b8 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -542,8 +542,8 @@ int dm_tree_node_add_replicator_dev_target(struct dm_tree_node *node, * DATA_DEV_BLOCK_SIZE_MAX_SECTORS (1024 * 1024 * 1024 >> SECTOR_SHIFT) * MAX_DEV_ID ((1 << 24) - 1) */ -#define DM_THIN_MIN_DATA_SIZE (UINT32_C(128)) -#define DM_THIN_MAX_DATA_SIZE (UINT32_C(2097152)) +#define DM_THIN_MIN_DATA_BLOCK_SIZE (UINT32_C(128)) +#define DM_THIN_MAX_DATA_BLOCK_SIZE (UINT32_C(2097152)) #define DM_THIN_MAX_DEVICE_ID (UINT32_C((1 << 24) - 1)) int dm_tree_node_add_thin_pool_target(struct dm_tree_node *node, diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 77779a8e7..aebaf9e04 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -2833,15 +2833,15 @@ int dm_tree_node_add_thin_pool_target(struct dm_tree_node *node, { struct load_segment *seg; - if (data_block_size < DM_THIN_MIN_DATA_SIZE) { + if (data_block_size < DM_THIN_MIN_DATA_BLOCK_SIZE) { log_error("Data block size %u is lower then %u sectors.", - data_block_size, DM_THIN_MIN_DATA_SIZE); + data_block_size, DM_THIN_MIN_DATA_BLOCK_SIZE); return 0; } - if (data_block_size > DM_THIN_MAX_DATA_SIZE) { + if (data_block_size > DM_THIN_MAX_DATA_BLOCK_SIZE) { log_error("Data block size %u is higher then %u sectors.", - data_block_size, DM_THIN_MAX_DATA_SIZE); + data_block_size, DM_THIN_MAX_DATA_BLOCK_SIZE); return 0; }