mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +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:
parent
789fa12d62
commit
3f53c059e9
@ -202,8 +202,8 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg)
|
|||||||
inc_error_count;
|
inc_error_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seg->data_block_size < DM_THIN_MIN_DATA_SIZE ||
|
if (seg->data_block_size < DM_THIN_MIN_DATA_BLOCK_SIZE ||
|
||||||
seg->data_block_size > DM_THIN_MAX_DATA_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",
|
log_error("LV %s: thin pool segment %u data block size %d is out of range",
|
||||||
lv->name, seg_count, seg->data_block_size);
|
lv->name, seg_count, seg->data_block_size);
|
||||||
inc_error_count;
|
inc_error_count;
|
||||||
|
@ -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))
|
if (!dm_config_get_uint32(sn, "data_block_size", &seg->data_block_size))
|
||||||
return SEG_LOG_ERROR("Could not read data_block_size");
|
return SEG_LOG_ERROR("Could not read data_block_size");
|
||||||
|
|
||||||
if ((seg->data_block_size < DM_THIN_MIN_DATA_SIZE) ||
|
if ((seg->data_block_size < DM_THIN_MIN_DATA_BLOCK_SIZE) ||
|
||||||
(seg->data_block_size > DM_THIN_MAX_DATA_SIZE))
|
(seg->data_block_size > DM_THIN_MAX_DATA_BLOCK_SIZE))
|
||||||
return SEG_LOG_ERROR("Unsupported value %u for data_block_size",
|
return SEG_LOG_ERROR("Unsupported value %u for data_block_size",
|
||||||
seg->device_id);
|
seg->device_id);
|
||||||
|
|
||||||
|
@ -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)
|
* DATA_DEV_BLOCK_SIZE_MAX_SECTORS (1024 * 1024 * 1024 >> SECTOR_SHIFT)
|
||||||
* MAX_DEV_ID ((1 << 24) - 1)
|
* MAX_DEV_ID ((1 << 24) - 1)
|
||||||
*/
|
*/
|
||||||
#define DM_THIN_MIN_DATA_SIZE (UINT32_C(128))
|
#define DM_THIN_MIN_DATA_BLOCK_SIZE (UINT32_C(128))
|
||||||
#define DM_THIN_MAX_DATA_SIZE (UINT32_C(2097152))
|
#define DM_THIN_MAX_DATA_BLOCK_SIZE (UINT32_C(2097152))
|
||||||
#define DM_THIN_MAX_DEVICE_ID (UINT32_C((1 << 24) - 1))
|
#define DM_THIN_MAX_DEVICE_ID (UINT32_C((1 << 24) - 1))
|
||||||
|
|
||||||
int dm_tree_node_add_thin_pool_target(struct dm_tree_node *node,
|
int dm_tree_node_add_thin_pool_target(struct dm_tree_node *node,
|
||||||
|
@ -2833,15 +2833,15 @@ int dm_tree_node_add_thin_pool_target(struct dm_tree_node *node,
|
|||||||
{
|
{
|
||||||
struct load_segment *seg;
|
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.",
|
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;
|
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.",
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user