master - build: fixes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1140d70893e4f246a46...
Commit: 1140d70893e4f246a46fa360d20838ceafa690ec
Parent: eebf070d32b491fb08f7defccc08f9bcefb9aba2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 4 12:25:48 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 4 12:28:13 2018 +0200
build: fixes
---
daemons/lvmlockd/Makefile.in | 6 ++++--
daemons/lvmpolld/Makefile.in | 3 ++-
lib/activate/activate.h | 2 +-
lib/metadata/lv.c | 2 +-
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/daemons/lvmlockd/Makefile.in b/daemons/lvmlockd/Makefile.in
index 9e2297f..7c58fe2 100644
--- a/daemons/lvmlockd/Makefile.in
+++ b/daemons/lvmlockd/Makefile.in
@@ -42,10 +42,12 @@ LIBS += $(RT_LIBS) $(DAEMON_LIBS) $(PTHREAD_LIBS)
lvmlockd: $(OBJECTS) $(top_builddir)/libdaemon/client/libdaemonclient.a \
$(top_builddir)/libdaemon/server/libdaemonserver.a
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LOCK_LIBS) -ldaemonserver $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LOCK_LIBS) -ldaemonserver \
+ $(top_builddir)/device_mapper/libdevice-mapper.a $(LIBS)
lvmlockctl: lvmlockctl.o $(top_builddir)/libdaemon/client/libdaemonclient.a
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ lvmlockctl.o $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ lvmlockctl.o \
+ $(top_builddir)/device_mapper/libdevice-mapper.a $(LIBS)
install_lvmlockd: lvmlockd
$(INSTALL_PROGRAM) -D $< $(sbindir)/$(<F)
diff --git a/daemons/lvmpolld/Makefile.in b/daemons/lvmpolld/Makefile.in
index 69c4a8d..229a87e 100644
--- a/daemons/lvmpolld/Makefile.in
+++ b/daemons/lvmpolld/Makefile.in
@@ -34,7 +34,8 @@ LIBS += $(DAEMON_LIBS) -ldaemonserver $(PTHREAD_LIBS)
lvmpolld: $(OBJECTS) $(top_builddir)/libdaemon/client/libdaemonclient.a \
$(top_builddir)/libdaemon/server/libdaemonserver.a
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) \
+ $(top_builddir)/device_mapper/libdevice-mapper.a $(LIBS)
install_lvmpolld: lvmpolld
$(INSTALL_PROGRAM) -D $< $(sbindir)/$(<F)
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index 60ee4a7..8175f68 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -210,7 +210,7 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
const struct lv_activate_opts *laopts, int monitor);
#ifdef DMEVENTD
-# include "libdevmapper-event.h"
+# include "daemons/dmeventd/libdevmapper-event.h"
char *get_monitor_dso_path(struct cmd_context *cmd, int id);
int target_registered_with_dmeventd(struct cmd_context *cmd, const char *dso,
const struct logical_volume *lv, int *pending, int *monitored);
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 54edc88..68507dc 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -290,7 +290,7 @@ char *lvseg_cachemode_dup(struct dm_pool *mem, const struct lv_segment *seg)
}
#ifdef DMEVENTD
-# include "libdevmapper-event.h"
+# include "daemons/dmeventd/libdevmapper-event.h"
#endif
char *lvseg_monitor_dup(struct dm_pool *mem, const struct lv_segment *seg)
{
5 years, 10 months
master - build: remove any leftover file
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=eebf070d32b491fb08f...
Commit: eebf070d32b491fb08f7defccc08f9bcefb9aba2
Parent: 21a5be2364574de43e2afe55a250ccced02df008
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 4 12:16:30 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 4 12:26:38 2018 +0200
build: remove any leftover file
In case repository is used after building older version of lvm2
(i.e. git bisect) make sure clean erases any possible old symlinks.
---
include/.gitignore | 3 --
include/Makefile.in | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 82 insertions(+), 4 deletions(-)
diff --git a/include/.gitignore b/include/.gitignore
index 4971e07..424c745 100644
--- a/include/.gitignore
+++ b/include/.gitignore
@@ -1,4 +1 @@
-.symlinks
-.symlinks_created
-
*.h
diff --git a/include/Makefile.in b/include/Makefile.in
index cbbc003..efe263c 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,6 +1,6 @@
#
# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
-# Copyright (C) 2004-2015 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2004-2018 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -19,3 +19,84 @@ top_builddir = @top_builddir@
include $(top_builddir)/make.tmpl
DISTCLEAN_TARGETS += .configure.h lvm-version.h
+CLEAN_TARGETS += \
+ activate.h \
+ archiver.h \
+ bcache.h \
+ btree.h \
+ clvm.h \
+ config-util.h \
+ config.h \
+ config_settings.h \
+ crc.h \
+ daemon-client.h \
+ daemon-io.h \
+ defaults.h \
+ dev-cache.h \
+ dev-ext-udev-constants.h \
+ dev-type.h \
+ device-types.h \
+ device.h \
+ display.h \
+ dm-ioctl.h \
+ dm-log-userspace.h \
+ dm-logging.h \
+ dmlib.h \
+ filter.h \
+ format-text.h \
+ format1.h \
+ format_pool.h \
+ intl.h \
+ kdev_t.h \
+ label.h \
+ last-path-component.h \
+ lib.h \
+ libdevmapper-event.h \
+ libdevmapper.h \
+ locking.h \
+ log.h \
+ lv.h \
+ lvm-exec.h \
+ lvm-file.h \
+ lvm-flock.h \
+ lvm-globals.h \
+ lvm-logging.h \
+ lvm-maths.h \
+ lvm-percent.h \
+ lvm-signal.h \
+ lvm-string.h \
+ lvm-wrappers.h \
+ lvm2app.h \
+ lvm2cmd.h \
+ lvmcache.h \
+ lvmetad-client.h \
+ lvmetad.h \
+ lvmlockd-client.h \
+ lvmlockd.h \
+ lvmnotify.h \
+ lvmpolld-client.h \
+ lvmpolld-protocol.h \
+ lv_alloc.h \
+ memlock.h \
+ metadata-exported.h \
+ metadata.h \
+ pogen.h \
+ polldaemon.h \
+ polling_ops.h \
+ properties.h \
+ prop_common.h \
+ pv.h \
+ pv_alloc.h \
+ report.h \
+ segtype.h \
+ sharedlib.h \
+ str_list.h \
+ targets.h \
+ text_export.h \
+ text_import.h \
+ tool.h \
+ toolcontext.h \
+ util.h \
+ uuid.h \
+ vg.h \
+ xlate.h
5 years, 10 months
master - build: link lvm2_activation_generator_systemd_red_hat with libdevice-mapper.a
by Joe Thornber
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=21a5be2364574de43e2...
Commit: 21a5be2364574de43e2afe55a250ccced02df008
Parent: 6a1f458bb7a95b5cf71e4e8bf9d030ce739ab039
Author: Joe Thornber <ejt(a)redhat.com>
AuthorDate: Mon Jun 4 10:00:44 2018 +0100
Committer: Joe Thornber <ejt(a)redhat.com>
CommitterDate: Mon Jun 4 10:00:44 2018 +0100
build: link lvm2_activation_generator_systemd_red_hat with libdevice-mapper.a
---
scripts/Makefile.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index eeac881..194d2e2 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -88,8 +88,8 @@ endif
CFLAGS_lvm2_activation_generator_systemd_red_hat.o += $(EXTRA_EXEC_CFLAGS)
-lvm2_activation_generator_systemd_red_hat: $(OBJECTS) $(DEPLIBS)
- $(CC) -o $@ $(OBJECTS) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) $(LVMLIBS)
+lvm2_activation_generator_systemd_red_hat: $(OBJECTS) $(DEPLIBS) $(top_builddir)/device_mapper/libdevice-mapper.a
+ $(CC) -o $@ $(OBJECTS) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) $(LVMLIBS) $(top_builddir)/device_mapper/libdevice-mapper.a $(LIBS)
install_systemd_generators:
$(INSTALL_DIR) $(systemd_generator_dir)
5 years, 10 months
master - build: compile fixes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6a1f458bb7a95b5cf71...
Commit: 6a1f458bb7a95b5cf71e4e8bf9d030ce739ab039
Parent: 4d19321fd36fd6bf3f6170363f51be9ab39c03a7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 1 20:24:45 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 1 21:12:31 2018 +0200
build: compile fixes
---
lib/locking/lvmlockd.c | 2 +-
lib/lvmpolld/lvmpolld-client.h | 2 +-
lib/metadata/mirror.c | 2 +-
tools/pvmove.c | 2 +-
tools/pvscan.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index 103286d..21a9696 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -1111,7 +1111,7 @@ int lockd_stop_vg(struct cmd_context *cmd, struct volume_group *vg)
int result;
int ret;
- if (!vg_is_shared(vg)))
+ if (!vg_is_shared(vg))
return 1;
if (!_use_lvmlockd)
return 0;
diff --git a/lib/lvmpolld/lvmpolld-client.h b/lib/lvmpolld/lvmpolld-client.h
index 16495b6..659b11b 100644
--- a/lib/lvmpolld/lvmpolld-client.h
+++ b/lib/lvmpolld/lvmpolld-client.h
@@ -16,7 +16,7 @@
#define _LVM_LVMPOLLD_CLIENT_H
# ifdef LVMPOLLD_SUPPORT
-# include "daemon-client.h"
+# include "libdaemon/client/daemon-client.h"
# define LVMPOLLD_SOCKET DEFAULT_RUN_DIR "/lvmpolld.socket"
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index 5b01873..9c775c4 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -426,7 +426,7 @@ static int _activate_lv_like_model(struct logical_volume *model,
{
/* FIXME: run all cases through lv_active_change when clvm variants are gone. */
- if (vg_is_shared(vg))
+ if (vg_is_shared(lv->vg))
return lv_active_change(lv->vg->cmd, lv, CHANGE_AEY, 0);
if (lv_is_active_exclusive(model)) {
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 68194b8..1daf364 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -642,7 +642,7 @@ static int _pvmove_setup_single(struct cmd_context *cmd,
* other hosts. For LVs that are active on multiple hosts (sh), we
* would need to used cluster mirrors.
*/
- if (vg_is_shared(vg))) {
+ if (vg_is_shared(vg)) {
if (!lv) {
log_error("pvmove in a shared VG requires a named LV.");
return ECMD_FAILED;
diff --git a/tools/pvscan.c b/tools/pvscan.c
index c7c2744..7cba0f4 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -197,7 +197,7 @@ static int _pvscan_autoactivate_single(struct cmd_context *cmd, const char *vg_n
if (vg_is_exported(vg))
return ECMD_PROCESSED;
- if (vg_is_shared(vg)))
+ if (vg_is_shared(vg))
return ECMD_PROCESSED;
log_debug("pvscan autoactivating VG %s.", vg_name);
5 years, 10 months
master - Merge branch 'master' of git+ssh://sourceware.org/git/lvm2
by Joe Thornber
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4d19321fd36fd6bf3f6...
Commit: 4d19321fd36fd6bf3f6170363f51be9ab39c03a7
Parent: 02c4901d893a1b833260a7cbb66b9ad285d7ce39 7b5b1a9b6f03e9452c7a9d602247e61e808c316b
Author: Joe Thornber <ejt(a)redhat.com>
AuthorDate: Fri Jun 1 19:19:11 2018 +0100
Committer: Joe Thornber <ejt(a)redhat.com>
CommitterDate: Fri Jun 1 19:19:11 2018 +0100
Merge branch 'master' of git+ssh://sourceware.org/git/lvm2
lib/cache/lvmcache.c | 6 ++++--
lib/cache/lvmetad.c | 6 +++---
lib/label/label.c | 2 +-
lib/locking/lvmlockd.c | 12 ++++++------
lib/metadata/lv_manip.c | 2 +-
lib/metadata/metadata.c | 26 ++++++++++++++------------
lib/metadata/mirror.c | 2 +-
lib/metadata/raid_manip.c | 2 +-
lib/metadata/vg.c | 2 +-
tools/lvconvert.c | 14 +++++++-------
tools/lvcreate.c | 4 ++--
tools/pvmove.c | 2 +-
tools/pvscan.c | 2 +-
tools/vgchange.c | 2 +-
tools/vgcreate.c | 2 +-
tools/vgexport.c | 2 +-
tools/vgimport.c | 2 +-
tools/vgmerge.c | 2 +-
tools/vgsplit.c | 2 +-
19 files changed, 49 insertions(+), 45 deletions(-)
5 years, 10 months
master - build: get clvmd building again
by Joe Thornber
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=02c4901d893a1b83326...
Commit: 02c4901d893a1b833260a7cbb66b9ad285d7ce39
Parent: c4497ee9e849d2d6c74412de21c6c3823d4de5f1
Author: Joe Thornber <ejt(a)redhat.com>
AuthorDate: Fri Jun 1 19:18:36 2018 +0100
Committer: Joe Thornber <ejt(a)redhat.com>
CommitterDate: Fri Jun 1 19:18:36 2018 +0100
build: get clvmd building again
---
daemons/clvmd/Makefile.in | 4 ++--
make.tmpl.in | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/daemons/clvmd/Makefile.in b/daemons/clvmd/Makefile.in
index 47a3411..9e096b5 100644
--- a/daemons/clvmd/Makefile.in
+++ b/daemons/clvmd/Makefile.in
@@ -80,9 +80,9 @@ CFLAGS += -fno-strict-aliasing $(EXTRA_EXEC_CFLAGS)
INSTALL_TARGETS = \
install_clvmd
-clvmd: $(OBJECTS) $(top_builddir)/lib/liblvm-internal.a
+clvmd: $(OBJECTS) $(top_builddir)/lib/liblvm-internal.a $(top_builddir)/device_mapper/libdevice-mapper.a
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) \
- -o clvmd $(OBJECTS) $(LMLIBS) $(LIBS)
+ -o clvmd $+ $(LMLIBS) $(LIBS)
.PHONY: install_clvmd
diff --git a/make.tmpl.in b/make.tmpl.in
index ad927b0..16a8571 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -58,7 +58,7 @@ PYTHON3 = @PYTHON3@
PYCOMPILE = $(top_srcdir)/autoconf/py-compile
LIBS = @LIBS@
-LIBS += $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS) $(RT_LIBS)
+LIBS += $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS) $(RT_LIBS) -lm
# Extra libraries always linked with static binaries
STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
DEFS += @DEFS@
5 years, 10 months
master - scan: clean exit for alloc failure
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7b5b1a9b6f03e9452c7...
Commit: 7b5b1a9b6f03e9452c7a9d602247e61e808c316b
Parent: 0625c7f372a8481e21752b1fc930984ba7c900db
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 1 10:40:28 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 1 13:15:22 2018 -0500
scan: clean exit for alloc failure
---
lib/label/label.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/label/label.c b/lib/label/label.c
index 427caa9..f36c706 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -832,7 +832,7 @@ int label_scan(struct cmd_context *cmd)
while ((dev = dev_iter_get(iter))) {
if (!(devl = dm_zalloc(sizeof(*devl))))
- return 0;
+ continue;
devl->dev = dev;
dm_list_add(&all_devs, &devl->list);
5 years, 10 months
master - devs: clear coverity warning about null info
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0625c7f372a8481e217...
Commit: 0625c7f372a8481e21752b1fc930984ba7c900db
Parent: 09177b53dddadf89f976ad72ec293c61d0eee9ba
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 1 10:15:48 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 1 13:15:22 2018 -0500
devs: clear coverity warning about null info
a theoretical possibility.
---
lib/cache/lvmcache.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 68170d8..527f0a6 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1010,7 +1010,8 @@ static void _filter_duplicate_devs(struct cmd_context *cmd)
dm_list_iterate_items_safe(devl, devl2, &_unused_duplicate_devs) {
- info = lvmcache_info_from_pvid(devl->dev->pvid, NULL, 0);
+ if (!(info = lvmcache_info_from_pvid(devl->dev->pvid, NULL, 0)))
+ continue;
if (MAJOR(info->dev->dev) == dt->md_major) {
log_debug_devs("Ignoring md component duplicate %s", dev_name(devl->dev));
@@ -1038,7 +1039,8 @@ static void _warn_duplicate_devs(struct cmd_context *cmd)
dm_list_iterate_items_safe(devl, devl2, &_unused_duplicate_devs) {
/* info for the preferred device that we're actually using */
- info = lvmcache_info_from_pvid(devl->dev->pvid, NULL, 0);
+ if (!(info = lvmcache_info_from_pvid(devl->dev->pvid, NULL, 0)))
+ continue;
if (!id_write_format((const struct id *)info->dev->pvid, uuid, sizeof(uuid)))
stack;
5 years, 10 months
master - lvmlockd: clarify lock_type use for coverity
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=09177b53dddadf89f97...
Commit: 09177b53dddadf89f976ad72ec293c61d0eee9ba
Parent: b6f0f20da25ac4ab6b5294129fd2f383bf818062
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 1 10:12:04 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 1 13:15:22 2018 -0500
lvmlockd: clarify lock_type use for coverity
Make it clearer when vg->lock_type will be used so
coverity doesn't worry about it.
---
lib/metadata/metadata.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 6525cf9..1bbea19 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -2929,13 +2929,15 @@ int vg_write(struct volume_group *vg)
struct lv_list *lvl;
int revert = 0, wrote = 0;
- dm_list_iterate_items(lvl, &vg->lvs) {
- if (lvl->lv->lock_args && !strcmp(lvl->lv->lock_args, "pending")) {
- if (!lockd_init_lv_args(vg->cmd, vg, lvl->lv, vg->lock_type, &lvl->lv->lock_args)) {
- log_error("Cannot allocate lock for new LV.");
- return 0;
+ if (vg_is_shared(vg)) {
+ dm_list_iterate_items(lvl, &vg->lvs) {
+ if (lvl->lv->lock_args && !strcmp(lvl->lv->lock_args, "pending")) {
+ if (!lockd_init_lv_args(vg->cmd, vg, lvl->lv, vg->lock_type, &lvl->lv->lock_args)) {
+ log_error("Cannot allocate lock for new LV.");
+ return 0;
+ }
+ lvl->lv->new_lock_args = 1;
}
- lvl->lv->new_lock_args = 1;
}
}
5 years, 10 months
master - lvmlockd: primarily use vg_is_shared
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b6f0f20da25ac4ab6b5...
Commit: b6f0f20da25ac4ab6b5294129fd2f383bf818062
Parent: c4497ee9e849d2d6c74412de21c6c3823d4de5f1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 1 10:04:54 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 1 13:15:22 2018 -0500
lvmlockd: primarily use vg_is_shared
to check if a vg uses an lvmlockd lock_type,
instead of the equivalent but longer is_lockd_type.
---
lib/cache/lvmetad.c | 6 +++---
lib/locking/lvmlockd.c | 12 ++++++------
lib/metadata/lv_manip.c | 2 +-
lib/metadata/metadata.c | 12 ++++++------
lib/metadata/mirror.c | 2 +-
lib/metadata/raid_manip.c | 2 +-
lib/metadata/vg.c | 2 +-
tools/lvconvert.c | 14 +++++++-------
tools/lvcreate.c | 4 ++--
tools/pvmove.c | 2 +-
tools/pvscan.c | 2 +-
tools/vgchange.c | 2 +-
tools/vgcreate.c | 2 +-
tools/vgexport.c | 2 +-
tools/vgimport.c | 2 +-
tools/vgmerge.c | 2 +-
tools/vgsplit.c | 2 +-
17 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index aa1edc9..fc46c07 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -1069,14 +1069,14 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna
* host.
*/
- if (is_lockd_type(vg->lock_type) && cmd->include_shared_vgs) {
+ if (vg_is_shared(vg) && cmd->include_shared_vgs) {
log_debug_lvmetad("Rescan VG %s because including shared", vgname);
rescan = 1;
- } else if (is_lockd_type(vg->lock_type) && cmd->lockd_vg_rescan) {
+ } else if (vg_is_shared(vg) && cmd->lockd_vg_rescan) {
log_debug_lvmetad("Rescan VG %s because no lvmlockd lock is held", vgname);
rescan = 1;
} else if (dm_config_find_node(reply.cft->root, "vg_invalid")) {
- if (!is_lockd_type(vg->lock_type)) {
+ if (!vg_is_shared(vg)) {
/* Can happen if a previous command failed/crashed without updating lvmetad. */
log_warn("WARNING: Reading VG %s from disk because lvmetad metadata is invalid.", vgname);
} else {
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index 8750c32..103286d 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -1020,7 +1020,7 @@ int lockd_start_vg(struct cmd_context *cmd, struct volume_group *vg, int start_i
memset(uuid, 0, sizeof(uuid));
- if (!is_lockd_type(vg->lock_type))
+ if (!vg_is_shared(vg))
return 1;
if (!_use_lvmlockd) {
@@ -1111,7 +1111,7 @@ int lockd_stop_vg(struct cmd_context *cmd, struct volume_group *vg)
int result;
int ret;
- if (!is_lockd_type(vg->lock_type))
+ if (!vg_is_shared(vg)))
return 1;
if (!_use_lvmlockd)
return 0;
@@ -1996,7 +1996,7 @@ int lockd_vg_update(struct volume_group *vg)
int result;
int ret;
- if (!is_lockd_type(vg->lock_type))
+ if (!vg_is_shared(vg))
return 1;
if (!_use_lvmlockd)
return 0;
@@ -2253,7 +2253,7 @@ static int _lockd_lv_mirror(struct cmd_context *cmd, struct logical_volume *lv,
int lockd_lv(struct cmd_context *cmd, struct logical_volume *lv,
const char *def_mode, uint32_t flags)
{
- if (!is_lockd_type(lv->vg->lock_type))
+ if (!vg_is_shared(lv->vg))
return 1;
if (!_use_lvmlockd) {
@@ -2586,7 +2586,7 @@ int lockd_rename_vg_before(struct cmd_context *cmd, struct volume_group *vg)
int result;
int ret;
- if (!is_lockd_type(vg->lock_type))
+ if (!vg_is_shared(vg))
return 1;
if (!_use_lvmlockd)
return 0;
@@ -2650,7 +2650,7 @@ int lockd_rename_vg_final(struct cmd_context *cmd, struct volume_group *vg, int
int result;
int ret;
- if (!is_lockd_type(vg->lock_type))
+ if (!vg_is_shared(vg))
return 1;
if (!_use_lvmlockd)
return 0;
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index c36f60f..b78e5d0 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7801,7 +7801,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
lv->status |= LV_TEMPORARY;
if (seg_is_cache(lp)) {
- if (is_lockd_type(lv->vg->lock_type)) {
+ if (vg_is_shared(vg)) {
if (is_change_activating(lp->activate)) {
if (!lv_active_change(cmd, lv, CHANGE_AEY, 0)) {
log_error("Aborting. Failed to activate LV %s.",
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 87b9616..6525cf9 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -2576,7 +2576,7 @@ int vg_validate(struct volume_group *vg)
goto out;
}
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg)) {
if (!vg->lock_args) {
log_error(INTERNAL_ERROR "VG %s with lock_type %s without lock_args",
vg->name, vg->lock_type);
@@ -2612,7 +2612,7 @@ int vg_validate(struct volume_group *vg)
}
dm_list_iterate_items(lvl, &vg->lvs) {
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg)) {
if (lockd_lv_uses_lock(lvl->lv)) {
if (vg->skip_validate_lock_args)
continue;
@@ -3556,7 +3556,7 @@ static int _repair_inconsistent_vg(struct volume_group *vg, uint32_t lockd_state
return 0;
}
- if (is_lockd_type(vg->lock_type) && !(lockd_state & LDST_EX)) {
+ if (vg_is_shared(vg) && !(lockd_state & LDST_EX)) {
log_verbose("Skip metadata repair for shared VG without exclusive lock.");
return 0;
}
@@ -3602,7 +3602,7 @@ static int _wipe_outdated_pvs(struct cmd_context *cmd, struct volume_group *vg,
return 0;
}
- if (is_lockd_type(vg->lock_type) && !(lockd_state & LDST_EX)) {
+ if (vg_is_shared(vg) && !(lockd_state & LDST_EX)) {
log_verbose("Skip wiping outdated PVs for shared VG without exclusive lock.");
return 0;
}
@@ -3684,7 +3684,7 @@ static int _check_or_repair_pv_ext(struct cmd_context *cmd,
"VG %s but not marked as used.",
pv_dev_name(pvl->pv), vg->name);
*inconsistent_pvs = 1;
- } else if (is_lockd_type(vg->lock_type) && !(lockd_state & LDST_EX)) {
+ } else if (vg_is_shared(vg) && !(lockd_state & LDST_EX)) {
log_warn("Skip repair of PV %s that is in shared "
"VG %s but not marked as used.",
pv_dev_name(pvl->pv), vg->name);
@@ -5260,7 +5260,7 @@ static int _access_vg_lock_type(struct cmd_context *cmd, struct volume_group *vg
/*
* Local VG requires no lock from lvmlockd.
*/
- if (!is_lockd_type(vg->lock_type))
+ if (!vg_is_shared(vg))
return 1;
/*
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index 1aa35fb..5b01873 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -426,7 +426,7 @@ static int _activate_lv_like_model(struct logical_volume *model,
{
/* FIXME: run all cases through lv_active_change when clvm variants are gone. */
- if (is_lockd_type(lv->vg->lock_type))
+ if (vg_is_shared(vg))
return lv_active_change(lv->vg->cmd, lv, CHANGE_AEY, 0);
if (lv_is_active_exclusive(model)) {
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index f53915b..9b4cb83 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -3426,7 +3426,7 @@ int lv_raid_split(struct logical_volume *lv, int yes, const char *split_name,
/* FIXME: run all cases through lv_active_change when clvm variants are gone. */
- if (is_lockd_type(lvl->lv->vg->lock_type)) {
+ if (vg_is_shared(lvl->lv->vg)) {
if (!lv_active_change(lv->vg->cmd, lvl->lv, CHANGE_AEY, 0))
return_0;
} else if (!activate_lv_excl_local(cmd, lvl->lv))
diff --git a/lib/metadata/vg.c b/lib/metadata/vg.c
index 71f6e14..b44c7ca 100644
--- a/lib/metadata/vg.c
+++ b/lib/metadata/vg.c
@@ -709,7 +709,7 @@ char *vg_attr_dup(struct dm_pool *mem, const struct volume_group *vg)
if (vg_is_clustered(vg))
repstr[5] = 'c';
- else if (is_lockd_type(vg->lock_type))
+ else if (vg_is_shared(vg))
repstr[5] = 's';
else
repstr[5] = '-';
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 1f7fd79..be4b1d0 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1802,7 +1802,7 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu
return 0;
}
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg)) {
/* FIXME: we need to create a lock for the new LV. */
log_error("Unable to split snapshots in VG with lock_type %s.", vg->lock_type);
return 0;
@@ -2622,7 +2622,7 @@ static int _lvconvert_to_thin_with_external(struct cmd_context *cmd,
*/
lvc.lv_name = origin_name;
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg)) {
/*
* FIXME: external origins don't work in lockd VGs.
* Prior to the lvconvert, there's a lock associated with
@@ -2936,7 +2936,7 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
zero_metadata = (to_cachepool) ? arg_int_value(cmd, zero_ARG, 1) : 1;
/* An existing LV needs to have its lock freed once it becomes a data LV. */
- if (is_lockd_type(vg->lock_type) && lv->lock_args) {
+ if (vg_is_shared(vg) && lv->lock_args) {
lockd_data_args = dm_pool_strdup(cmd->mem, lv->lock_args);
lockd_data_name = dm_pool_strdup(cmd->mem, lv->name);
memcpy(&lockd_data_id, &lv->lvid.id[1], sizeof(struct id));
@@ -2975,7 +2975,7 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
}
/* An existing LV needs to have its lock freed once it becomes a meta LV. */
- if (is_lockd_type(vg->lock_type) && metadata_lv->lock_args) {
+ if (vg_is_shared(vg) && metadata_lv->lock_args) {
lockd_meta_args = dm_pool_strdup(cmd->mem, metadata_lv->lock_args);
lockd_meta_name = dm_pool_strdup(cmd->mem, metadata_lv->name);
memcpy(&lockd_meta_id, &metadata_lv->lvid.id[1], sizeof(struct id));
@@ -3241,7 +3241,7 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
* Locks are removed from existing LVs that are being converted to
* data and meta LVs (they are unlocked and deleted below.)
*/
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg)) {
if (to_cachepool) {
data_lv->lock_args = NULL;
metadata_lv->lock_args = NULL;
@@ -3851,7 +3851,7 @@ static int _lvconvert_combine_split_snapshot_single(struct cmd_context *cmd,
{
const char *origin_name = cmd->position_argv[0];
- if (is_lockd_type(lv->vg->lock_type)) {
+ if (vg_is_shared(lv->vg)) {
log_error("Unable to combine split snapshots in VG with lock_type %s", lv->vg->lock_type);
return ECMD_FAILED;
}
@@ -4225,7 +4225,7 @@ static int _lvconvert_swap_pool_metadata_single(struct cmd_context *cmd,
struct logical_volume *metadata_lv;
const char *metadata_name;
- if (is_lockd_type(lv->vg->lock_type)) {
+ if (vg_is_shared(lv->vg)) {
/* FIXME: need to swap locks betwen LVs? */
log_error("Unable to swap pool metadata in VG with lock_type %s", lv->vg->lock_type);
goto out;
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 867cde1..5c9d448 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1231,7 +1231,7 @@ static int _determine_cache_argument(struct volume_group *vg,
display_lvname(lv));
return 1;
- } else if (is_lockd_type(vg->lock_type)) {
+ } else if (vg_is_shared(vg)) {
if (!lv_active_change(cmd, lv, CHANGE_AEY, 0)) {
log_error("Cannot activate cache origin %s.",
display_lvname(lv));
@@ -1645,7 +1645,7 @@ static int _lvcreate_single(struct cmd_context *cmd, const char *vg_name,
lp->snapshot ? " as snapshot of " : "",
lp->snapshot ? lp->origin_name : "", lp->segtype->name);
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg)) {
if (cmd->command->command_enum == lvcreate_thin_vol_with_thinpool_or_sparse_snapshot_CMD) {
log_error("Use lvconvert to create thin pools and cache pools in a shared VG.");
goto out;
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 2f7bf60..68194b8 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -642,7 +642,7 @@ static int _pvmove_setup_single(struct cmd_context *cmd,
* other hosts. For LVs that are active on multiple hosts (sh), we
* would need to used cluster mirrors.
*/
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg))) {
if (!lv) {
log_error("pvmove in a shared VG requires a named LV.");
return ECMD_FAILED;
diff --git a/tools/pvscan.c b/tools/pvscan.c
index e31c7f9..c7c2744 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -197,7 +197,7 @@ static int _pvscan_autoactivate_single(struct cmd_context *cmd, const char *vg_n
if (vg_is_exported(vg))
return ECMD_PROCESSED;
- if (is_lockd_type(vg->lock_type))
+ if (vg_is_shared(vg)))
return ECMD_PROCESSED;
log_debug("pvscan autoactivating VG %s.", vg_name);
diff --git a/tools/vgchange.c b/tools/vgchange.c
index e231c86..ee6c3b9 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -631,7 +631,7 @@ static int _vgchange_lock_start(struct cmd_context *cmd, struct volume_group *vg
int auto_opt = 0;
int r;
- if (!is_lockd_type(vg->lock_type))
+ if (!vg_is_shared(vg))
return 1;
if (arg_is_set(cmd, force_ARG))
diff --git a/tools/vgcreate.c b/tools/vgcreate.c
index e9f9073..52c4825 100644
--- a/tools/vgcreate.c
+++ b/tools/vgcreate.c
@@ -207,7 +207,7 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv)
* used after this command completes (otherwise, the VG can only be
* read without locks until the lockspace is done starting.)
*/
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg)) {
const char *start_opt = arg_str_value(cmd, lockopt_ARG, NULL);
if (!lockd_start_vg(cmd, vg, 1)) {
diff --git a/tools/vgexport.c b/tools/vgexport.c
index 76cf819..86dad3a 100644
--- a/tools/vgexport.c
+++ b/tools/vgexport.c
@@ -28,7 +28,7 @@ static int vgexport_single(struct cmd_context *cmd __attribute__((unused)),
goto bad;
}
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg)) {
struct lv_list *lvl;
dm_list_iterate_items(lvl, &vg->lvs) {
if (!lockd_lv_uses_lock(lvl->lv))
diff --git a/tools/vgimport.c b/tools/vgimport.c
index ea50198..8ef8709 100644
--- a/tools/vgimport.c
+++ b/tools/vgimport.c
@@ -38,7 +38,7 @@ static int _vgimport_single(struct cmd_context *cmd,
vg->status &= ~EXPORTED_VG;
- if (!is_lockd_type(vg->lock_type))
+ if (!vg_is_shared(vg))
vg->system_id = cmd->system_id ? dm_pool_strdup(vg->vgmem, cmd->system_id) : NULL;
dm_list_iterate_items(pvl, &vg->pvs) {
diff --git a/tools/vgmerge.c b/tools/vgmerge.c
index 67c3498..920ed73 100644
--- a/tools/vgmerge.c
+++ b/tools/vgmerge.c
@@ -26,7 +26,7 @@ static struct volume_group *_vgmerge_vg_read(struct cmd_context *cmd,
return NULL;
}
- if (is_lockd_type(vg->lock_type)) {
+ if (vg_is_shared(vg)) {
log_error("vgmerge not allowed for lock_type %s", vg->lock_type);
unlock_and_release_vg(cmd, vg, vg_name);
return NULL;
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index 2d39111..e30a671 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -517,7 +517,7 @@ static struct volume_group *_vgsplit_from(struct cmd_context *cmd,
return NULL;
}
- if (is_lockd_type(vg_from->lock_type)) {
+ if (vg_is_shared(vg_from)) {
log_error("vgsplit not allowed for lock_type %s", vg_from->lock_type);
unlock_and_release_vg(cmd, vg_from, vg_name_from);
return NULL;
5 years, 10 months