Lines Matching refs:cmd

51 static int _remove_lv(struct cmd_context *cmd, struct logical_volume *lv,
71 if (!test_mode() && !deactivate_lv(cmd, snap_seg->origin)) {
88 !deactivate_lv(cmd, snap_seg->origin)) {
115 if ((lv_info(cmd, lv, &info, 0, 0) && info.exists) ||
120 if (!(lvl = dm_pool_alloc(cmd->mem, sizeof(*lvl)))) {
136 static int _consolidate_vg(struct cmd_context *cmd, struct volume_group *vg)
150 cmd->handles_missing_pvs = 1;
166 static int _make_vg_consistent(struct cmd_context *cmd, struct volume_group *vg)
199 if (arg_count(cmd, mirrorsonly_ARG) &&
205 if (!_remove_lv(cmd, lv, &list_unsafe, &lvs_changed))
246 if (!suspend_lvs(cmd, &lvs_changed)) {
261 if (!resume_lvs(cmd, &lvs_changed)) {
294 get_segtype_from_string(vg->cmd, "error"))) {
332 if (!_remove_lv(cmd, lvl->lv,
352 if (!deactivate_lv(cmd, lvl->lv)) {
381 static int _vgreduce_single(struct cmd_context *cmd, struct volume_group *vg,
401 if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) {
428 orphan_vg = vg_read_for_update(cmd, vg->fid->fmt->orphan_vg_name,
434 if (!vg_split_mdas(cmd, vg, orphan_vg) || !vg->pv_count) {
446 if (!pv_write(cmd, pv, NULL, INT64_C(-1))) {
458 unlock_and_release_vg(cmd, orphan_vg, VG_ORPHANS);
462 int vgreduce(struct cmd_context *cmd, int argc, char **argv)
468 int repairing = arg_count(cmd, removemissing_ARG);
482 if (arg_count(cmd, mirrorsonly_ARG) && !repairing) {
487 if (argc == 1 && !arg_count(cmd, all_ARG) && !repairing) {
492 if (argc > 1 && arg_count(cmd, all_ARG)) {
503 vg_name = skip_dev_dir(cmd, argv[0], NULL);
511 cmd->handles_missing_pvs = 1;
514 vg = vg_read_for_update(cmd, vg_name, NULL, READ_ALLOW_EXPORTED);
521 && !arg_count(cmd, removemissing_ARG))
535 vg = vg_read_for_update(cmd, vg_name, NULL,
546 if (arg_count(cmd, force_ARG)) {
547 if (!_make_vg_consistent(cmd, vg))
550 fixed = _consolidate_vg(cmd, vg);
572 ret = process_each_pv(cmd, argc, argv, vg, READ_FOR_UPDATE, 0, NULL,
578 unlock_and_release_vg(cmd, vg, vg_name);