37
37
return _snap_name(seg);
40
static int _snap_text_import(struct lv_segment *seg, const struct config_node *sn,
40
static int _snap_text_import(struct lv_segment *seg, const struct dm_config_node *sn,
41
41
struct dm_hash_table *pv_hash __attribute__((unused)))
43
43
uint32_t chunk_size;
45
45
struct logical_volume *org, *cow;
46
46
int old_suppress, merge = 0;
48
if (!get_config_uint32(sn, "chunk_size", &chunk_size)) {
48
if (!dm_config_get_uint32(sn, "chunk_size", &chunk_size)) {
49
49
log_error("Couldn't read chunk size for snapshot.");
53
53
old_suppress = log_suppress(1);
55
if ((cow_name = find_config_str(sn, "merging_store", NULL))) {
56
if (find_config_str(sn, "cow_store", NULL)) {
55
if ((cow_name = dm_config_find_str(sn, "merging_store", NULL))) {
56
if (dm_config_find_str(sn, "cow_store", NULL)) {
57
57
log_suppress(old_suppress);
58
58
log_error("Both snapshot cow and merging storage were specified.");
63
else if (!(cow_name = find_config_str(sn, "cow_store", NULL))) {
63
else if (!(cow_name = dm_config_find_str(sn, "cow_store", NULL))) {
64
64
log_suppress(old_suppress);
65
65
log_error("Snapshot cow storage not specified.");
69
if (!(org_name = find_config_str(sn, "origin", NULL))) {
69
if (!(org_name = dm_config_find_str(sn, "origin", NULL))) {
70
70
log_suppress(old_suppress);
71
71
log_error("Snapshot origin not specified.");
136
136
*percent = PERCENT_100;
138
138
*percent = make_percent(*total_numerator, *total_denominator);
139
} else if (!strcmp(params, "Invalid") ||
140
!strcmp(params, "Merge failed"))
140
else if (!strcmp(params, "Invalid"))
141
141
*percent = PERCENT_INVALID;
142
else if (!strcmp(params, "Merge failed"))
143
*percent = PERCENT_MERGE_FAILED;