]> sourceware.org Git - lvm2.git/commitdiff
Use vg_is_exported(vg) macro everywhere.
authorDave Wysochanski <dwysocha@redhat.com>
Mon, 14 Sep 2009 19:44:15 +0000 (19:44 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Mon, 14 Sep 2009 19:44:15 +0000 (19:44 +0000)
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.

lib/cache/lvmcache.c
lib/display/display.c
lib/format1/import-export.c
lib/format_text/archiver.c
lib/report/report.c
tools/vgchange.c
tools/vgimport.c
tools/vgscan.c

index 9ad61a2fbdcd3fe83447b3fd28780741281d4808..74b66e458eba01dfc8af3fac29222da09a39e7e7 100644 (file)
@@ -821,7 +821,7 @@ static int _insert_vginfo(struct lvmcache_vginfo *new_vginfo, const char *vgid,
        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)))
index 6e280b1f9d4b6bbe2d7771649b8a47dcaf25c921..058b0843766128d3d79451d24180ecd93674a840 100644 (file)
@@ -597,7 +597,7 @@ void vgdisplay_full(const struct volume_group *vg)
                  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);
index 4d0e5c5977a2220c15d0ff2f3c724f6467ab8f41..070ffafa448e7ba6a64582805c109c04948b1dc1 100644 (file)
@@ -160,7 +160,7 @@ int export_pv(struct cmd_context *cmd, struct dm_pool *mem __attribute((unused))
                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,
@@ -178,7 +178,7 @@ int export_pv(struct cmd_context *cmd, struct dm_pool *mem __attribute((unused))
        }
 
        /* 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;
@@ -275,7 +275,7 @@ int export_vg(struct vg_disk *vgd, struct volume_group *vg)
        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)
index a3fd4bd187afd9bec07e21a1ac411bcada2efc63..78aea959bc0fe30f08615cffe190c89b627395fe 100644 (file)
@@ -415,7 +415,7 @@ void check_current_backup(struct volume_group *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",
index bfa4b76db911c88aed7abbf54156306a07ec7c14..a6569b4dd4b43968570a3d498cbfd35a6bed2068 100644 (file)
@@ -434,7 +434,7 @@ static int _vgstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_
        else
                repstr[1] = '-';
 
-       if (vg->status & EXPORTED_VG)
+       if (vg_is_exported(vg))
                repstr[2] = 'x';
        else
                repstr[2] = '-';
index 19c3eb7ef3bd7c858d74c9a1ec995c80d4d0cb59..b3177eb4321107be6bf862ea743f970d756054f3 100644 (file)
@@ -446,7 +446,7 @@ static int _vgchange_refresh(struct cmd_context *cmd, struct volume_group *vg)
 
        if (!vg_refresh_visible(cmd, vg))
                return ECMD_FAILED;
-       
+
        return ECMD_PROCESSED;
 }
 
@@ -459,7 +459,7 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
        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;
        }
index 864a70098cec228b2e63c225f5f99474b511484d..5161b6236e4b31d82f3b10451dae04debf7986b5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * 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.
  *
@@ -26,7 +26,7 @@ static int vgimport_single(struct cmd_context *cmd __attribute((unused)),
        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;
        }
index 769c5cfa1674e2ece83a8c159aad1566b985d28d..a7aef5f053c29c3e6ad59bf0d062dbc6669123aa 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * 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.
  *
@@ -23,7 +23,7 @@ static int vgscan_single(struct cmd_context *cmd, const char *vg_name,
                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);
This page took 0.05523 seconds and 5 git commands to generate.