#include <sys/param.h>
-static struct volume_group *_vg_read_internal(struct cmd_context *cmd,
- const char *vgname,
- const char *vgid, int *consistent);
/*
* FIXME: Check for valid handle before dereferencing field or log error?
*/
struct pv_list *pvl;
int r = 0, consistent = 0;
- if (!(vg = _vg_read_internal(fmt->cmd, vg_name, vgid, &consistent))) {
- log_error("get_pv_from_vg_by_id: _vg_read_internal failed to read VG %s",
+ if (!(vg = vg_read_internal(fmt->cmd, vg_name, vgid, &consistent))) {
+ log_error("get_pv_from_vg_by_id: vg_read_internal failed to read VG %s",
vg_name);
return 0;
}
/* FIXME: Is this vg_read_internal necessary? Move it inside
vg_lock_newname? */
/* is this vg name already in use ? */
- if ((vg = _vg_read_internal(cmd, vg_name, NULL, &consistent))) {
+ if ((vg = vg_read_internal(cmd, vg_name, NULL, &consistent))) {
log_error("A volume group called '%s' already exists.", vg_name);
unlock_and_release_vg(cmd, vg, vg_name);
return _vg_make_handle(cmd, NULL, FAILED_EXIST);
if (is_orphan_vg(vgname)) {
if (use_precommitted) {
- log_error("Internal error: _vg_read_internal requires vgname "
+ log_error("Internal error: vg_read_internal requires vgname "
"with pre-commit.");
return NULL;
}
return correct_vg;
}
-static struct volume_group *_vg_read_internal(struct cmd_context *cmd,
- const char *vgname,
- const char *vgid, int *consistent)
+struct volume_group *vg_read_internal(struct cmd_context *cmd, const char *vgname,
+ const char *vgid, int *consistent)
{
struct volume_group *vg;
struct lv_list *lvl;
/* This is only called by lv_from_lvid, which is only called from
* activate.c so we know the appropriate VG lock is already held and
- * the _vg_read_internal is therefore safe.
+ * the vg_read_internal is therefore safe.
*/
static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
const char *vgid,
if (memlock())
goto out;
- /* FIXME Need a genuine read by ID here - don't _vg_read_internal by name! */
+ /* FIXME Need a genuine read by ID here - don't vg_read_internal by name! */
/* FIXME Disabled vgrenames while active for now because we aren't
* allowed to do a full scan here any more. */
stack;
continue;
}
- if (!(vg = _vg_read_internal(cmd, vgname, vgid, &consistent))) {
+ if (!(vg = vg_read_internal(cmd, vgname, vgid, &consistent))) {
stack;
continue;
}
if (!lock_vol(cmd, lock_name, lock_flags))
return_NULL;
- if (!(vg = _vg_read_internal(cmd, vg_name, vgid, &consistent)))
+ if (!(vg = vg_read_internal(cmd, vg_name, vgid, &consistent)))
return_NULL;
if (!consistent) {
consistent_in = consistent;
/* If consistent == 1, we get NULL here if correction fails. */
- if (!(vg = _vg_read_internal(cmd, vg_name, vgid, &consistent))) {
+ if (!(vg = vg_read_internal(cmd, vg_name, vgid, &consistent))) {
if (consistent_in && !consistent) {
log_error("Volume group \"%s\" inconsistent.", vg_name);
failure |= FAILED_INCONSISTENT;