#define LCK_VG_READ (LCK_VG | LCK_READ | LCK_HOLD)
#define LCK_VG_WRITE (LCK_VG | LCK_WRITE | LCK_HOLD)
#define LCK_VG_UNLOCK (LCK_VG | LCK_UNLOCK)
-#define LCK_VG_DROP_CACHE (LCK_VG | LCK_WRITE | LCK_CACHE)
/* FIXME: LCK_HOLD abused here */
#define LCK_VG_COMMIT (LCK_VG | LCK_WRITE | LCK_CACHE | LCK_HOLD)
release_vg(vg); \
} while (0)
-#define drop_cached_metadata(vg) \
- lock_vol((vg)->cmd, (vg)->name, LCK_VG_DROP_CACHE, NULL)
-
int sync_local_dev_names(struct cmd_context* cmd);
/* Process list of LVs */
return 0;
}
- if (!drop_cached_metadata(vg)) {
- log_error("Unable to drop cached metadata for VG %s.", vg->name);
- return 0;
- }
-
if (critical_section())
log_error(INTERNAL_ERROR
"Writing metadata in critical section.");
_vg_move_cached_precommitted_to_committed(vg);
}
- /* If update failed, remove any cached precommitted metadata. */
- if (!cache_updated && !drop_cached_metadata(vg))
- log_error("Attempt to drop cached metadata failed "
- "after commit for VG %s.", vg->name);
-
/* If at least one mda commit succeeded, it was committed */
return cache_updated;
}
stack;
}
}
-
- if (!drop_cached_metadata(vg))
- log_error("Attempt to drop cached metadata failed "
- "after reverted update for VG %s.", vg->name);
}
static int _check_mda_in_use(struct metadata_area *mda, void *_in_use)
pv_dev_name(pvl->pv), uuid, vg->name);
if (!pv_write_orphan(cmd, pvl->pv))
return_0;
-
- /* Refresh metadata after orphan write */
- if (!drop_cached_metadata(vg)) {
- log_error("Unable to drop cached metadata for VG %s while wiping outdated PVs.", vg->name);
- return 0;
- }
next_pv:
;
}
if (!archive(vg_from) || !archive(vg_to))
goto_bad;
- if (!drop_cached_metadata(vg_from))
- stack;
-
if (!_vgmerge_select_pool_metadata_spare(cmd, vg_to, vg_from))
goto_bad;