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

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.
This commit is contained in:
Zdenek Kabelac 2011-10-20 10:28:41 +00:00
parent 789fa12d62
commit 3f53c059e9
4 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

@ -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,

View File

@ -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;
}