]> sourceware.org Git - lvm2.git/commitdiff
Add vg_is_resizeable() and cleanup references.
authorDave Wysochanski <dwysocha@redhat.com>
Tue, 15 Sep 2009 18:35:13 +0000 (18:35 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Tue, 15 Sep 2009 18:35:13 +0000 (18:35 +0000)
Clean up VG_RESIZEABLE flag by creating vg_is_resizeable().
Update comment - we no longer have ALLOW_RESIZEABLE.
Also use vg_is_exported() in one place missed by earlier patch.
Should be no functional change.

WHATS_NEW
lib/display/display.c
lib/format1/import-export.c
lib/metadata/metadata-exported.h
lib/metadata/metadata.c
lib/report/report.c
tools/vgchange.c

index 05ce2ef8fe2980dd6f40cc76c322715c53687b75..f2b6234b23ae5a63f7b76a5cc2fbf2d31bd08c66 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.53 - 
 =====================================
+  Add vg_is_resizeable() and cleanup reference to VG_RESIZEABLE.
 
 Version 2.02.52 - 15th September 2009
 =====================================
index 058b0843766128d3d79451d24180ecd93674a840..62f30f64837c5719e06c4ee927faca097cb2708b 100644 (file)
@@ -598,7 +598,7 @@ void vgdisplay_full(const struct volume_group *vg)
                  access_str == 0 ? "error" : "");
        log_print("VG Status             %s%sresizable",
                  vg_is_exported(vg) ? "exported/" : "",
-                 vg->status & RESIZEABLE_VG ? "" : "NOT ");
+                 vg_is_resizeable(vg) ? "" : "NOT ");
        /* vg number not part of LVM2 design
           log_print ("VG #                  %u\n", vg->vg_number);
         */
index 070ffafa448e7ba6a64582805c109c04948b1dc1..1160d09baf2dd1eb450bb7133913faa505d28a50 100644 (file)
@@ -278,7 +278,7 @@ int export_vg(struct vg_disk *vgd, struct volume_group *vg)
        if (vg_is_exported(vg))
                vgd->vg_status |= VG_EXPORTED;
 
-       if (vg->status & RESIZEABLE_VG)
+       if (vg_is_resizeable(vg))
                vgd->vg_status |= VG_EXTENDABLE;
 
        vgd->lv_max = vg->max_lv;
index 0861f4d5943d403cb015a78fc4b252b21a24b7d9..50f0b90d8648b1775aac7a662761dea670ccc8f3 100644 (file)
@@ -722,6 +722,7 @@ uint64_t vg_max_lv(const struct volume_group *vg);
 int vg_check_write_mode(struct volume_group *vg);
 #define vg_is_clustered(vg) (vg_status((vg)) & CLUSTERED)
 #define vg_is_exported(vg) (vg_status((vg)) & EXPORTED_VG)
+#define vg_is_resizeable(vg) (vg_status((vg)) & RESIZEABLE_VG)
 
 struct vgcreate_params {
        char *vg_name;
index 79e0016f823e82d921e18d5778eeb3345bf502d7..263c705fd610be7f5d8fca7f27d8a6f290006844 100644 (file)
@@ -865,7 +865,7 @@ int vg_set_extent_size(struct volume_group *vg, uint32_t new_size)
        struct pv_segment *pvseg;
        uint32_t s;
 
-       if (!(vg_status(vg) & RESIZEABLE_VG)) {
+       if (!vg_is_resizeable(vg)) {
                log_error("Volume group \"%s\" must be resizeable "
                          "to change PE size", vg->name);
                return 0;
@@ -1003,7 +1003,7 @@ int vg_set_extent_size(struct volume_group *vg, uint32_t new_size)
 
 int vg_set_max_lv(struct volume_group *vg, uint32_t max_lv)
 {
-       if (!(vg_status(vg) & RESIZEABLE_VG)) {
+       if (!vg_is_resizeable(vg)) {
                log_error("Volume group \"%s\" must be resizeable "
                          "to change MaxLogicalVolume", vg->name);
                return 0;
@@ -1031,7 +1031,7 @@ int vg_set_max_lv(struct volume_group *vg, uint32_t max_lv)
 
 int vg_set_max_pv(struct volume_group *vg, uint32_t max_pv)
 {
-       if (!(vg_status(vg) & RESIZEABLE_VG)) {
+       if (!vg_is_resizeable(vg)) {
                log_error("Volume group \"%s\" must be resizeable "
                          "to change MaxPhysicalVolumes", vg->name);
                return 0;
@@ -3148,7 +3148,7 @@ static uint32_t _vg_bad_status_bits(const struct volume_group *vg,
        }
 
        if ((status & EXPORTED_VG) &&
-           (vg->status & EXPORTED_VG)) {
+           vg_is_exported(vg)) {
                log_error("Volume group %s is exported", vg->name);
                failure |= FAILED_EXPORTED;
        }
@@ -3160,7 +3160,7 @@ static uint32_t _vg_bad_status_bits(const struct volume_group *vg,
        }
 
        if ((status & RESIZEABLE_VG) &&
-           !(vg->status & RESIZEABLE_VG)) {
+           !vg_is_resizeable(vg)) {
                log_error("Volume group %s is not resizeable.", vg->name);
                failure |= FAILED_RESIZEABLE;
        }
@@ -3311,8 +3311,7 @@ bad:
  *  - metadata inconsistent and automatic correction failed: FAILED_INCONSISTENT
  *  - VG is read-only: FAILED_READ_ONLY
  *  - VG is EXPORTED, unless flags has READ_ALLOW_EXPORTED: FAILED_EXPORTED
- *  - VG is not RESIZEABLE, unless flags has ALLOW_NONRESIZEABLE:
- *    FAILED_RESIZEABLE
+ *  - VG is not RESIZEABLE: FAILED_RESIZEABLE
  *  - locking failed: FAILED_LOCKING
  *
  * On failures, all locks are released, unless one of the following applies:
index a6569b4dd4b43968570a3d498cbfd35a6bed2068..15354e725e11c27079c85596508b270070a6488d 100644 (file)
@@ -429,7 +429,7 @@ static int _vgstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_
        else
                repstr[0] = 'r';
 
-       if (vg->status & RESIZEABLE_VG)
+       if (vg_is_resizeable(vg))
                repstr[1] = 'z';
        else
                repstr[1] = '-';
index c74116cafca8086ec1dd4a00a89e6304b9ef936a..95b0b48cae57c46ed34a5a88ffe1365a2dd9e541 100644 (file)
@@ -212,13 +212,13 @@ static int _vgchange_resizeable(struct cmd_context *cmd,
 {
        int resizeable = !strcmp(arg_str_value(cmd, resizeable_ARG, "n"), "y");
 
-       if (resizeable && (vg_status(vg) & RESIZEABLE_VG)) {
+       if (resizeable && vg_is_resizeable(vg)) {
                log_error("Volume group \"%s\" is already resizeable",
                          vg->name);
                return ECMD_FAILED;
        }
 
-       if (!resizeable && !(vg_status(vg) & RESIZEABLE_VG)) {
+       if (!resizeable && !vg_is_resizeable(vg)) {
                log_error("Volume group \"%s\" is already not resizeable",
                          vg->name);
                return ECMD_FAILED;
This page took 0.058298 seconds and 5 git commands to generate.