mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Use id_equal instead of strncmp()
More consistent and easier to read.
This commit is contained in:
parent
6076185b70
commit
1bedd3a97b
@ -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.
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user