]> sourceware.org Git - lvm2.git/blob - lib/thin/thin.c
thin: fix recent commits
[lvm2.git] / lib / thin / thin.c
1 /*
2 * Copyright (C) 2011-2012 Red Hat, Inc. All rights reserved.
3 *
4 * This file is part of LVM2.
5 *
6 * This copyrighted material is made available to anyone wishing to use,
7 * modify, copy, or redistribute it subject to the terms and conditions
8 * of the GNU Lesser General Public License v.2.1.
9 *
10 * You should have received a copy of the GNU Lesser General Public License
11 * along with this program; if not, write to the Free Software Foundation,
12 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
13 */
14
15 #include "lib.h"
16 #include "toolcontext.h"
17 #include "metadata.h"
18 #include "segtype.h"
19 #include "text_export.h"
20 #include "text_import.h"
21 #include "config.h"
22 #include "activate.h"
23 #include "str_list.h"
24 #include "defaults.h"
25
26 #ifdef DMEVENTD
27 # include "sharedlib.h"
28 # include "libdevmapper-event.h"
29 #endif
30
31 /* Dm kernel module name for thin provisiong */
32 #define THIN_MODULE "thin-pool"
33
34 /*
35 * Macro used as return argument - returns 0.
36 * return is left to be written in the function for better readability.
37 */
38 #define SEG_LOG_ERROR(t, p...) \
39 log_error(t " segment %s of logical volume %s.", ## p, \
40 dm_config_parent_name(sn), seg->lv->name), 0;
41
42 static int _thin_target_present(struct cmd_context *cmd,
43 const struct lv_segment *seg,
44 unsigned *attributes);
45
46 static const char *_thin_pool_name(const struct lv_segment *seg)
47 {
48 return seg->segtype->name;
49 }
50
51 static int _thin_pool_add_message(struct lv_segment *seg,
52 const char *key,
53 const struct dm_config_node *sn)
54 {
55 const char *lv_name = NULL;
56 struct logical_volume *lv = NULL;
57 uint32_t delete_id = 0;
58 dm_thin_message_t type;
59
60 /* Message must have only one from: create, delete */
61 if (dm_config_get_str(sn, "create", &lv_name)) {
62 if (!(lv = find_lv(seg->lv->vg, lv_name)))
63 return SEG_LOG_ERROR("Unknown LV %s for create message in",
64 lv_name);
65 /* FIXME: switch to _SNAP later, if the created LV has an origin */
66 type = DM_THIN_MESSAGE_CREATE_THIN;
67 }
68
69 if (!dm_config_get_uint32(sn, "delete", &delete_id)) {
70 if (!lv)
71 return SEG_LOG_ERROR("Unknown message in");
72 } else {
73 if (lv)
74 return SEG_LOG_ERROR("Unsupported message format in");
75 type = DM_THIN_MESSAGE_DELETE;
76 }
77
78 if (!attach_pool_message(seg, type, lv, delete_id, 1))
79 return_0;
80
81 return 1;
82 }
83
84 static int _thin_pool_text_import(struct lv_segment *seg,
85 const struct dm_config_node *sn,
86 struct dm_hash_table *pv_hash __attribute__((unused)))
87 {
88 const char *lv_name;
89 struct logical_volume *pool_data_lv, *pool_metadata_lv;
90 const char *discards_str = NULL;
91
92 if (!dm_config_get_str(sn, "metadata", &lv_name))
93 return SEG_LOG_ERROR("Metadata must be a string in");
94
95 if (!(pool_metadata_lv = find_lv(seg->lv->vg, lv_name)))
96 return SEG_LOG_ERROR("Unknown metadata %s in", lv_name);
97
98 if (!dm_config_get_str(sn, "pool", &lv_name))
99 return SEG_LOG_ERROR("Pool must be a string in");
100
101 if (!(pool_data_lv = find_lv(seg->lv->vg, lv_name)))
102 return SEG_LOG_ERROR("Unknown pool %s in", lv_name);
103
104 seg->lv->status |= THIN_POOL;
105 if (!attach_pool_metadata_lv(seg, pool_metadata_lv))
106 return_0;
107
108 if (!attach_pool_data_lv(seg, pool_data_lv))
109 return_0;
110
111 if (!dm_config_get_uint64(sn, "transaction_id", &seg->transaction_id))
112 return SEG_LOG_ERROR("Could not read transaction_id for");
113
114 if (!dm_config_get_uint32(sn, "chunk_size", &seg->chunk_size))
115 return SEG_LOG_ERROR("Could not read chunk_size");
116
117 if (dm_config_has_node(sn, "discards") &&
118 !dm_config_get_str(sn, "discards", &discards_str))
119 return SEG_LOG_ERROR("Could not read discards for");
120
121 if (!discards_str)
122 seg->discards = THIN_DISCARDS_PASSDOWN;
123 else if (!get_pool_discards(discards_str, &seg->discards))
124 return SEG_LOG_ERROR("Discards option unsupported for");
125
126 if (dm_config_has_node(sn, "low_water_mark") &&
127 !dm_config_get_uint64(sn, "low_water_mark", &seg->low_water_mark))
128 return SEG_LOG_ERROR("Could not read low_water_mark");
129
130 if ((seg->chunk_size < DM_THIN_MIN_DATA_BLOCK_SIZE) ||
131 (seg->chunk_size > DM_THIN_MAX_DATA_BLOCK_SIZE))
132 return SEG_LOG_ERROR("Unsupported value %u for chunk_size",
133 seg->device_id);
134
135 if (dm_config_has_node(sn, "zero_new_blocks") &&
136 !dm_config_get_uint32(sn, "zero_new_blocks", &seg->zero_new_blocks))
137 return SEG_LOG_ERROR("Could not read zero_new_blocks for");
138
139 /* Read messages */
140 for (; sn; sn = sn->sib)
141 if (!(sn->v) && !_thin_pool_add_message(seg, sn->key, sn->child))
142 return_0;
143
144 return 1;
145 }
146
147 static int _thin_pool_text_import_area_count(const struct dm_config_node *sn,
148 uint32_t *area_count)
149 {
150 *area_count = 1;
151
152 return 1;
153 }
154
155 static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter *f)
156 {
157 unsigned cnt = 0;
158 const struct lv_thin_message *tmsg;
159
160 outf(f, "metadata = \"%s\"", seg->metadata_lv->name);
161 outf(f, "pool = \"%s\"", seg_lv(seg, 0)->name);
162 outf(f, "transaction_id = %" PRIu64, seg->transaction_id);
163 outsize(f, (uint64_t) seg->chunk_size,
164 "chunk_size = %u", seg->chunk_size);
165
166 switch (seg->discards) {
167 case THIN_DISCARDS_PASSDOWN:
168 case THIN_DISCARDS_NO_PASSDOWN:
169 case THIN_DISCARDS_IGNORE:
170 outf(f, "discards = \"%s\"", get_pool_discards_name(seg->discards));
171 break;
172 default:
173 log_error(INTERNAL_ERROR "Invalid discards value %d.", seg->discards);
174 return 0;
175 }
176
177 if (seg->low_water_mark)
178 outf(f, "low_water_mark = %" PRIu64, seg->low_water_mark);
179
180 if (seg->zero_new_blocks)
181 outf(f, "zero_new_blocks = 1");
182
183 dm_list_iterate_items(tmsg, &seg->thin_messages) {
184 /* Extra validation */
185 switch (tmsg->type) {
186 case DM_THIN_MESSAGE_CREATE_SNAP:
187 case DM_THIN_MESSAGE_CREATE_THIN:
188 if (!lv_is_thin_volume(tmsg->u.lv)) {
189 log_error(INTERNAL_ERROR
190 "LV %s is not a thin volume.",
191 tmsg->u.lv->name);
192 return 0;
193 }
194 break;
195 default:
196 break;
197 }
198
199 if (!cnt)
200 outnl(f);
201
202 outf(f, "message%d {", ++cnt);
203 out_inc_indent(f);
204
205 switch (tmsg->type) {
206 case DM_THIN_MESSAGE_CREATE_SNAP:
207 case DM_THIN_MESSAGE_CREATE_THIN:
208 outf(f, "create = \"%s\"", tmsg->u.lv->name);
209 break;
210 case DM_THIN_MESSAGE_DELETE:
211 outf(f, "delete = %d", tmsg->u.delete_id);
212 break;
213 default:
214 log_error(INTERNAL_ERROR "Passed unsupported message.");
215 return 0;
216 }
217
218 out_dec_indent(f);
219 outf(f, "}");
220 }
221
222 return 1;
223 }
224
225 #ifdef DEVMAPPER_SUPPORT
226 static int _thin_pool_add_target_line(struct dev_manager *dm,
227 struct dm_pool *mem,
228 struct cmd_context *cmd,
229 void **target_state __attribute__((unused)),
230 struct lv_segment *seg,
231 const struct lv_activate_opts *laopts,
232 struct dm_tree_node *node, uint64_t len,
233 uint32_t *pvmove_mirror_count __attribute__((unused)))
234 {
235 static int _no_discards = 0;
236 char *metadata_dlid, *pool_dlid;
237 const struct lv_thin_message *lmsg;
238 const struct logical_volume *origin;
239 struct lvinfo info;
240 uint64_t transaction_id = 0;
241 unsigned attr;
242
243 if (!_thin_target_present(cmd, seg, &attr))
244 return_0;
245
246 if (!laopts->real_pool) {
247 if (!(pool_dlid = build_dm_uuid(mem, seg->lv->lvid.s, "tpool"))) {
248 log_error("Failed to build uuid for thin pool LV %s.", seg->pool_lv->name);
249 return 0;
250 }
251
252 if (!add_linear_area_to_dtree(node, len, seg->lv->vg->extent_size,
253 cmd->use_linear_target,
254 seg->lv->vg->name, seg->lv->name) ||
255 !dm_tree_node_add_target_area(node, NULL, pool_dlid, 0))
256 return_0;
257
258 return 1;
259 }
260
261 if (!(metadata_dlid = build_dm_uuid(mem, seg->metadata_lv->lvid.s, NULL))) {
262 log_error("Failed to build uuid for metadata LV %s.",
263 seg->metadata_lv->name);
264 return 0;
265 }
266
267 if (!(pool_dlid = build_dm_uuid(mem, seg_lv(seg, 0)->lvid.s, NULL))) {
268 log_error("Failed to build uuid for pool LV %s.",
269 seg_lv(seg, 0)->name);
270 return 0;
271 }
272
273 if (!dm_tree_node_add_thin_pool_target(node, len, seg->transaction_id,
274 metadata_dlid, pool_dlid,
275 seg->chunk_size, seg->low_water_mark,
276 seg->zero_new_blocks ? 0 : 1))
277 return_0;
278
279 if ((seg->discards != THIN_DISCARDS_PASSDOWN) && (attr & THIN_FEATURE_DISCARDS)) {
280 /* FIXME: Check whether underlying dev supports discards */
281 if (!dm_tree_node_set_thin_pool_discard(node,
282 seg->discards == THIN_DISCARDS_IGNORE,
283 seg->discards == THIN_DISCARDS_NO_PASSDOWN))
284 return_0;
285 } else
286 log_warn_suppress(_no_discards++, "WARNING: Thin pool target does "
287 "not support discards (needs kernel >= 3.4).");
288
289 /*
290 * Add messages only for activation tree.
291 * Otherwise avoid checking for existence of suspended origin.
292 * Also transation_id is checked only when snapshot origin is active.
293 * (This might change later)
294 */
295 if (!laopts->is_activate)
296 return 1;
297
298 dm_list_iterate_items(lmsg, &seg->thin_messages) {
299 switch (lmsg->type) {
300 case DM_THIN_MESSAGE_CREATE_THIN:
301 origin = first_seg(lmsg->u.lv)->origin;
302 /* Check if the origin is suspended */
303 if (origin && lv_info(cmd, origin, 0, &info, 0, 0) &&
304 info.exists && !info.suspended) {
305 /* Origin is not suspended, but the transaction may have been
306 * already transfered, so test for transaction_id and
307 * allow to pass in the message for dmtree processing
308 * so it will skip all messages later.
309 */
310 if (!lv_thin_pool_transaction_id(seg->lv, &transaction_id))
311 return_0; /* Thin pool should exist and work */
312 if (transaction_id != seg->transaction_id) {
313 log_error("Can't create snapshot %s as origin %s is not suspended.",
314 lmsg->u.lv->name, origin->name);
315 return 0;
316 }
317 }
318 log_debug("Thin pool create_%s %s.", (!origin) ? "thin" : "snap", lmsg->u.lv->name);
319 if (!dm_tree_node_add_thin_pool_message(node,
320 (!origin) ? lmsg->type : DM_THIN_MESSAGE_CREATE_SNAP,
321 first_seg(lmsg->u.lv)->device_id,
322 (!origin) ? 0 : first_seg(origin)->device_id))
323 return_0;
324 break;
325 case DM_THIN_MESSAGE_DELETE:
326 log_debug("Thin pool delete %u.", lmsg->u.delete_id);
327 if (!dm_tree_node_add_thin_pool_message(node,
328 lmsg->type,
329 lmsg->u.delete_id, 0))
330 return_0;
331 break;
332 default:
333 log_error(INTERNAL_ERROR "Unsupported message.");
334 return 0;
335 }
336 }
337
338 if (!dm_list_empty(&seg->thin_messages)) {
339 /* Messages were passed, modify transaction_id as the last one */
340 log_debug("Thin pool set transaction id %" PRIu64 ".", seg->transaction_id);
341 if (!dm_tree_node_add_thin_pool_message(node,
342 DM_THIN_MESSAGE_SET_TRANSACTION_ID,
343 seg->transaction_id - 1,
344 seg->transaction_id))
345 return_0;
346 }
347
348 return 1;
349 }
350
351 static int _thin_pool_target_percent(void **target_state __attribute__((unused)),
352 percent_t *percent,
353 struct dm_pool *mem,
354 struct cmd_context *cmd __attribute__((unused)),
355 struct lv_segment *seg,
356 char *params,
357 uint64_t *total_numerator,
358 uint64_t *total_denominator)
359 {
360 struct dm_status_thin_pool *s;
361
362 if (!dm_get_status_thin_pool(mem, params, &s))
363 return_0;
364
365 /* With 'seg' report metadata percent, otherwice data percent */
366 if (seg) {
367 *percent = make_percent(s->used_metadata_blocks,
368 s->total_metadata_blocks);
369 *total_numerator += s->used_metadata_blocks;
370 *total_denominator += s->total_metadata_blocks;
371 } else {
372 *percent = make_percent(s->used_data_blocks,
373 s->total_data_blocks);
374 *total_numerator += s->used_data_blocks;
375 *total_denominator += s->total_data_blocks;
376 }
377
378 return 1;
379 }
380
381 # ifdef DMEVENTD
382 static const char *_get_thin_dso_path(struct cmd_context *cmd)
383 {
384 return get_monitor_dso_path(cmd, find_config_tree_str(cmd, "dmeventd/thin_library",
385 DEFAULT_DMEVENTD_THIN_LIB));
386 }
387
388 /* FIXME Cache this */
389 static int _target_registered(struct lv_segment *seg, int *pending)
390 {
391 return target_registered_with_dmeventd(seg->lv->vg->cmd,
392 _get_thin_dso_path(seg->lv->vg->cmd),
393 seg->lv, pending);
394 }
395
396 /* FIXME This gets run while suspended and performs banned operations. */
397 static int _target_set_events(struct lv_segment *seg, int evmask, int set)
398 {
399 /* FIXME Make timeout (10) configurable */
400 return target_register_events(seg->lv->vg->cmd,
401 _get_thin_dso_path(seg->lv->vg->cmd),
402 seg->lv, evmask, set, 10);
403 }
404
405 static int _target_register_events(struct lv_segment *seg,
406 int events)
407 {
408 return _target_set_events(seg, events, 1);
409 }
410
411 static int _target_unregister_events(struct lv_segment *seg,
412 int events)
413 {
414 return _target_set_events(seg, events, 0);
415 }
416 # endif /* DMEVENTD */
417 #endif /* DEVMAPPER_SUPPORT */
418
419 static const char *_thin_name(const struct lv_segment *seg)
420 {
421 return seg->segtype->name;
422 }
423
424 static int _thin_text_import(struct lv_segment *seg,
425 const struct dm_config_node *sn,
426 struct dm_hash_table *pv_hash __attribute__((unused)))
427 {
428 const char *lv_name;
429 struct logical_volume *pool_lv, *origin = NULL;
430
431 if (!dm_config_get_str(sn, "thin_pool", &lv_name))
432 return SEG_LOG_ERROR("Thin pool must be a string in");
433
434 if (!(pool_lv = find_lv(seg->lv->vg, lv_name)))
435 return SEG_LOG_ERROR("Unknown thin pool %s in", lv_name);
436
437 if (!dm_config_get_uint64(sn, "transaction_id", &seg->transaction_id))
438 return SEG_LOG_ERROR("Could not read transaction_id for");
439
440 if (dm_config_has_node(sn, "origin")) {
441 if (!dm_config_get_str(sn, "origin", &lv_name))
442 return SEG_LOG_ERROR("Origin must be a string in");
443
444 if (!(origin = find_lv(seg->lv->vg, lv_name)))
445 return SEG_LOG_ERROR("Unknown origin %s in", lv_name);
446 }
447
448 if (!dm_config_get_uint32(sn, "device_id", &seg->device_id))
449 return SEG_LOG_ERROR("Could not read device_id for");
450
451 if (seg->device_id > DM_THIN_MAX_DEVICE_ID)
452 return SEG_LOG_ERROR("Unsupported value %u for device_id",
453 seg->device_id);
454
455 if (!attach_pool_lv(seg, pool_lv, origin))
456 return_0;
457
458 return 1;
459 }
460
461 static int _thin_text_export(const struct lv_segment *seg, struct formatter *f)
462 {
463 outf(f, "thin_pool = \"%s\"", seg->pool_lv->name);
464 outf(f, "transaction_id = %" PRIu64, seg->transaction_id);
465 outf(f, "device_id = %d", seg->device_id);
466
467 if (seg->origin)
468 outf(f, "origin = \"%s\"", seg->origin->name);
469
470 return 1;
471 }
472
473 #ifdef DEVMAPPER_SUPPORT
474 static int _thin_add_target_line(struct dev_manager *dm,
475 struct dm_pool *mem,
476 struct cmd_context *cmd __attribute__((unused)),
477 void **target_state __attribute__((unused)),
478 struct lv_segment *seg,
479 const struct lv_activate_opts *laopts __attribute__((unused)),
480 struct dm_tree_node *node, uint64_t len,
481 uint32_t *pvmove_mirror_count __attribute__((unused)))
482 {
483 char *pool_dlid;
484 uint32_t device_id = seg->device_id;
485
486 if (!(pool_dlid = build_dm_uuid(mem, seg->pool_lv->lvid.s, "tpool"))) {
487 log_error("Failed to build uuid for pool LV %s.",
488 seg->pool_lv->name);
489 return 0;
490 }
491
492 if (!dm_tree_node_add_thin_target(node, len, pool_dlid, device_id))
493 return_0;
494
495 return 1;
496 }
497
498 static int _thin_target_percent(void **target_state __attribute__((unused)),
499 percent_t *percent,
500 struct dm_pool *mem,
501 struct cmd_context *cmd __attribute__((unused)),
502 struct lv_segment *seg,
503 char *params,
504 uint64_t *total_numerator,
505 uint64_t *total_denominator)
506 {
507 struct dm_status_thin *s;
508
509 /* Status for thin device is in sectors */
510 if (!dm_get_status_thin(mem, params, &s))
511 return_0;
512
513 if (seg) {
514 *percent = make_percent(s->mapped_sectors, seg->lv->size);
515 *total_denominator += seg->lv->size;
516 } else {
517 /* No lv_segment info here */
518 *percent = PERCENT_INVALID;
519 /* FIXME: Using denominator to pass the mapped info upward? */
520 *total_denominator += s->highest_mapped_sector;
521 }
522
523 *total_numerator += s->mapped_sectors;
524
525 return 1;
526 }
527
528 static int _thin_target_present(struct cmd_context *cmd,
529 const struct lv_segment *seg,
530 unsigned *attributes)
531 {
532 static int _checked = 0;
533 static int _present = 0;
534 static int _attrs = 0;
535 uint32_t maj, min, patchlevel;
536
537 if (!_checked) {
538 _present = target_present(cmd, THIN_MODULE, 1);
539
540 if (!target_version(THIN_MODULE, &maj, &min, &patchlevel)) {
541 log_error("Cannot read " THIN_MODULE " target version.");
542 return 0;
543 }
544
545 if (maj >=1 && min >= 1)
546 _attrs |= THIN_FEATURE_DISCARDS;
547 else
548 /* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
549 log_debug("Target " THIN_MODULE " does not support discards.");
550
551 if (maj >=1 && min >= 1)
552 _attrs |= THIN_FEATURE_EXTERNAL_ORIGIN;
553 else
554 /* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
555 log_debug("Target " THIN_MODULE " does not support external origins.");
556 #if 0
557 if (maj >=1 && min >= 1)
558 _attrs |= THIN_FEATURE_BLOCK_SIZE;
559 else
560 /* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
561 log_debug("Target " THIN_MODULE " does not support non power of 2 block sizes.");
562 #endif
563 _checked = 1;
564 }
565
566 if (attributes)
567 *attributes = _attrs;
568
569 return _present;
570 }
571 #endif
572
573 static int _thin_modules_needed(struct dm_pool *mem,
574 const struct lv_segment *seg __attribute__((unused)),
575 struct dm_list *modules)
576 {
577 if (!str_list_add(mem, modules, THIN_MODULE)) {
578 log_error("thin string list allocation failed");
579 return 0;
580 }
581
582 return 1;
583 }
584
585 static void _thin_destroy(struct segment_type *segtype)
586 {
587 dm_free(segtype);
588 }
589
590 static struct segtype_handler _thin_pool_ops = {
591 .name = _thin_pool_name,
592 .text_import = _thin_pool_text_import,
593 .text_import_area_count = _thin_pool_text_import_area_count,
594 .text_export = _thin_pool_text_export,
595 #ifdef DEVMAPPER_SUPPORT
596 .add_target_line = _thin_pool_add_target_line,
597 .target_percent = _thin_pool_target_percent,
598 .target_present = _thin_target_present,
599 # ifdef DMEVENTD
600 .target_monitored = _target_registered,
601 .target_monitor_events = _target_register_events,
602 .target_unmonitor_events = _target_unregister_events,
603 # endif /* DMEVENTD */
604 #endif
605 .modules_needed = _thin_modules_needed,
606 .destroy = _thin_destroy,
607 };
608
609 static struct segtype_handler _thin_ops = {
610 .name = _thin_name,
611 .text_import = _thin_text_import,
612 .text_export = _thin_text_export,
613 #ifdef DEVMAPPER_SUPPORT
614 .add_target_line = _thin_add_target_line,
615 .target_percent = _thin_target_percent,
616 .target_present = _thin_target_present,
617 #endif
618 .modules_needed = _thin_modules_needed,
619 .destroy = _thin_destroy,
620 };
621
622 #ifdef THIN_INTERNAL
623 int init_thin_segtypes(struct cmd_context *cmd, struct segtype_library *seglib)
624 #else /* Shared */
625 int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
626 int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *seglib)
627 #endif
628 {
629 static const struct {
630 struct segtype_handler *ops;
631 const char name[16];
632 uint32_t flags;
633 } reg_segtypes[] = {
634 { &_thin_pool_ops, "thin-pool", SEG_THIN_POOL },
635 /* FIXME Maybe use SEG_THIN_VOLUME instead of SEG_VIRTUAL */
636 { &_thin_ops, "thin", SEG_THIN_VOLUME | SEG_VIRTUAL }
637 };
638
639 struct segment_type *segtype;
640 unsigned i;
641
642 for (i = 0; i < sizeof(reg_segtypes)/sizeof(reg_segtypes[0]); ++i) {
643 segtype = dm_zalloc(sizeof(*segtype));
644
645 if (!segtype) {
646 log_error("Failed to allocate memory for %s segtype",
647 reg_segtypes[i].name);
648 return 0;
649 }
650
651 segtype->ops = reg_segtypes[i].ops;
652 segtype->name = reg_segtypes[i].name;
653 segtype->flags = reg_segtypes[i].flags;
654
655 #ifdef DEVMAPPER_SUPPORT
656 # ifdef DMEVENTD
657 if ((reg_segtypes[i].flags & SEG_THIN_POOL) &&
658 _get_thin_dso_path(cmd))
659 segtype->flags |= SEG_MONITORED;
660 # endif /* DMEVENTD */
661 #endif
662 if (!lvm_register_segtype(seglib, segtype))
663 /* segtype is already destroyed */
664 return_0;
665
666 log_very_verbose("Initialised segtype: %s", segtype->name);
667 }
668
669 return 1;
670 }
This page took 0.065446 seconds and 5 git commands to generate.