]>
sourceware.org Git - lvm2.git/blob - lib/activate/activate.c
2 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3 * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
5 * This file is part of LVM2.
7 * This copyrighted material is made available to anyone wishing to use,
8 * modify, copy, or redistribute it subject to the terms and conditions
9 * of the GNU Lesser General Public License v.2.1.
11 * You should have received a copy of the GNU Lesser General Public License
12 * along with this program; if not, write to the Free Software Foundation,
13 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "lvm-string.h"
25 #include "toolcontext.h"
26 #include "dev_manager.h"
36 #define _skip(fmt, args...) log_very_verbose("Skipping: " fmt , ## args)
38 int lvm1_present(struct cmd_context
*cmd
)
42 if (dm_snprintf(path
, sizeof(path
), "%s/lvm/global", cmd
->proc_dir
)
44 log_error("LVM1 proc global snprintf failed");
48 if (path_exists(path
))
54 int list_segment_modules(struct dm_pool
*mem
, const struct lv_segment
*seg
,
55 struct dm_list
*modules
)
58 struct lv_segment
*seg2
, *snap_seg
;
61 if (seg
->segtype
->ops
->modules_needed
&&
62 !seg
->segtype
->ops
->modules_needed(mem
, seg
, modules
)) {
63 log_error("module string allocation failed");
67 if (lv_is_origin(seg
->lv
))
68 dm_list_iterate(snh
, &seg
->lv
->snapshot_segs
)
69 if (!list_lv_modules(mem
,
70 dm_list_struct_base(snh
,
76 if (lv_is_cow(seg
->lv
)) {
77 snap_seg
= find_cow(seg
->lv
);
78 if (snap_seg
->segtype
->ops
->modules_needed
&&
79 !snap_seg
->segtype
->ops
->modules_needed(mem
, snap_seg
,
81 log_error("snap_seg module string allocation failed");
86 for (s
= 0; s
< seg
->area_count
; s
++) {
87 switch (seg_type(seg
, s
)) {
89 seg2
= find_seg_by_le(seg_lv(seg
, s
), seg_le(seg
, s
));
90 if (seg2
&& !list_segment_modules(mem
, seg2
, modules
))
102 int list_lv_modules(struct dm_pool
*mem
, const struct logical_volume
*lv
,
103 struct dm_list
*modules
)
105 struct lv_segment
*seg
;
107 dm_list_iterate_items(seg
, &lv
->segments
)
108 if (!list_segment_modules(mem
, seg
, modules
))
114 #ifndef DEVMAPPER_SUPPORT
115 void set_activation(int act
)
117 static int warned
= 0;
122 log_error("Compiled without libdevmapper support. "
123 "Can't enable activation.");
131 int library_version(char *version
, size_t size
)
135 int driver_version(char *version
, size_t size
)
139 int target_version(const char *target_name
, uint32_t *maj
,
140 uint32_t *min
, uint32_t *patchlevel
)
144 int target_present(struct cmd_context
*cmd
, const char *target_name
,
149 int lv_info(struct cmd_context
*cmd
, const struct logical_volume
*lv
, struct lvinfo
*info
,
150 int with_open_count
, int with_read_ahead
)
154 int lv_info_by_lvid(struct cmd_context
*cmd
, const char *lvid_s
,
155 struct lvinfo
*info
, int with_open_count
, int with_read_ahead
)
159 int lv_snapshot_percent(const struct logical_volume
*lv
, float *percent
,
160 percent_range_t
*percent_range
)
164 int lv_mirror_percent(struct cmd_context
*cmd
, struct logical_volume
*lv
,
165 int wait
, float *percent
, percent_range_t
*percent_range
,
170 int lvs_in_vg_activated(struct volume_group
*vg
)
174 int lvs_in_vg_opened(struct volume_group
*vg
)
178 int lv_suspend(struct cmd_context
*cmd
, const char *lvid_s
)
182 int lv_suspend_if_active(struct cmd_context
*cmd
, const char *lvid_s
)
186 int lv_resume(struct cmd_context
*cmd
, const char *lvid_s
)
190 int lv_resume_if_active(struct cmd_context
*cmd
, const char *lvid_s
)
194 int lv_deactivate(struct cmd_context
*cmd
, const char *lvid_s
)
198 int lv_activation_filter(struct cmd_context
*cmd
, const char *lvid_s
,
203 int lv_activate(struct cmd_context
*cmd
, const char *lvid_s
, int exclusive
)
207 int lv_activate_with_filter(struct cmd_context
*cmd
, const char *lvid_s
, int exclusive
)
212 int lv_mknodes(struct cmd_context
*cmd
, const struct logical_volume
*lv
)
217 int pv_uses_vg(struct physical_volume
*pv
,
218 struct volume_group
*vg
)
223 void activation_release(void)
228 void activation_exit(void)
233 #else /* DEVMAPPER_SUPPORT */
235 static int _activation
= 1;
237 void set_activation(int act
)
239 if (act
== _activation
)
244 log_verbose("Activation enabled. Device-mapper kernel "
245 "driver will be used.");
247 log_warn("WARNING: Activation disabled. No device-mapper "
248 "interaction will be attempted.");
256 static int _passes_activation_filter(struct cmd_context
*cmd
,
257 struct logical_volume
*lv
)
259 const struct config_node
*cn
;
260 struct config_value
*cv
;
264 if (!(cn
= find_config_tree_node(cmd
, "activation/volume_list"))) {
265 /* If no host tags defined, activate */
266 if (dm_list_empty(&cmd
->tags
))
269 /* If any host tag matches any LV or VG tag, activate */
270 if (str_list_match_list(&cmd
->tags
, &lv
->tags
) ||
271 str_list_match_list(&cmd
->tags
, &lv
->vg
->tags
))
278 for (cv
= cn
->v
; cv
; cv
= cv
->next
) {
279 if (cv
->type
!= CFG_STRING
) {
280 log_error("Ignoring invalid string in config file "
281 "activation/volume_list");
286 log_error("Ignoring empty string in config file "
287 "activation/volume_list");
295 log_error("Ignoring empty tag in config file "
296 "activation/volume_list");
299 /* If any host tag matches any LV or VG tag, activate */
300 if (!strcmp(str
, "*")) {
301 if (str_list_match_list(&cmd
->tags
, &lv
->tags
)
302 || str_list_match_list(&cmd
->tags
,
308 /* If supplied tag matches LV or VG tag, activate */
309 if (str_list_match_item(&lv
->tags
, str
) ||
310 str_list_match_item(&lv
->vg
->tags
, str
))
315 if (!strchr(str
, '/')) {
316 /* vgname supplied */
317 if (!strcmp(str
, lv
->vg
->name
))
323 if (dm_snprintf(path
, sizeof(path
), "%s/%s", lv
->vg
->name
,
325 log_error("dm_snprintf error from %s/%s", lv
->vg
->name
,
329 if (!strcmp(path
, str
))
336 int library_version(char *version
, size_t size
)
341 return dm_get_library_version(version
, size
);
344 int driver_version(char *version
, size_t size
)
349 log_very_verbose("Getting driver version");
351 return dm_driver_version(version
, size
);
354 int target_version(const char *target_name
, uint32_t *maj
,
355 uint32_t *min
, uint32_t *patchlevel
)
359 struct dm_versions
*target
, *last_target
;
361 log_very_verbose("Getting target version for %s", target_name
);
362 if (!(dmt
= dm_task_create(DM_DEVICE_LIST_VERSIONS
)))
365 if (!dm_task_run(dmt
)) {
366 log_debug("Failed to get %s target version", target_name
);
367 /* Assume this was because LIST_VERSIONS isn't supported */
371 target
= dm_task_get_versions(dmt
);
374 last_target
= target
;
376 if (!strcmp(target_name
, target
->name
)) {
378 *maj
= target
->version
[0];
379 *min
= target
->version
[1];
380 *patchlevel
= target
->version
[2];
384 target
= (void *) target
+ target
->next
;
385 } while (last_target
!= target
);
388 dm_task_destroy(dmt
);
393 int module_present(struct cmd_context
*cmd
, const char *target_name
)
400 if (dm_snprintf(module
, sizeof(module
), "dm-%s", target_name
) < 0) {
401 log_error("module_present module name too long: %s",
406 argv
[0] = MODPROBE_CMD
;
410 ret
= exec_cmd(cmd
, argv
);
415 int target_present(struct cmd_context
*cmd
, const char *target_name
,
418 uint32_t maj
, min
, patchlevel
;
425 if (target_version(target_name
, &maj
, &min
, &patchlevel
))
428 if (!module_present(cmd
, target_name
))
433 return target_version(target_name
, &maj
, &min
, &patchlevel
);
437 * Returns 1 if info structure populated, else 0 on failure.
439 int lv_info(struct cmd_context
*cmd
, const struct logical_volume
*lv
,
440 struct lvinfo
*info
, int with_open_count
, int with_read_ahead
)
442 struct dm_info dminfo
;
447 if (!dev_manager_info(lv
->vg
->cmd
->mem
, lv
, with_open_count
,
448 with_read_ahead
, &dminfo
, &info
->read_ahead
))
451 info
->exists
= dminfo
.exists
;
452 info
->suspended
= dminfo
.suspended
;
453 info
->open_count
= dminfo
.open_count
;
454 info
->major
= dminfo
.major
;
455 info
->minor
= dminfo
.minor
;
456 info
->read_only
= dminfo
.read_only
;
457 info
->live_table
= dminfo
.live_table
;
458 info
->inactive_table
= dminfo
.inactive_table
;
463 int lv_info_by_lvid(struct cmd_context
*cmd
, const char *lvid_s
,
464 struct lvinfo
*info
, int with_open_count
, int with_read_ahead
)
467 struct logical_volume
*lv
;
469 if (!(lv
= lv_from_lvid(cmd
, lvid_s
, 0)))
472 r
= lv_info(cmd
, lv
, info
, with_open_count
, with_read_ahead
);
479 * Returns 1 if percent set, else 0 on failure.
481 int lv_snapshot_percent(const struct logical_volume
*lv
, float *percent
,
482 percent_range_t
*percent_range
)
485 struct dev_manager
*dm
;
490 if (!(dm
= dev_manager_create(lv
->vg
->cmd
, lv
->vg
->name
)))
493 if (!(r
= dev_manager_snapshot_percent(dm
, lv
, percent
, percent_range
)))
496 dev_manager_destroy(dm
);
501 /* FIXME Merge with snapshot_percent */
502 int lv_mirror_percent(struct cmd_context
*cmd
, struct logical_volume
*lv
,
503 int wait
, float *percent
, percent_range_t
*percent_range
,
507 struct dev_manager
*dm
;
510 /* If mirrored LV is temporarily shrinked to 1 area (= linear),
511 * it should be considered in-sync. */
512 if (dm_list_size(&lv
->segments
) == 1 && first_seg(lv
)->area_count
== 1) {
520 if (!lv_info(cmd
, lv
, &info
, 0, 0))
526 if (!(dm
= dev_manager_create(lv
->vg
->cmd
, lv
->vg
->name
)))
529 if (!(r
= dev_manager_mirror_percent(dm
, lv
, wait
, percent
,
530 percent_range
, event_nr
)))
533 dev_manager_destroy(dm
);
538 static int _lv_active(struct cmd_context
*cmd
, struct logical_volume
*lv
)
542 if (!lv_info(cmd
, lv
, &info
, 0, 0)) {
550 static int _lv_open_count(struct cmd_context
*cmd
, struct logical_volume
*lv
)
554 if (!lv_info(cmd
, lv
, &info
, 1, 0)) {
559 return info
.open_count
;
562 static int _lv_activate_lv(struct logical_volume
*lv
)
565 struct dev_manager
*dm
;
567 if (!(dm
= dev_manager_create(lv
->vg
->cmd
, lv
->vg
->name
)))
570 if (!(r
= dev_manager_activate(dm
, lv
)))
573 dev_manager_destroy(dm
);
577 static int _lv_preload(struct logical_volume
*lv
, int *flush_required
)
580 struct dev_manager
*dm
;
582 if (!(dm
= dev_manager_create(lv
->vg
->cmd
, lv
->vg
->name
)))
585 if (!(r
= dev_manager_preload(dm
, lv
, flush_required
)))
588 dev_manager_destroy(dm
);
592 static int _lv_deactivate(struct logical_volume
*lv
)
595 struct dev_manager
*dm
;
597 if (!(dm
= dev_manager_create(lv
->vg
->cmd
, lv
->vg
->name
)))
600 if (!(r
= dev_manager_deactivate(dm
, lv
)))
603 dev_manager_destroy(dm
);
607 static int _lv_suspend_lv(struct logical_volume
*lv
, int lockfs
, int flush_required
)
610 struct dev_manager
*dm
;
612 if (!(dm
= dev_manager_create(lv
->vg
->cmd
, lv
->vg
->name
)))
615 if (!(r
= dev_manager_suspend(dm
, lv
, lockfs
, flush_required
)))
618 dev_manager_destroy(dm
);
623 * These two functions return the number of visible LVs in the state,
626 int lvs_in_vg_activated(struct volume_group
*vg
)
634 dm_list_iterate_items(lvl
, &vg
->lvs
) {
635 if (lv_is_visible(lvl
->lv
))
636 count
+= (_lv_active(vg
->cmd
, lvl
->lv
) == 1);
642 int lvs_in_vg_opened(const struct volume_group
*vg
)
644 const struct lv_list
*lvl
;
650 dm_list_iterate_items(lvl
, &vg
->lvs
) {
651 if (lv_is_visible(lvl
->lv
))
652 count
+= (_lv_open_count(vg
->cmd
, lvl
->lv
) > 0);
659 * Determine whether an LV is active locally or in a cluster.
660 * Assumes vg lock held.
662 * 0 - not active locally or on any node in cluster
663 * 1 - active either locally or some node in the cluster
665 int lv_is_active(struct logical_volume
*lv
)
669 if (_lv_active(lv
->vg
->cmd
, lv
))
672 if (!vg_is_clustered(lv
->vg
))
675 if ((ret
= remote_lock_held(lv
->lvid
.s
)) >= 0)
679 * Old compatibility code if locking doesn't support lock query
680 * FIXME: check status to not deactivate already activate device
682 if (activate_lv_excl(lv
->vg
->cmd
, lv
)) {
683 if (!deactivate_lv(lv
->vg
->cmd
, lv
))
689 * Exclusive local activation failed so assume it is active elsewhere.
695 * Returns 0 if an attempt to (un)monitor the device failed.
696 * Returns 1 otherwise.
698 int monitor_dev_for_events(struct cmd_context
*cmd
,
699 struct logical_volume
*lv
, int monitor
)
702 int i
, pending
= 0, monitored
;
704 struct dm_list
*tmp
, *snh
, *snht
;
705 struct lv_segment
*seg
;
706 struct lv_segment
*log_seg
;
707 int (*monitor_fn
) (struct lv_segment
*s
, int e
);
710 /* skip dmeventd code altogether */
711 if (dmeventd_monitor_mode() == DMEVENTD_MONITOR_IGNORE
)
715 * Nothing to do if dmeventd configured not to be used.
717 if (monitor
&& !dmeventd_monitor_mode())
721 * In case of a snapshot device, we monitor lv->snapshot->lv,
722 * not the actual LV itself.
724 if (lv_is_cow(lv
) && !lv_is_merging_cow(lv
))
725 return monitor_dev_for_events(cmd
, lv
->snapshot
->lv
, monitor
);
728 * In case this LV is a snapshot origin, we instead monitor
729 * each of its respective snapshots (the origin itself does
730 * not need to be monitored).
732 * TODO: This may change when snapshots of mirrors are allowed.
734 if (lv_is_origin(lv
)) {
735 dm_list_iterate_safe(snh
, snht
, &lv
->snapshot_segs
)
736 if (!monitor_dev_for_events(cmd
, dm_list_struct_base(snh
,
737 struct lv_segment
, origin_list
)->cow
, monitor
))
743 * If the volume is mirrored and its log is also mirrored, monitor
744 * the log volume as well.
746 if ((seg
= first_seg(lv
)) != NULL
&& seg
->log_lv
!= NULL
&&
747 (log_seg
= first_seg(seg
->log_lv
)) != NULL
&&
748 seg_is_mirrored(log_seg
))
749 if (!monitor_dev_for_events(cmd
, seg
->log_lv
, monitor
))
752 dm_list_iterate(tmp
, &lv
->segments
) {
753 seg
= dm_list_item(tmp
, struct lv_segment
);
755 /* Recurse for AREA_LV */
756 for (s
= 0; s
< seg
->area_count
; s
++) {
757 if (seg_type(seg
, s
) != AREA_LV
)
759 if (!monitor_dev_for_events(cmd
, seg_lv(seg
, s
),
761 log_error("Failed to %smonitor %s",
763 seg_lv(seg
, s
)->name
);
768 if (!seg_monitored(seg
) || (seg
->status
& PVMOVE
))
773 /* Check monitoring status */
774 if (seg
->segtype
->ops
->target_monitored
)
775 monitored
= seg
->segtype
->ops
->target_monitored(seg
, &pending
);
777 continue; /* segtype doesn't support registration */
780 * FIXME: We should really try again if pending
782 monitored
= (pending
) ? 0 : monitored
;
786 log_verbose("%s/%s already monitored.", lv
->vg
->name
, lv
->name
);
787 else if (seg
->segtype
->ops
->target_monitor_events
)
788 monitor_fn
= seg
->segtype
->ops
->target_monitor_events
;
791 log_verbose("%s/%s already not monitored.", lv
->vg
->name
, lv
->name
);
792 else if (seg
->segtype
->ops
->target_unmonitor_events
)
793 monitor_fn
= seg
->segtype
->ops
->target_unmonitor_events
;
800 log_verbose("%sonitoring %s/%s", monitor
? "M" : "Not m", lv
->vg
->name
, lv
->name
);
802 /* FIXME specify events */
803 if (!monitor_fn(seg
, 0)) {
804 log_error("%s/%s: %s segment monitoring function failed.",
805 lv
->vg
->name
, lv
->name
, seg
->segtype
->name
);
809 /* Check [un]monitor results */
810 /* Try a couple times if pending, but not forever... */
811 for (i
= 0; i
< 10; i
++) {
813 monitored
= seg
->segtype
->ops
->target_monitored(seg
, &pending
);
815 (!monitored
&& monitor
) ||
816 (monitored
&& !monitor
))
817 log_very_verbose("%s/%s %smonitoring still pending: waiting...",
818 lv
->vg
->name
, lv
->name
, monitor
? "" : "un");
824 r
= (monitored
&& monitor
) || (!monitored
&& !monitor
);
833 static int _lv_suspend(struct cmd_context
*cmd
, const char *lvid_s
,
834 int error_if_not_suspended
)
836 struct logical_volume
*lv
= NULL
, *lv_pre
= NULL
;
838 int r
= 0, lockfs
= 0, flush_required
= 0;
843 if (!(lv
= lv_from_lvid(cmd
, lvid_s
, 0)))
846 /* Use precommitted metadata if present */
847 if (!(lv_pre
= lv_from_lvid(cmd
, lvid_s
, 1)))
851 _skip("Suspending '%s'.", lv
->name
);
856 if (!lv_info(cmd
, lv
, &info
, 0, 0))
859 if (!info
.exists
|| info
.suspended
) {
860 if (!error_if_not_suspended
) {
868 lv_calculate_readahead(lv
, NULL
);
870 /* If VG was precommitted, preload devices for the LV */
871 if ((lv_pre
->vg
->status
& PRECOMMITTED
)) {
872 if (!_lv_preload(lv_pre
, &flush_required
)) {
873 /* FIXME Revert preloading */
878 if (!monitor_dev_for_events(cmd
, lv
, 0))
879 /* FIXME Consider aborting here */
884 if (lv_is_origin(lv_pre
) || lv_is_cow(lv_pre
))
887 if (!_lv_suspend_lv(lv
, lockfs
, flush_required
)) {
896 vg_release(lv_pre
->vg
);
903 /* Returns success if the device is not active */
904 int lv_suspend_if_active(struct cmd_context
*cmd
, const char *lvid_s
)
906 return _lv_suspend(cmd
, lvid_s
, 0);
909 int lv_suspend(struct cmd_context
*cmd
, const char *lvid_s
)
911 return _lv_suspend(cmd
, lvid_s
, 1);
914 static int _lv_resume(struct cmd_context
*cmd
, const char *lvid_s
,
915 int error_if_not_active
)
917 struct logical_volume
*lv
;
924 if (!(lv
= lv_from_lvid(cmd
, lvid_s
, 0)))
928 _skip("Resuming '%s'.", lv
->name
);
933 if (!lv_info(cmd
, lv
, &info
, 0, 0))
936 if (!info
.exists
|| !info
.suspended
) {
937 r
= error_if_not_active
? 0 : 1;
941 if (!_lv_activate_lv(lv
))
947 if (!monitor_dev_for_events(cmd
, lv
, 1))
958 /* Returns success if the device is not active */
959 int lv_resume_if_active(struct cmd_context
*cmd
, const char *lvid_s
)
961 return _lv_resume(cmd
, lvid_s
, 0);
964 int lv_resume(struct cmd_context
*cmd
, const char *lvid_s
)
966 return _lv_resume(cmd
, lvid_s
, 1);
969 static int _lv_has_open_snapshots(struct logical_volume
*lv
)
971 struct lv_segment
*snap_seg
;
975 dm_list_iterate_items_gen(snap_seg
, &lv
->snapshot_segs
, origin_list
) {
976 if (!lv_info(lv
->vg
->cmd
, snap_seg
->cow
, &info
, 1, 0)) {
981 if (info
.exists
&& info
.open_count
) {
982 log_error("LV %s/%s has open snapshot %s: "
983 "not deactivating", lv
->vg
->name
, lv
->name
,
984 snap_seg
->cow
->name
);
992 int lv_deactivate(struct cmd_context
*cmd
, const char *lvid_s
)
994 struct logical_volume
*lv
;
1001 if (!(lv
= lv_from_lvid(cmd
, lvid_s
, 0)))
1005 _skip("Deactivating '%s'.", lv
->name
);
1010 if (!lv_info(cmd
, lv
, &info
, 1, 0))
1018 if (lv_is_visible(lv
)) {
1019 if (info
.open_count
) {
1020 log_error("LV %s/%s in use: not deactivating",
1021 lv
->vg
->name
, lv
->name
);
1024 if (lv_is_origin(lv
) && _lv_has_open_snapshots(lv
))
1028 lv_calculate_readahead(lv
, NULL
);
1030 if (!monitor_dev_for_events(cmd
, lv
, 0))
1034 r
= _lv_deactivate(lv
);
1038 if (!lv_info(cmd
, lv
, &info
, 1, 0) || info
.exists
)
1047 /* Test if LV passes filter */
1048 int lv_activation_filter(struct cmd_context
*cmd
, const char *lvid_s
,
1051 struct logical_volume
*lv
;
1054 if (!activation()) {
1059 if (!(lv
= lv_from_lvid(cmd
, lvid_s
, 0)))
1062 if (!_passes_activation_filter(cmd
, lv
)) {
1063 log_verbose("Not activating %s/%s due to config file settings",
1064 lv
->vg
->name
, lv
->name
);
1076 static int _lv_activate(struct cmd_context
*cmd
, const char *lvid_s
,
1077 int exclusive
, int filter
)
1079 struct logical_volume
*lv
;
1086 if (!(lv
= lv_from_lvid(cmd
, lvid_s
, 0)))
1089 if (filter
&& !_passes_activation_filter(cmd
, lv
)) {
1090 log_verbose("Not activating %s/%s due to config file settings",
1091 lv
->vg
->name
, lv
->name
);
1095 if ((!lv
->vg
->cmd
->partial_activation
) && (lv
->status
& PARTIAL_LV
)) {
1096 log_error("Refusing activation of partial LV %s. Use --partial to override.",
1101 if (lv_has_unknown_segments(lv
)) {
1102 log_error("Refusing activation of LV %s containing "
1103 "an unrecognised segment.", lv
->name
);
1108 _skip("Activating '%s'.", lv
->name
);
1113 if (!lv_info(cmd
, lv
, &info
, 0, 0))
1116 if (info
.exists
&& !info
.suspended
&& info
.live_table
) {
1121 lv_calculate_readahead(lv
, NULL
);
1124 lv
->status
|= ACTIVATE_EXCL
;
1127 if (!(r
= _lv_activate_lv(lv
)))
1132 if (r
&& !monitor_dev_for_events(cmd
, lv
, 1))
1143 int lv_activate(struct cmd_context
*cmd
, const char *lvid_s
, int exclusive
)
1145 if (!_lv_activate(cmd
, lvid_s
, exclusive
, 0))
1151 /* Activate LV only if it passes filter */
1152 int lv_activate_with_filter(struct cmd_context
*cmd
, const char *lvid_s
, int exclusive
)
1154 if (!_lv_activate(cmd
, lvid_s
, exclusive
, 1))
1160 int lv_mknodes(struct cmd_context
*cmd
, const struct logical_volume
*lv
)
1165 r
= dm_mknodes(NULL
);
1173 r
= dev_manager_mknodes(lv
);
1181 * Does PV use VG somewhere in its construction?
1182 * Returns 1 on failure.
1184 int pv_uses_vg(struct physical_volume
*pv
,
1185 struct volume_group
*vg
)
1190 if (!dm_is_dm_major(MAJOR(pv
->dev
->dev
)))
1193 return dev_manager_device_uses_vg(pv
->dev
, vg
);
1196 void activation_release(void)
1198 dev_manager_release();
1201 void activation_exit(void)
This page took 0.087855 seconds and 6 git commands to generate.