]> sourceware.org Git - lvm2.git/commitdiff
Use id_equal instead of strncmp()
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 29 Mar 2011 21:57:56 +0000 (21:57 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 29 Mar 2011 21:57:56 +0000 (21:57 +0000)
More consistent and easier to read.

WHATS_NEW
lib/metadata/metadata.c

index b7c7622e3ba7cf8b867279591aa1d2da93db7211..28dececc30db5228367538f8511f038e0ccdaecc 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.85 - 
 ===================================
+  Replace several strncmp() calls with id_equal().
   Fix lvmcache_info transfer to orphan_vginfo in _lvmcache_update_vgname().
   Fix -Wold-style-definition gcc warnings.
   Fixes for lvconvert (including --repair) of temporary mirror stacks.
index cdd6089f552f56a144894071ed6044e79946a182..4e46385a49489aa87f50997c5a4640cbe4d65576 100644 (file)
@@ -3043,8 +3043,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
                                continue;
                        }
 
-                       if (strncmp((char *)vg->id.uuid,
-                           (char *)correct_vg->id.uuid, ID_LEN)) {
+                       if (!id_equal(&vg->id, &correct_vg->id)) {
                                inconsistent = 1;
                                inconsistent_vgid = 1;
                        }
@@ -3292,7 +3291,7 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
            vginfo->vgname && !is_orphan_vg(vginfo->vgname)) {
                if ((vg = _vg_read(cmd, NULL, vgid, 1,
                                   &consistent, precommitted)) &&
-                   !strncmp((char *)vg->id.uuid, vgid, ID_LEN)) {
+                   id_equal(&vg->id, (const struct id *)vgid)) {
                        if (!consistent)
                                log_error("Volume group %s metadata is "
                                          "inconsistent", vg->name);
@@ -3323,7 +3322,7 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
                consistent = 0;
                if ((vg = _vg_read(cmd, vgname, vgid, 1, &consistent,
                                   precommitted)) &&
-                   !strncmp((char *)vg->id.uuid, vgid, ID_LEN)) {
+                   id_equal(&vg->id, (const struct id *)vgid)) {
                        if (!consistent) {
                                log_error("Volume group %s metadata is "
                                          "inconsistent", vgname);
This page took 0.04886 seconds and 5 git commands to generate.