summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDave Wysochanski <dwysocha@redhat.com>2008-04-10 17:09:32 +0000
committerDave Wysochanski <dwysocha@redhat.com>2008-04-10 17:09:32 +0000
commit985ca02b6a86d8afdb156c3390f849ee37836158 (patch)
tree5ab92de0b83390a00638ed72547b69aa1555d5bb /lib
parent8965ff4bcfbd4e41489e56a771c8a63df7a69e42 (diff)
downloadlvm2-985ca02b6a86d8afdb156c3390f849ee37836158.tar.gz
lvm2-985ca02b6a86d8afdb156c3390f849ee37836158.tar.xz
lvm2-985ca02b6a86d8afdb156c3390f849ee37836158.zip
Add vg_is_clustered() helper function.
Should be no functional change.
Diffstat (limited to 'lib')
-rw-r--r--lib/activate/dev_manager.c2
-rw-r--r--lib/display/display.c2
-rw-r--r--lib/format1/import-export.c2
-rw-r--r--lib/locking/locking.h2
-rw-r--r--lib/metadata/lv_manip.c2
-rw-r--r--lib/metadata/metadata-exported.h1
-rw-r--r--lib/metadata/metadata.c5
-rw-r--r--lib/mirror/mirrored.c4
-rw-r--r--lib/report/report.c2
9 files changed, 11 insertions, 11 deletions
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index e53452bd..1b6242ce 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -836,7 +836,7 @@ static int _add_segment_to_dtree(struct dev_manager *dm,
/* If this is a snapshot origin, add real LV */
if (lv_is_origin(seg->lv) && !layer) {
- if (seg->lv->vg->status & CLUSTERED) {
+ if (vg_is_clustered(seg->lv->vg)) {
log_error("Clustered snapshots are not yet supported");
return 0;
}
diff --git a/lib/display/display.c b/lib/display/display.c
index 87e34fa4..d43b864b 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -602,7 +602,7 @@ void vgdisplay_full(const struct volume_group *vg)
/* vg number not part of LVM2 design
log_print ("VG # %u\n", vg->vg_number);
*/
- if (vg->status & CLUSTERED) {
+ if (vg_is_clustered(vg)) {
log_print("Clustered yes");
log_print("Shared %s",
vg->status & SHARED ? "yes" : "no");
diff --git a/lib/format1/import-export.c b/lib/format1/import-export.c
index a0de3628..04bcc028 100644
--- a/lib/format1/import-export.c
+++ b/lib/format1/import-export.c
@@ -271,7 +271,7 @@ int export_vg(struct vg_disk *vgd, struct volume_group *vg)
if (vg->status & LVM_WRITE)
vgd->vg_access |= VG_WRITE;
- if (vg->status & CLUSTERED)
+ if (vg_is_clustered(vg))
vgd->vg_access |= VG_CLUSTERED;
if (vg->status & SHARED)
diff --git a/lib/locking/locking.h b/lib/locking/locking.h
index 6c292f7d..a5872bcb 100644
--- a/lib/locking/locking.h
+++ b/lib/locking/locking.h
@@ -99,7 +99,7 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
#define LCK_LV_DEACTIVATE (LCK_LV | LCK_NULL | LCK_NONBLOCK)
#define LCK_LV_CLUSTERED(lv) \
- (((lv)->vg->status & CLUSTERED) ? LCK_CLUSTER_VG : 0)
+ (vg_is_clustered((lv)->vg) ? LCK_CLUSTER_VG : 0)
#define lock_lv_vol(cmd, lv, flags) \
lock_vol(cmd, (lv)->lvid.s, flags | LCK_LV_CLUSTERED(lv))
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 0dc9ed4c..d947b6ee 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -1983,7 +1983,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
* 1) Clustered VG, and some remote nodes have the LV active
* 2) Non-clustered VG, but LV active locally
*/
- if ((vg_status(vg) & CLUSTERED) && !activate_lv_excl(cmd, lv) &&
+ if (vg_is_clustered(vg) && !activate_lv_excl(cmd, lv) &&
(force == PROMPT)) {
if (yes_no_prompt("Logical volume \"%s\" is active on other "
"cluster nodes. Really remove? [y/n]: ",
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index e0d55927..dd04e5f6 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -544,6 +544,7 @@ uint32_t pv_pe_count(const pv_t *pv);
uint32_t pv_pe_alloc_count(const pv_t *pv);
uint32_t vg_status(const vg_t *vg);
+#define vg_is_clustered(vg) (vg_status((vg)) & CLUSTERED)
struct vgcreate_params {
char *vg_name;
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index cecbcbd2..98c4156c 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -1124,7 +1124,7 @@ int vgs_are_compatible(struct cmd_context *cmd __attribute((unused)),
}
/* Clustering attribute must be the same */
- if ((vg_to->status & CLUSTERED) != (vg_from->status & CLUSTERED)) {
+ if (vg_is_clustered(vg_to) != vg_is_clustered(vg_from)) {
log_error("Clustered attribute differs for \"%s\" and \"%s\"",
vg_to->name, vg_from->name);
return 0;
@@ -2102,7 +2102,7 @@ int pv_analyze(struct cmd_context *cmd, const char *pv_name,
int vg_check_status(const struct volume_group *vg, uint32_t status)
{
if ((status & CLUSTERED) &&
- (vg->status & CLUSTERED) && !locking_is_clustered() &&
+ (vg_is_clustered(vg)) && !locking_is_clustered() &&
!lockingfailed()) {
log_error("Skipping clustered volume group %s", vg->name);
return 0;
@@ -2240,7 +2240,6 @@ uint32_t vg_status(const vg_t *vg)
return vg->status;
}
-
/**
* pv_by_path - Given a device path return a PV handle if it is a PV
* @cmd - handle to the LVM command instance
diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c
index 64bcd304..f837f0b1 100644
--- a/lib/mirror/mirrored.c
+++ b/lib/mirror/mirrored.c
@@ -237,7 +237,7 @@ static int _add_log(struct dev_manager *dm, struct lv_segment *seg,
* in clustered VG.
*/
if ((!(seg->lv->status & ACTIVATE_EXCL) &&
- (seg->lv->vg->status & CLUSTERED)))
+ (vg_is_clustered(seg->lv->vg))))
clustered = 1;
if (seg->log_lv) {
@@ -519,7 +519,7 @@ static int _mirrored_modules_needed(struct dm_pool *mem,
!list_segment_modules(mem, first_seg(seg->log_lv), modules))
return_0;
- if ((seg->lv->vg->status & CLUSTERED) &&
+ if (vg_is_clustered(seg->lv->vg) &&
!str_list_add(mem, modules, "clog")) {
log_error("cluster log string list allocation failed");
return 0;
diff --git a/lib/report/report.c b/lib/report/report.c
index 3279ad9f..c4aedff9 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -439,7 +439,7 @@ static int _vgstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_
repstr[4] = _alloc_policy_char(vg->alloc);
- if (vg->status & CLUSTERED)
+ if (vg_is_clustered(vg))
repstr[5] = 'c';
else
repstr[5] = '-';