This patch is all just cleanup and no other patch depends on it.
Replace explicit dereference and check with vg_is_exported().
Update a few copyrights and remove unnecessary whitespace.
Should be no functional change.
char uuid_primary[64] __attribute((aligned(8)));
char uuid_new[64] __attribute((aligned(8)));
int use_new = 0;
-
+
/* Pre-existing VG takes precedence. Unexported VG takes precedence. */
if (primary_vginfo) {
if (!id_write_format((const struct id *)vgid, uuid_new, sizeof(uuid_new)))
access_str == LVM_WRITE ? "write" : "",
access_str == 0 ? "error" : "");
log_print("VG Status %s%sresizable",
- vg->status & EXPORTED_VG ? "exported/" : "",
+ vg_is_exported(vg) ? "exported/" : "",
vg->status & RESIZEABLE_VG ? "" : "NOT ");
/* vg number not part of LVM2 design
log_print ("VG # %u\n", vg->vg_number);
strncpy((char *)pvd->system_id, vg->system_id, sizeof(pvd->system_id));
/* Is VG already exported or being exported? */
- if (vg && (vg->status & EXPORTED_VG)) {
+ if (vg && vg_is_exported(vg)) {
/* Does system_id need setting? */
if (!*vg->system_id ||
strncmp(vg->system_id, EXPORTED_TAG,
}
/* Is VG being imported? */
- if (vg && !(vg->status & EXPORTED_VG) && *vg->system_id &&
+ if (vg && !vg_is_exported(vg) && *vg->system_id &&
!strncmp(vg->system_id, EXPORTED_TAG, sizeof(EXPORTED_TAG) - 1)) {
if (!_system_id(cmd, (char *)pvd->system_id, IMPORTED_TAG))
return_0;
if (vg->status & SHARED)
vgd->vg_access |= VG_SHARED;
- if (vg->status & EXPORTED_VG)
+ if (vg_is_exported(vg))
vgd->vg_status |= VG_EXPORTED;
if (vg->status & RESIZEABLE_VG)
struct volume_group *vg_backup;
int old_suppress;
- if (vg->status & EXPORTED_VG)
+ if (vg_is_exported(vg))
return;
if (dm_snprintf(path, sizeof(path), "%s/%s",
else
repstr[1] = '-';
- if (vg->status & EXPORTED_VG)
+ if (vg_is_exported(vg))
repstr[2] = 'x';
else
repstr[2] = '-';
if (!vg_refresh_visible(cmd, vg))
return ECMD_FAILED;
-
+
return ECMD_PROCESSED;
}
if (vg_read_error(vg))
return ECMD_FAILED;
- if (vg_status(vg) & EXPORTED_VG) {
+ if (vg_is_exported(vg)) {
log_error("Volume group \"%s\" is exported", vg_name);
return ECMD_FAILED;
}
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
if (vg_read_error(vg))
goto error;
- if (!(vg_status(vg) & EXPORTED_VG)) {
+ if (!vg_is_exported(vg)) {
log_error("Volume group \"%s\" is not exported", vg_name);
goto error;
}
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
return ECMD_FAILED;
log_print("Found %svolume group \"%s\" using metadata type %s",
- (vg_status(vg) & EXPORTED_VG) ? "exported " : "", vg_name,
+ vg_is_exported(vg) ? "exported " : "", vg_name,
vg->fid->fmt->name);
check_current_backup(vg);