master - libdm: fix display of nsec suffixes in histogram strings
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=daa94eb792ee76...
Commit: daa94eb792ee76a507dcafe74c5ceda9707a370f
Parent: 5f990473e46b97e4642744798429c02f7ddc0763
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Mon Sep 7 20:11:28 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Mon Sep 7 20:14:53 2015 +0100
libdm: fix display of nsec suffixes in histogram strings
---
libdm/libdm-stats.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 4e5210d..f239f01 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -2148,6 +2148,7 @@ void dm_histogram_bounds_destroy(struct dm_histogram *bounds)
*/
static void _scale_bound_value_to_suffix(uint64_t *bound, const char **suffix)
{
+ *suffix = "ns";
if (!(*bound % NSEC_PER_SEC)) {
*bound /= NSEC_PER_SEC;
*suffix = "s";
8 years, 8 months
master - libdm: clean up _build_histogram_arg()
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5f990473e46b97...
Commit: 5f990473e46b97e4642744798429c02f7ddc0763
Parent: 4bc7a86f3aefbb1b805f94a17891c501b7de40b0
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Mon Sep 7 18:27:22 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Mon Sep 7 19:30:03 2015 +0100
libdm: clean up _build_histogram_arg()
Split up _build_histogram_arg() into separate functions to allocate
and fill the histogram arg string and remove nested local variable
declarations from the parent function.
---
libdm/libdm-stats.c | 85 +++++++++++++++++++++++++++++++++------------------
1 files changed, 55 insertions(+), 30 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index d20949a..4e5210d 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -194,8 +194,6 @@ static int _stats_region_present(const struct dm_stats_region *region)
static void _stats_histograms_destroy(struct dm_pool *mem,
struct dm_stats_region *region)
{
- uint64_t n;
-
/* Unpopulated handle. */
if (!region->counters)
return;
@@ -326,11 +324,54 @@ int dm_stats_driver_supports_histogram(void)
return _stats_check_precise_timestamps(NULL);
}
+static int _fill_hist_arg(char *hist_arg, size_t hist_len, uint64_t scale,
+ struct dm_histogram *bounds)
+{
+ int i, l, len = 0, nr_bins;
+ char *arg = hist_arg;
+ uint64_t value;
+
+ nr_bins = bounds->nr_bins;
+
+ for (i = 0; i < nr_bins; i++) {
+ value = bounds->bins[i].upper / scale;
+ if ((l = dm_snprintf(arg, hist_len - len, FMTu64"%s", value,
+ (i == (nr_bins - 1)) ? "" : ",")) < 0)
+ return_0;
+ len += l;
+ arg += l;
+ }
+ return 1;
+}
+
+static void *_get_hist_arg(struct dm_histogram *bounds, uint64_t scale,
+ size_t *len)
+{
+ struct dm_histogram_bin *entry, *bins;
+ size_t hist_len = 1; /* terminating '\0' */
+ double value;
+
+ entry = bins = bounds->bins;
+
+ entry += bounds->nr_bins - 1;
+ while(entry >= bins) {
+ value = (double) (entry--)->upper;
+ /* Use lround to avoid size_t -> double cast warning. */
+ hist_len += 1 + (size_t) lround(log10(value / scale));
+ if (entry != bins)
+ hist_len++; /* ',' */
+ }
+
+ *len = hist_len;
+
+ return dm_zalloc(hist_len);
+}
+
static char *_build_histogram_arg(struct dm_histogram *bounds, int *precise)
{
struct dm_histogram_bin *entry, *bins;
- size_t hist_len = 1, len = 0;
- char *hist_arg, *arg = NULL;
+ size_t hist_len;
+ char *hist_arg;
uint64_t scale;
entry = bins = bounds->bins;
@@ -341,53 +382,37 @@ static char *_build_histogram_arg(struct dm_histogram *bounds, int *precise)
return NULL;
}
+ /* Validate entries and set *precise if precision < 1ms. */
entry += bounds->nr_bins - 1;
- while(entry >= bins) {
- double value;
+ while (entry >= bins) {
if (entry != bins) {
if (entry->upper < (entry - 1)->upper) {
log_error("Histogram boundaries must be in "
"order of increasing magnitude.");
return 0;
}
- hist_len++; /* ',' */
}
/*
* Only enable precise_timestamps automatically if any
* value in the histogram bounds uses precision < 1ms.
*/
- if (!*precise && (entry->upper % NSEC_PER_MSEC))
+ if (((entry--)->upper % NSEC_PER_MSEC) && !*precise)
*precise = 1;
-
- value = (double) (entry--)->upper;
- /* Use lround to avoid size_t -> double cast warning. */
- hist_len += 1 + (size_t) lround(log10(value));
}
- if (!(hist_arg = dm_zalloc(hist_len))) {
+ scale = (*precise) ? 1 : NSEC_PER_MSEC;
+
+ /* Calculate hist_len and allocate a character buffer. */
+ if (!(hist_arg = _get_hist_arg(bounds, scale, &hist_len))) {
log_error("Could not allocate memory for histogram argument.");
return 0;
}
- arg = hist_arg;
-
- if (*precise)
- scale = 1;
- else
- scale = (*precise) ? 1 : NSEC_PER_MSEC;
+ /* Fill hist_arg with boundary strings. */
+ if (!_fill_hist_arg(hist_arg, hist_len, scale, bounds))
+ goto_bad;
- for (entry = bins; entry < (bins + bounds->nr_bins); entry++) {
- uint64_t value;
- ssize_t l = 0;
- int last = !(entry < (bins + bounds->nr_bins - 1));
- value = entry->upper / scale;
- if ((l = dm_snprintf(arg, hist_len - len, FMTu64"%s", value,
- (last) ? "" : ",")) < 0)
- goto_bad;
- len += (size_t) l;
- arg += (size_t) l;
- }
return hist_arg;
bad:
8 years, 8 months
master - libdm: only free the first histogram explicitly (Coverity)
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4bc7a86f3aefbb...
Commit: 4bc7a86f3aefbb1b805f94a17891c501b7de40b0
Parent: ffbf12504d24a25a66de53e11bfcbaac84c51ab5
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Mon Sep 7 17:53:56 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Mon Sep 7 17:53:56 2015 +0100
libdm: only free the first histogram explicitly (Coverity)
Coverity flags a user-after-free in _stats_histograms_destroy():
>>> Calling "dm_pool_free" frees pointer "mem->chunk" which has
>>> already been freed.
This should not be possible since the histograms are destroyed in
reverse order of allocation:
203 for (n = _nr_areas_region(region) - 1; n; n--)
204 if (region->counters[n].histogram)
205 dm_pool_free(mem, region->counters[n].histogram);
It appears that Coverity is unaware that pool->chunk is updated
during the call to dm_pool_free() and valgrind flags no errors in
this function when called with multiple allocated histograms.
Since there is no actual need to free the histograms individually
in this way simplify the code and just free the first allocated
object (which will also free all later allocated histograms in a
single call).
---
libdm/libdm-stats.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 20e3c9b..d20949a 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -200,9 +200,11 @@ static void _stats_histograms_destroy(struct dm_pool *mem,
if (!region->counters)
return;
- for (n = _nr_areas_region(region) - 1; n; n--)
- if (region->counters[n].histogram)
- dm_pool_free(mem, region->counters[n].histogram);
+ /*
+ * Only the first histogram needs to be freed explicitly.
+ */
+ if (region->counters[0].histogram)
+ dm_pool_free(mem, region->counters[0].histogram);
}
static void _stats_region_destroy(struct dm_stats_region *region)
8 years, 8 months
master - cleanup: assign seg_name once
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ffbf12504d24a2...
Commit: ffbf12504d24a25a66de53e11bfcbaac84c51ab5
Parent: 330cad15678116fadd33737d69d3bba3b926fc30
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Sep 4 09:42:45 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 7 17:44:08 2015 +0200
cleanup: assign seg_name once
---
lib/metadata/lv_manip.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 88c516b..832a190 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -251,16 +251,18 @@ static int _lv_layout_and_role_raid(struct dm_pool *mem,
if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_RAID]))
goto_bad;
- if (!strcmp(first_seg(lv)->segtype->name, SEG_TYPE_NAME_RAID1)) {
+ seg_name = first_seg(lv)->segtype->name;
+
+ if (!strcmp(seg_name, SEG_TYPE_NAME_RAID1)) {
if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_RAID1]))
goto_bad;
- } else if (!strcmp(first_seg(lv)->segtype->name, SEG_TYPE_NAME_RAID10)) {
+ } else if (!strcmp(seg_name, SEG_TYPE_NAME_RAID10)) {
if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_RAID10]))
goto_bad;
- } else if (!strcmp(first_seg(lv)->segtype->name, SEG_TYPE_NAME_RAID4)) {
+ } else if (!strcmp(seg_name, SEG_TYPE_NAME_RAID4)) {
if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_RAID4]))
goto_bad;
- } else if (!strncmp(seg_name = first_seg(lv)->segtype->name, SEG_TYPE_NAME_RAID5, strlen(SEG_TYPE_NAME_RAID5))) {
+ } else if (!strncmp(seg_name, SEG_TYPE_NAME_RAID5, strlen(SEG_TYPE_NAME_RAID5))) {
if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_RAID5]))
goto_bad;
@@ -277,7 +279,7 @@ static int _lv_layout_and_role_raid(struct dm_pool *mem,
if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_RAID5_RS]))
goto_bad;
}
- } else if (!strncmp(seg_name = first_seg(lv)->segtype->name, SEG_TYPE_NAME_RAID6, strlen(SEG_TYPE_NAME_RAID6))) {
+ } else if (!strncmp(seg_name, SEG_TYPE_NAME_RAID6, strlen(SEG_TYPE_NAME_RAID6))) {
if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_RAID6]))
goto_bad;
8 years, 8 months
master - specs: package lvmlockctl man page
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=330cad15678116...
Commit: 330cad15678116fadd33737d69d3bba3b926fc30
Parent: fa4d2ec24139ddc9e5ce69dde20155f308e09335
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 7 16:40:46 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 7 17:44:08 2015 +0200
specs: package lvmlockctl man page
---
spec/packages.inc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/spec/packages.inc b/spec/packages.inc
index fc68335..7e59068 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -105,6 +105,7 @@ fi
%{_mandir}/man8/lvmconf.8.gz
%{_mandir}/man8/lvmdiskscan.8.gz
%{_mandir}/man8/lvmdump.8.gz
+%{_mandir}/man8/lvmlockctl.8.gz
%{_mandir}/man8/lvmsadc.8.gz
%{_mandir}/man8/lvmsar.8.gz
%{_mandir}/man8/lvreduce.8.gz
8 years, 8 months
master - tests: update install rules
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fa4d2ec24139dd...
Commit: fa4d2ec24139ddc9e5ce69dde20155f308e09335
Parent: acfc56957c008d30c98ced5fae5f7888ec2a5a22
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Sep 4 16:34:34 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 7 17:44:08 2015 +0200
tests: update install rules
Enhnace 'make install' rules for test suite (used for rpm packaging).
Install lvmlockd conf files.
Compile runner with correct CXXFLAGS.
---
test/Makefile.in | 106 ++++++++++++++++++++++++++++++------------------------
1 files changed, 59 insertions(+), 47 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 2119509..e6860e1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -30,6 +30,7 @@ LVM_TEST_RESULTS ?= results
SUBDIRS = api unit
SOURCES = lib/not.c lib/harness.c
CXXSOURCES = lib/runner.cpp
+CXXFLAGS += $(EXTRA_EXEC_CFLAGS)
include $(top_builddir)/make.tmpl
@@ -171,41 +172,51 @@ DATADIR = $(datadir)/lvm2-testsuite
EXECDIR = $(libexecdir)/lvm2-testsuite
LIB_FLAVOURS = \
- lib/flavour-ndev-cluster-lvmpolld\
- lib/flavour-ndev-cluster\
- lib/flavour-ndev-lvmetad-lvmpolld\
- lib/flavour-ndev-lvmetad\
- lib/flavour-ndev-lvmpolld\
- lib/flavour-ndev-vanilla\
- lib/flavour-udev-cluster-lvmpolld\
- lib/flavour-udev-cluster\
- lib/flavour-udev-lvmetad-lvmpolld\
- lib/flavour-udev-lvmetad\
- lib/flavour-udev-lvmpolld\
- lib/flavour-udev-lvmlockd-sanlock\
- lib/flavour-udev-lvmlockd-dlm\
- lib/flavour-udev-vanilla
-
-LIB_LOCAL = lib/paths lib/runner
-LIB_EXEC = lib/not lib/invalid lib/fail lib/should
-LIB_SHARED = lib/check lib/aux lib/inittest lib/utils lib/get lib/lvm-wrapper
+ flavour-ndev-cluster-lvmpolld\
+ flavour-ndev-cluster\
+ flavour-ndev-lvmetad-lvmpolld\
+ flavour-ndev-lvmetad\
+ flavour-ndev-lvmpolld\
+ flavour-ndev-vanilla\
+ flavour-udev-cluster-lvmpolld\
+ flavour-udev-cluster\
+ flavour-udev-lvmetad-lvmpolld\
+ flavour-udev-lvmetad\
+ flavour-udev-lvmpolld\
+ flavour-udev-lvmlockd-sanlock\
+ flavour-udev-lvmlockd-dlm\
+ flavour-udev-vanilla
+
+LIB_LVMLOCKD_CONF = \
+ test-corosync-conf \
+ test-dlm-conf \
+ test-sanlock-conf
+
+LIB_LOCAL = paths runner
+LIB_NOT = not
+LIB_LINK_NOT = invalid fail should
+LIB_SHARED = check aux inittest utils get lvm-wrapper
install: .tests-stamp lib/paths-installed
@echo $(srcdir)
- @echo $(LIB_FLAVOURS)
- $(INSTALL_DIR) $(DATADIR)/{shell,api,lib}
- $(INSTALL_DATA) shell/*.sh $(DATADIR)/shell/
- $(INSTALL_DATA) api/*.sh $(DATADIR)/api/
- $(INSTALL_PROGRAM) api/*.{t,py} $(DATADIR)/api/
+ $(INSTALL_DIR) $(DATADIR)/{shell,api,lib} $(EXECDIR)
+ $(INSTALL_DATA) shell/*.sh $(DATADIR)/shell
+ $(INSTALL_DATA) api/*.sh $(DATADIR)/api
+ $(INSTALL_PROGRAM) api/*.{t,py} $(DATADIR)/api
$(INSTALL_DATA) lib/paths-installed $(DATADIR)/lib/paths
- $(INSTALL_DATA) $(LIB_FLAVOURS) $(DATADIR)/lib/
- for i in cache-mq cache-smq thin-performance ; do \
- $(INSTALL_DATA) $(abs_top_srcdir)/conf/$$i.profile $(DATADIR)/lib/$$i.profile; done
- $(INSTALL_SCRIPT) $(LIB_SHARED) $(DATADIR)/lib/
- for i in $(CMDS); do (cd $(DATADIR)/lib && $(LN_S) -f lvm-wrapper $$i); done
-
- $(INSTALL_DIR) $(EXECDIR)
- $(INSTALL_PROGRAM) $(LIB_EXEC) $(EXECDIR)
+ cd lib && $(INSTALL_DATA) $(LIB_FLAVOURS) $(DATADIR)/lib
+ cd lib && $(INSTALL_DATA) $(LIB_LVMLOCKD_CONF) $(DATADIR)/lib
+ @for i in cache-mq cache-smq thin-performance ; do \
+ echo "$(INSTALL_DATA) $(abs_top_srcdir)/conf/$$i.profile $(DATADIR)/lib"; \
+ $(INSTALL_DATA) $(abs_top_srcdir)/conf/$$i.profile $(DATADIR)/lib; done
+ cd lib && $(INSTALL_SCRIPT) $(LIB_SHARED) $(DATADIR)/lib
+ @cd $(DATADIR)/lib && for i in $(CMDS); do \
+ echo "$(LN_S) -f lvm-wrapper $$i"; \
+ $(LN_S) -f lvm-wrapper $$i; done
+ $(INSTALL_PROGRAM) lib/$(LIB_NOT) $(EXECDIR)
+ @cd $(EXECDIR) && for i in $(LIB_LINK_NOT); do \
+ echo "$(LN_S) -f not $$i"; \
+ $(LN_S) -f not $$i; done
$(INSTALL_PROGRAM) -D lib/runner $(bindir)/lvm2-testsuite
lib/should: lib/not
@@ -218,10 +229,12 @@ lib/fail: lib/not
$(LN_S) -f not lib/fail
lib/runner: lib/runner.o .lib-dir-stamp
- $(CXX) $(LDFLAGS) -o $@ $<
+ $(CXX) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) -o $@ $<
lib/runner.o: $(wildcard $(srcdir)/lib/*.h)
+CFLAGS_runner.o += $(EXTRA_EXEC_CFLAGS)
+
lib/%: lib/%.o .lib-dir-stamp
$(CC) $(LDFLAGS) -o $@ $<
@@ -269,7 +282,7 @@ lib/paths: lib/paths-common
mv $@-t $@
CMDS = lvm $(shell cat $(top_builddir)/tools/.commands)
-LIB = $(LIB_SHARED) $(LIB_LOCAL) $(LIB_EXEC) $(LIB_FLAVOURS)
+LIB = $(addprefix lib/, $(LIB_SHARED) $(LIB_LOCAL) $(LIB_NOT) $(LIB_LINK_NOT) $(LIB_FLAVOURS))
.tests-stamp: $(ALL) $(LIB) $(SUBDIRS)
@if test "$(srcdir)" != . ; then \
@@ -285,27 +298,26 @@ LIB = $(LIB_SHARED) $(LIB_LOCAL) $(LIB_EXEC) $(LIB_FLAVOURS)
.lib-dir-stamp:
$(MKDIR_P) lib
for i in $(CMDS); do $(LN_S) -f lvm-wrapper lib/$$i; done
- $(LN_S) -f $(abs_top_builddir)/tools/dmsetup lib/dmsetup
- $(LN_S) -f $(abs_top_builddir)/daemons/clvmd/clvmd lib/clvmd
- $(LN_S) -f $(abs_top_builddir)/daemons/dmeventd/dmeventd lib/dmeventd
- $(LN_S) -f $(abs_top_builddir)/daemons/lvmetad/lvmetad lib/lvmetad
- $(LN_S) -f $(abs_top_builddir)/daemons/lvmpolld/lvmpolld lib/lvmpolld
- $(LN_S) -f $(abs_top_srcdir)/scripts/vgimportclone.sh lib/vgimportclone
+ for i in daemons/clvmd/clvmd daemons/dmeventd/dmeventd \
+ tools/dmsetup daemons/lvmetad/lvmetad \
+ daemons/lvmpolld/lvmpolld ; do \
+ $(LN_S) -f $(abs_top_builddir)/$$i lib/; done
+ $(LN_S) -f $(abs_top_srcdir)/conf/thin-performance.profile lib/
$(LN_S) -f $(abs_top_srcdir)/scripts/fsadm.sh lib/fsadm
- $(LN_S) -f $(abs_top_srcdir)/conf/thin-performance.profile lib/thin-performance.profile
+ $(LN_S) -f $(abs_top_srcdir)/scripts/vgimportclone.sh lib/vgimportclone
+ test "$(srcdir)" = . || for i in $(LIB_LVMLOCKD_CONF); do \
+ $(LN_S) -f $(abs_top_srcdir)/test/lib/$$i lib/; done
touch $@
CLEAN_DIRS += $(LVM_TEST_RESULTS)
ifneq (.,$(firstword $(srcdir)))
-CLEAN_TARGETS += $(RUN_BASE)
+CLEAN_TARGETS += $(RUN_BASE) $(addprefix lib/,$(LIB_LVMLOCKD_CONF))
endif
-CLEAN_TARGETS += .lib-dir-stamp .tests-stamp $(LIB) $(addprefix lib/,$(CMDS)) \
- lib/clvmd lib/dmeventd lib/dmsetup lib/lvmetad lib/fsadm lib/vgimportclone \
- lib/thin-performance.profile lib/harness \
- lib/paths-installed lib/paths-installed-t \
- lib/paths-common lib/paths-common-t \
- lib/lvmpolld
+CLEAN_TARGETS += .lib-dir-stamp .tests-stamp $(LIB) $(addprefix lib/,\
+ $(CMDS) clvmd dmeventd dmsetup lvmetad lvmpolld \
+ harness thin-performance.profile fsadm vgimportclone \
+ paths-installed paths-installed-t paths-common paths-common-t)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
8 years, 8 months
master - makefiles: do not generate tags for everyone
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=acfc56957c008d...
Commit: acfc56957c008d30c98ced5fae5f7888ec2a5a22
Parent: 3ba431e79e4914dfaf3cc74aeb52b46757acc8df
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 7 13:44:14 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 7 17:44:04 2015 +0200
makefiles: do not generate tags for everyone
Create tags file only on request (make tags).
Also clean file with 'make clean'.
---
Makefile.in | 5 ++---
WHATS_NEW | 1 +
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 1ce9ca8..d9ac815 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -229,10 +229,9 @@ endif
ifneq ($(shell which ctags),)
.PHONY: tags
-all: tags
tags:
- test -z "$(shell find $(top_srcdir) -type f -name '*.[ch]' -newer tags | head -1)" || $(RM) tags
+ test -z "$(shell find $(top_srcdir) -type f -name '*.[ch]' -newer tags 2>/dev/null | head -1)" || $(RM) tags
test -f tags || find $(top_srcdir) -maxdepth 4 -type f -name '*.[ch]' -exec ctags -a '{}' +
-DISTCLEAN_TARGETS += tags
+CLEAN_TARGETS += tags
endif
diff --git a/WHATS_NEW b/WHATS_NEW
index 1ce1c81..c9dec02 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.131 -
=====================================
+ Make tags only when requested via 'make tags'.
Configure supports --disable-dependency-tracking for one-time builds.
Fix usage of configure.h when building in srcdir != builddir.
8 years, 8 months
master - makefiles: deps depends on header links
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3ba431e79e4914...
Commit: 3ba431e79e4914dfaf3cc74aeb52b46757acc8df
Parent: d62448cb456170bab17b2af24e11df964666e1c6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 7 14:00:27 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 7 17:43:27 2015 +0200
makefiles: deps depends on header links
Put include/.symlinks_created as a prerequisite for dep calc.
Otherwise if these are not generated and user enters tests subdir and
runs 'make' he just gets endless loop of dep calculation.
---
make.tmpl.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/make.tmpl.in b/make.tmpl.in
index 3fd3410..7124144 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -448,7 +448,7 @@ $(LIB_STATIC): $(OBJECTS)
$(RM) $@
$(AR) rs $@ $(OBJECTS)
-%.d: %.c
+%.d: %.c $(INC_LNS)
$(MKDIR_P) $(dir $@); \
set -e; \
FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
8 years, 8 months
master - configure: regenerate
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d62448cb456170...
Commit: d62448cb456170bab17b2af24e11df964666e1c6
Parent: 1999e368f16cf7537c553be573809713213fdacd
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 7 14:02:25 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 7 17:43:27 2015 +0200
configure: regenerate
---
configure | 34 +++++++++++++++++++++++++---------
1 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/configure b/configure
index c7b7dd5..ea44878 100755
--- a/configure
+++ b/configure
@@ -643,6 +643,7 @@ LVMETAD_PIDFILE
DMEVENTD_PIDFILE
WRITE_INSTALL
VALGRIND_POOL
+USE_TRACKING
UDEV_HAS_BUILTIN_BLKID
UDEV_RULE_EXEC_DETECTION
UDEV_SYSTEMD_BACKGROUND_JOBS
@@ -693,7 +694,6 @@ BLKDEACTIVATE
FSADM
ELDFLAGS
DM_LIB_PATCHLEVEL
-DM_LIB_VERSION
DMEVENTD_PATH
DMEVENTD
DL_LIBS
@@ -876,6 +876,7 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_dependency_tracking
enable_static_link
with_user
with_group
@@ -1634,6 +1635,8 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking
+ speeds up one-time build.
--enable-static_link use this to link the tools to their libraries
statically (default is dynamic linking
--enable-lvm1_fallback use this to fall back and use LVM1 binaries if
@@ -2966,7 +2969,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-ac_config_headers="$ac_config_headers lib/misc/configure.h"
+ac_config_headers="$ac_config_headers conf/configure.h"
################################################################################
@@ -7633,6 +7636,19 @@ done
################################################################################
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to disable dependency tracking" >&5
+$as_echo_n "checking whether to disable dependency tracking... " >&6; }
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking; USE_TRACKING=$enableval
+else
+ USE_TRACKING=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_TRACKING" >&5
+$as_echo "$USE_TRACKING" >&6; }
+
+################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use static linking" >&5
$as_echo_n "checking whether to use static linking... " >&6; }
# Check whether --enable-static_link was given.
@@ -14026,18 +14042,18 @@ test "$interface" != ioctl && as_fn_error $? "--with-interface=ioctl required. f
$as_echo "$interface" >&6; }
################################################################################
-DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\""
+read DM_LIB_VERSION < "$srcdir"/VERSION_DM 2>/dev/null || DM_LIB_VERSION=Unknown
cat >>confdefs.h <<_ACEOF
-#define DM_LIB_VERSION $DM_LIB_VERSION
+#define DM_LIB_VERSION "$DM_LIB_VERSION"
_ACEOF
DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[-. ]' '{printf "%s.%s.%s",$1,$2,$3}'`
-LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\""
+read VER < "$srcdir"/VERSION 2>/dev/null || VER=Unknown
-VER=`cat "$srcdir"/VERSION`
+LVM_VERSION=\"$VER\"
LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
VER=`echo "$VER" | $AWK '{print $1}'`
LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
@@ -14196,7 +14212,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
################################################################################
-ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile lib/cache_segtype/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdev
mapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan
_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
+ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile conf/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile lib/cache_segtype/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapp
er.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_sys
temd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -14890,7 +14906,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
- "lib/misc/configure.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/misc/configure.h" ;;
+ "conf/configure.h") CONFIG_HEADERS="$CONFIG_HEADERS conf/configure.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"make.tmpl") CONFIG_FILES="$CONFIG_FILES make.tmpl" ;;
"daemons/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/Makefile" ;;
@@ -14920,7 +14936,7 @@ do
"lib/locking/Makefile") CONFIG_FILES="$CONFIG_FILES lib/locking/Makefile" ;;
"lib/mirror/Makefile") CONFIG_FILES="$CONFIG_FILES lib/mirror/Makefile" ;;
"lib/replicator/Makefile") CONFIG_FILES="$CONFIG_FILES lib/replicator/Makefile" ;;
- "lib/misc/lvm-version.h") CONFIG_FILES="$CONFIG_FILES lib/misc/lvm-version.h" ;;
+ "conf/lvm-version.h") CONFIG_FILES="$CONFIG_FILES conf/lvm-version.h" ;;
"lib/raid/Makefile") CONFIG_FILES="$CONFIG_FILES lib/raid/Makefile" ;;
"lib/snapshot/Makefile") CONFIG_FILES="$CONFIG_FILES lib/snapshot/Makefile" ;;
"lib/thin/Makefile") CONFIG_FILES="$CONFIG_FILES lib/thin/Makefile" ;;
8 years, 8 months
master - configure: simpler version reading
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1999e368f16cf7...
Commit: 1999e368f16cf7537c553be573809713213fdacd
Parent: fc4f0d3fce05a601e768dbfb315b0c7e6d6c0030
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 7 13:58:54 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 7 17:43:27 2015 +0200
configure: simpler version reading
Avoid calling 'cat' when 'read' could handle it.
Also drop DM_LIB_VERSION from AC_SUBST as it's not used anywhere
in .in file.
---
configure.in | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/configure.in b/configure.in
index 4843678..31f4b3a 100644
--- a/configure.in
+++ b/configure.in
@@ -1888,14 +1888,14 @@ test "$interface" != ioctl && AC_MSG_ERROR([--with-interface=ioctl required. fs
AC_MSG_RESULT($interface)
################################################################################
-DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\""
-AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
+read DM_LIB_VERSION < "$srcdir"/VERSION_DM 2>/dev/null || DM_LIB_VERSION=Unknown
+AC_DEFINE_UNQUOTED(DM_LIB_VERSION, "$DM_LIB_VERSION", [Library version])
DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
-LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\""
+read VER < "$srcdir"/VERSION 2>/dev/null || VER=Unknown
-VER=`cat "$srcdir"/VERSION`
+LVM_VERSION=\"$VER\"
LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
VER=`echo "$VER" | $AWK '{print $1}'`
LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
@@ -1963,7 +1963,6 @@ AC_SUBST(DLM_LIBS)
AC_SUBST(DL_LIBS)
AC_SUBST(DMEVENTD)
AC_SUBST(DMEVENTD_PATH)
-AC_SUBST(DM_LIB_VERSION)
AC_SUBST(DM_LIB_PATCHLEVEL)
AC_SUBST(ELDFLAGS)
AC_SUBST(FSADM)
8 years, 8 months