From agk@sourceware.org Sat Nov 1 01:43:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Sat, 01 Nov 2008 01:43:00 -0000 Subject: LVM2 configure.in Message-ID: <20081101014331.27162.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-01 01:43:31 Modified files: . : configure.in Log message: export DM_LIB_VERSION Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.84&r2=1.85 --- LVM2/configure.in 2008/10/31 22:32:09 1.84 +++ LVM2/configure.in 2008/11/01 01:43:31 1.85 @@ -701,6 +701,8 @@ ################################################################################ DM_LIB_VERSION="\"`cat VERSION_LIB 2>/dev/null || echo Unknown`\"" +AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version]) + LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\"" ################################################################################ From agk@sourceware.org Sat Nov 1 02:19:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Sat, 01 Nov 2008 02:19:00 -0000 Subject: LVM2 ./Makefile.in ./configure.in ./make.tmpl. ... Message-ID: <20081101021922.13806.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-01 02:19:19 Modified files: . : Makefile.in configure.in make.tmpl.in include : Makefile.in lib/misc : configure.h.in lib.h libdm : Makefile.in libdm-common.c libdm-deptree.c libdm/ioctl : libdm-compat.h libdm-iface.c man : Makefile.in po : Makefile.in scripts : Makefile.in tools : Makefile.in Log message: further progress Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.85&r2=1.86 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/make.tmpl.in.diff?cvsroot=lvm2&r1=1.58&r2=1.59 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/include/Makefile.in.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/configure.h.in.diff?cvsroot=lvm2&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lib.h.diff?cvsroot=lvm2&r1=1.14&r2=1.15 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/Makefile.in.diff?cvsroot=lvm2&r1=1.38&r2=1.39 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-compat.h.diff?cvsroot=lvm2&r1=1.10&r2=1.11 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/Makefile.in.diff?cvsroot=lvm2&r1=1.23&r2=1.24 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/po/Makefile.in.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/Makefile.in.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/Makefile.in.diff?cvsroot=lvm2&r1=1.85&r2=1.86 --- LVM2/Makefile.in 2008/10/31 22:29:44 1.24 +++ LVM2/Makefile.in 2008/11/01 02:19:17 1.25 @@ -22,7 +22,7 @@ SUBDIRS += po endif -SUBDIRS += lib tools daemons +SUBDIRS += lib tools daemons libdm ifeq ($(MAKECMDGOALS),distclean) SUBDIRS += daemons/clvmd \ @@ -40,11 +40,14 @@ include make.tmpl +libdm: include +lib: libdm daemons: lib -lib: include tools: lib po: tools daemons +tools.device-mapper: libdm.device-mapper + ifeq ("@INTL@", "yes") lib.pofile: include.pofile tools.pofile: lib.pofile --- LVM2/configure.in 2008/11/01 01:43:31 1.85 +++ LVM2/configure.in 2008/11/01 02:19:17 1.86 @@ -160,6 +160,24 @@ fi ################################################################################ +dnl -- Setup device node ownership +AC_MSG_CHECKING(device node uid) + +AC_ARG_WITH(device-uid, + [ --with-device-uid=UID Set the owner used for new device nodes [[UID=0]] ], + [ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] ) +AC_MSG_RESULT($DM_DEVICE_UID) + +################################################################################ +dnl -- Setup device group ownership +AC_MSG_CHECKING(device node gid) + +AC_ARG_WITH(device-gid, + [ --with-device-gid=UID Set the group used for new device nodes [[GID=0]] ], + [ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] ) +AC_MSG_RESULT($DM_DEVICE_GID) + +################################################################################ dnl -- Setup device mode AC_MSG_CHECKING(device node mode) --- LVM2/make.tmpl.in 2008/10/31 22:33:55 1.58 +++ LVM2/make.tmpl.in 2008/11/01 02:19:17 1.59 @@ -109,12 +109,15 @@ OBJECTS = $(SOURCES:%.c=%.o) POTFILES = $(SOURCES:%.c=%.pot) -.PHONY: all install install_cluster pofile distclean clean cflow +.PHONY: all install install_cluster pofile distclean clean cflow device-mapper .PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean) .PHONY: $(SUBDIRS.pofile) $(SUBDIRS.install_cluster) $(SUBDIRS.cflow) +.PHONY: $(SUBDIRS.device-mapper) $(SUBDIRS.install-device-mapper) +SUBDIRS.device-mapper := $(SUBDIRS:=.device-mapper) SUBDIRS.install := $(SUBDIRS:=.install) SUBDIRS.install_cluster := $(SUBDIRS:=.install_cluster) +SUBDIRS.install_device-mapper := $(SUBDIRS:=.install_device-mapper) SUBDIRS.pofile := $(SUBDIRS:=.pofile) SUBDIRS.cflow := $(SUBDIRS:=.cflow) SUBDIRS.clean := $(SUBDIRS:=.clean) @@ -124,18 +127,27 @@ all: $(SUBDIRS) $(TARGETS) +device-mapper: $(SUBDIRS.device-mapper) + install: all $(SUBDIRS.install) install_cluster: all $(SUBDIRS.install_cluster) +install_device-mapper: $(SUBDIRS.install_device-mapper) $(SUBDIRS): $(MAKE) -C $@ +$(SUBDIRS.device-mapper): + $(MAKE) -C $(@:.device-mapper=) device-mapper + $(SUBDIRS.install): $(SUBDIRS) $(MAKE) -C $(@:.install=) install $(SUBDIRS.install_cluster): $(SUBDIRS) $(MAKE) -C $(@:.install_cluster=) install_cluster +$(SUBDIRS.install_device-mapper): $(SUBDIRS) + $(MAKE) -C $(@:.install_device-mapper=) install_device-mapper + $(SUBDIRS.clean): -$(MAKE) -C $(@:.clean=) clean --- LVM2/include/Makefile.in 2007/09/21 10:16:43 1.8 +++ LVM2/include/Makefile.in 2008/11/01 02:19:17 1.9 @@ -35,6 +35,8 @@ pofile: all +device-mapper: all + clean: install: --- LVM2/lib/misc/configure.h.in 2008/10/31 22:12:56 1.7 +++ LVM2/lib/misc/configure.h.in 2008/11/01 02:19:17 1.8 @@ -26,6 +26,9 @@ /* Path to dmeventd pidfile. */ #undef DMEVENTD_PIDFILE +/* Library version */ +#undef DM_LIB_VERSION + /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA --- LVM2/lib/misc/lib.h 2008/10/30 17:27:27 1.14 +++ LVM2/lib/misc/lib.h 2008/11/01 02:19:17 1.15 @@ -26,11 +26,17 @@ #define _FILE_OFFSET_BITS 64 #include "intl.h" +#include "libdevmapper.h" #include "lvm-logging.h" #include "lvm-types.h" #include "lvm-wrappers.h" #include "util.h" -#include +#include +#include +#include +#include +#include +#include #endif --- LVM2/libdm/Makefile.in 2008/06/06 20:44:35 1.38 +++ LVM2/libdm/Makefile.in 2008/11/01 02:19:18 1.39 @@ -32,7 +32,7 @@ regex/ttree.c \ $(interface)/libdm-iface.c -INCLUDES = -I$(interface) +INCLUDES = -I$(interface) -I. LIB_STATIC = $(interface)/libdevmapper.a @@ -48,6 +48,8 @@ include ../make.tmpl +device-mapper: all + .PHONY: install_dynamic install_static install_include \ install_ioctl install_ioctl_static \ install_pkgconfig --- LVM2/libdm/libdm-common.c 2008/06/06 20:44:35 1.59 +++ LVM2/libdm/libdm-common.c 2008/11/01 02:19:18 1.60 @@ -18,14 +18,13 @@ #include "libdm-common.h" #include "list.h" #include "kdev_t.h" +#include "dm-ioctl.h" #include #include #include #include -#include - #ifdef linux # include #endif --- LVM2/libdm/libdm-deptree.c 2008/09/18 22:55:33 1.43 +++ LVM2/libdm/libdm-deptree.c 2008/11/01 02:19:18 1.44 @@ -17,12 +17,11 @@ #include "libdm-common.h" #include "list.h" #include "kdev_t.h" +#include "dm-ioctl.h" #include #include -#include - #define MAX_TARGET_PARAMSIZE 500000 /* FIXME Fix interface so this is used only by LVM */ --- LVM2/libdm/ioctl/libdm-compat.h 2007/08/21 16:26:07 1.10 +++ LVM2/libdm/ioctl/libdm-compat.h 2008/11/01 02:19:18 1.11 @@ -17,8 +17,8 @@ #define _LINUX_LIBDM_COMPAT_H #include "kdev_t.h" +#include "dm-ioctl.h" #include -#include #include struct dm_task; --- LVM2/libdm/ioctl/libdm-iface.c 2008/09/18 18:34:53 1.52 +++ LVM2/libdm/ioctl/libdm-iface.c 2008/11/01 02:19:18 1.53 @@ -35,7 +35,7 @@ # define MKDEV(x,y) makedev((x),(y)) #endif -#include +#include "dm-ioctl.h" /* * Ensure build compatibility. --- LVM2/man/Makefile.in 2008/10/08 12:50:13 1.23 +++ LVM2/man/Makefile.in 2008/11/01 02:19:18 1.24 @@ -35,7 +35,7 @@ MAN5DIR=${mandir}/man5 MAN8DIR=${mandir}/man8 -CLEAN_TARGETS=$(MAN5) $(MAN8) $(MAN8CLUSTER) $(FSADMMAN) +CLEAN_TARGETS=$(MAN5) $(MAN8) $(MAN8CLUSTER) $(FSADMMAN) dmsetup.8 include $(top_srcdir)/make.tmpl @@ -47,6 +47,8 @@ .PHONY: man +device-mapper: dmsetup.8 + man: $(MAN5) $(MAN8) $(MAN8CLUSTER) $(MAN5) $(MAN8) $(MAN8CLUSTER): Makefile --- LVM2/po/Makefile.in 2007/09/21 10:16:45 1.5 +++ LVM2/po/Makefile.in 2008/11/01 02:19:18 1.6 @@ -17,22 +17,16 @@ LANGS=de -TARGETS=$(LANGS:%=%.mo) +TARGETS=$(LANGS:%=lvm2_%.mo) $(LANGS:%=dm_%.mo) -include $(top_srcdir)/make.tmpl +DM_POSOURCES = $(top_srcdir)/dmsetup/*.pot $(top_srcdir)/libdm/*.pot \ + $(top_srcdir)/libdm/*/*.pot -install: $(TARGETS) - @echo Installing translation files in $(localedir) - @( \ - for lang in $(LANGS); do \ - $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $$lang.mo \ - $(localedir)/$$lang/LC_MESSAGES/@INTL_PACKAGE@.mo;\ - done; \ - ) +LVM_POSOURCES = $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot -pofile: lvm2.po +include $(top_srcdir)/make.tmpl -lvm2.po: Makefile $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot +lvm2.po: Makefile $(LVM_POSOURCES) @echo Compiling string table @xgettext -C -F --keyword=print_log --keyword=log_debug \ --keyword=log_info --keyword=_ --keyword=N_ \ @@ -40,6 +34,32 @@ --keyword=log_fatal --keyword=log_debug --keyword=log_error \ --keyword=log_print --keyword=log_verbose \ --keyword=log_very_verbose -d - \ - $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot \ - > $@ + $(LVM_POSOURCES) > $@ +device-mapper.po: Makefile $(DM_POSOURCES) + @echo Compiling string table + @xgettext -C -F --keyword=dm_log --keyword=log_debug \ + --keyword=log_info --keyword=_ --keyword=N_ \ + --keyword=log_notice --keyword=log_warn --keyword=log_err \ + --keyword=log_fatal --keyword=log_debug --keyword=log_error \ + --keyword=log_print --keyword=log_verbose \ + --keyword=log_very_verbose -d - \ + $(DM_POSOURCES) > $@ + +pofile: lvm2.po device-mapper.po + +# FIXME +install: $(TARGETS) + @echo Installing translation files in $(localedir) + @( \ + for lang in $(LANGS); do \ + $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $$lang.mo \ + $(localedir)/$$lang/LC_MESSAGES/lvm2.mo;\ + done; \ + ) + @( \ + for lang in $(LANGS); do \ + $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $$lang.mo \ + $(localedir)/$$lang/LC_MESSAGES/device-mapper.mo;\ + done; \ + ) --- LVM2/scripts/Makefile.in 2007/12/17 12:23:24 1.3 +++ LVM2/scripts/Makefile.in 2008/11/01 02:19:18 1.4 @@ -20,6 +20,7 @@ install: $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) lvm_dump.sh \ $(sbindir)/lvmdump +ifeq ("@FSADM@", "yes") $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) fsadm.sh \ $(sbindir)/fsadm - +endif --- LVM2/tools/Makefile.in 2008/05/19 20:06:34 1.85 +++ LVM2/tools/Makefile.in 2008/11/01 02:19:19 1.86 @@ -97,6 +97,19 @@ include $(top_srcdir)/make.tmpl +device-mapper: dmsetup + +dmsetup: dmsetup.o $(interfacedir)/libdevmapper.$(LIB_SUFFIX) + $(CC) -o $@ dmsetup.o $(CFLAGS) $(LDFLAGS) \ + -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS) + +dmsetup.static: dmsetup.o $(interfacedir)/libdevmapper.a + $(CC) -o $@ dmsetup.o $(CFLAGS) $(LDFLAGS) -static \ + -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS) \ + $(LIB_PTHREAD) + +all: device-mapper + lvm: $(OBJECTS) lvm.o $(top_srcdir)/lib/liblvm.a $(CC) -o $@ $(CFLAGS) $(OBJECTS) lvm.o \ $(LDFLAGS) $(LVMLIBS) $(LIBS) -rdynamic From agk@sourceware.org Sat Nov 1 02:20:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Sat, 01 Nov 2008 02:20:00 -0000 Subject: LVM2 configure Message-ID: <20081101022008.16760.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-01 02:20:07 Modified files: . : configure Log message: autoreconf Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.81&r2=1.82 --- LVM2/configure 2008/10/31 22:34:42 1.81 +++ LVM2/configure 2008/11/01 02:20:06 1.82 @@ -1346,6 +1346,8 @@ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-user=USER Set the owner of installed files [USER=root] --with-group=GROUP Set the group owner of installed files [GROUP=root] + --with-device-uid=UID Set the owner used for new device nodes [UID=0] + --with-device-gid=UID Set the group used for new device nodes [GID=0] --with-device-mode=MODE Set the mode used for new device nodes [MODE=0600] --with-lvm1=TYPE LVM1 metadata support: internal/shared/none TYPE=internal @@ -8433,6 +8435,36 @@ fi ################################################################################ +{ echo "$as_me:$LINENO: checking device node uid" >&5 +echo $ECHO_N "checking device node uid... $ECHO_C" >&6; } + + +# Check whether --with-device-uid was given. +if test "${with_device_uid+set}" = set; then + withval=$with_device_uid; DM_DEVICE_UID="$withval" +else + DM_DEVICE_UID="0" +fi + +{ echo "$as_me:$LINENO: result: $DM_DEVICE_UID" >&5 +echo "${ECHO_T}$DM_DEVICE_UID" >&6; } + +################################################################################ +{ echo "$as_me:$LINENO: checking device node gid" >&5 +echo $ECHO_N "checking device node gid... $ECHO_C" >&6; } + + +# Check whether --with-device-gid was given. +if test "${with_device_gid+set}" = set; then + withval=$with_device_gid; DM_DEVICE_GID="$withval" +else + DM_DEVICE_GID="0" +fi + +{ echo "$as_me:$LINENO: result: $DM_DEVICE_GID" >&5 +echo "${ECHO_T}$DM_DEVICE_GID" >&6; } + +################################################################################ { echo "$as_me:$LINENO: checking device node mode" >&5 echo $ECHO_N "checking device node mode... $ECHO_C" >&6; } @@ -11766,6 +11798,12 @@ ################################################################################ DM_LIB_VERSION="\"`cat VERSION_LIB 2>/dev/null || echo Unknown`\"" + +cat >>confdefs.h <<_ACEOF +#define DM_LIB_VERSION $DM_LIB_VERSION +_ACEOF + + LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\"" ################################################################################ From agk@sourceware.org Sat Nov 1 20:48:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Sat, 01 Nov 2008 20:48:00 -0000 Subject: LVM2 configure Message-ID: <20081101204851.20656.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-01 20:48:51 Modified files: . : configure Log message: autoreconf Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.82&r2=1.83 --- LVM2/configure 2008/11/01 02:20:06 1.82 +++ LVM2/configure 2008/11/01 20:48:50 1.83 @@ -708,6 +708,7 @@ DM_DEVICE_UID DM_IOCTLS DM_LIB_VERSION +DM_LIB_PATCHLEVEL FSADM GROUP HAVE_LIBDL @@ -11804,6 +11805,8 @@ _ACEOF +DM_LIB_PATCHLEVEL=`cat VERSION_LIB | awk -F '[-. ]' '{printf "%s.%s.%s",$1,$2,$3}'` + LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\"" ################################################################################ @@ -11860,6 +11863,7 @@ + ################################################################################ ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc man/Makefile po/Makefile scripts/Makefile test/Makefile tools/Makefile tools/version.h" @@ -12598,9 +12602,9 @@ DM_DEVICE_UID!$DM_DEVICE_UID$ac_delim DM_IOCTLS!$DM_IOCTLS$ac_delim DM_LIB_VERSION!$DM_LIB_VERSION$ac_delim +DM_LIB_PATCHLEVEL!$DM_LIB_PATCHLEVEL$ac_delim FSADM!$FSADM$ac_delim GROUP!$GROUP$ac_delim -HAVE_LIBDL!$HAVE_LIBDL$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -12642,6 +12646,7 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +HAVE_LIBDL!$HAVE_LIBDL$ac_delim HAVE_REALTIME!$HAVE_REALTIME$ac_delim HAVE_SELINUX!$HAVE_SELINUX$ac_delim INTL!$INTL$ac_delim @@ -12672,7 +12677,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 29; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 From agk@sourceware.org Sat Nov 1 20:48:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Sat, 01 Nov 2008 20:48:00 -0000 Subject: LVM2 ./WHATS_NEW ./configure.in libdm/libdevma ... Message-ID: <20081101204810.13955.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-01 20:48:09 Modified files: . : WHATS_NEW configure.in libdm : libdevmapper.pc.in Log message: Use simple x.y.z library version in libdevmapper.pc Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.987&r2=1.988 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.86&r2=1.87 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.pc.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/WHATS_NEW 2008/10/31 12:25:54 1.987 +++ LVM2/WHATS_NEW 2008/11/01 20:48:09 1.988 @@ -1,8 +1,9 @@ Version 2.02.43 - =================================== + Use simplified x.y.z version number in libdevmapper.pc. + Merge device-mapper into the lvm2 tree. Remove ancient debian directory. Split out lvm-logging.h from log.h and lvm-globals.[ch] from log.[ch]. - Add libdm subdirectory for libdevmapper files. Version 2.02.42 - 26th October 2008 =================================== --- LVM2/configure.in 2008/11/01 02:19:17 1.86 +++ LVM2/configure.in 2008/11/01 20:48:09 1.87 @@ -721,6 +721,8 @@ DM_LIB_VERSION="\"`cat VERSION_LIB 2>/dev/null || echo Unknown`\"" AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version]) +DM_LIB_PATCHLEVEL=`cat VERSION_LIB | awk -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'` + LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\"" ################################################################################ @@ -744,6 +746,7 @@ AC_SUBST(DM_DEVICE_UID) AC_SUBST(DM_IOCTLS) AC_SUBST(DM_LIB_VERSION) +AC_SUBST(DM_LIB_PATCHLEVEL) AC_SUBST(FSADM) AC_SUBST(GROUP) AC_SUBST(HAVE_LIBDL) --- LVM2/libdm/libdevmapper.pc.in 2006/04/19 15:23:10 1.1 +++ LVM2/libdm/libdevmapper.pc.in 2008/11/01 20:48:09 1.2 @@ -5,7 +5,7 @@ Name: devmapper Description: device-mapper library -Version: @DM_LIB_VERSION@ +Version: @DM_LIB_PATCHLEVEL@ Cflags: -I${includedir} Libs: -L${libdir} -ldevmapper Libs.private: -lselinux -lsepol From agk@sourceware.org Mon Nov 3 16:26:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 03 Nov 2008 16:26:00 -0000 Subject: LVM2 ./WHATS_NEW lib/format1/disk-rep.c Message-ID: <20081103162628.8163.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-03 16:26:27 Modified files: . : WHATS_NEW lib/format1 : disk-rep.c Log message: Rename a couple of variables that matched function names. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.988&r2=1.989 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77 --- LVM2/WHATS_NEW 2008/11/01 20:48:09 1.988 +++ LVM2/WHATS_NEW 2008/11/03 16:26:26 1.989 @@ -1,5 +1,6 @@ Version 2.02.43 - =================================== + Rename a couple of variables that matched function names. Use simplified x.y.z version number in libdevmapper.pc. Merge device-mapper into the lvm2 tree. Remove ancient debian directory. --- LVM2/lib/format1/disk-rep.c 2008/09/19 07:03:23 1.76 +++ LVM2/lib/format1/disk-rep.c 2008/11/03 16:26:27 1.77 @@ -277,12 +277,12 @@ static int _read_lvs(struct disk_list *data) { - unsigned int i, read = 0; + unsigned int i, lvs_read = 0; uint64_t pos; struct lvd_list *ll; struct vg_disk *vgd = &data->vgd; - for (i = 0; (i < vgd->lv_max) && (read < vgd->lv_cur); i++) { + for (i = 0; (i < vgd->lv_max) && (lvs_read < vgd->lv_cur); i++) { pos = data->pvd.lv_on_disk.base + (i * sizeof(struct lv_disk)); ll = dm_pool_alloc(data->mem, sizeof(*ll)); @@ -295,7 +295,7 @@ if (!_check_lvd(&ll->lvd)) continue; - read++; + lvs_read++; list_add(&data->lvds, &ll->list); } From agk@sourceware.org Mon Nov 3 18:56:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 03 Nov 2008 18:56:00 -0000 Subject: CVSROOT cvsignore Message-ID: <20081103185640.20585.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: CVSROOT Changes by: agk@sourceware.org 2008-11-03 18:56:40 Modified files: . : cvsignore Log message: more exclusions Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/CVSROOT/cvsignore.diff?cvsroot=lvm2&r1=1.6&r2=1.7 --- CVSROOT/cvsignore 2005/10/28 12:47:49 1.6 +++ CVSROOT/cvsignore 2008/11/03 18:56:39 1.7 @@ -1,9 +1,13 @@ +*.5 +*.8 *.d +*.pc *.pot .gdb_history autom4te.cache config.log config.status +cscope.out Makefile make.tmpl version.h From agk@sourceware.org Mon Nov 3 18:58:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 03 Nov 2008 18:58:00 -0000 Subject: CVSROOT cvsignore Message-ID: <20081103185803.625.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: CVSROOT Changes by: agk@sourceware.org 2008-11-03 18:58:03 Modified files: . : cvsignore Log message: . Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/CVSROOT/cvsignore.diff?cvsroot=lvm2&r1=1.7&r2=1.8 --- CVSROOT/cvsignore 2008/11/03 18:56:39 1.7 +++ CVSROOT/cvsignore 2008/11/03 18:58:03 1.8 @@ -7,6 +7,7 @@ autom4te.cache config.log config.status +configure.h cscope.out Makefile make.tmpl From agk@sourceware.org Mon Nov 3 19:00:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 03 Nov 2008 19:00:00 -0000 Subject: LVM2 ./WHATS_NEW include/.symlinks lib/Makefil ... Message-ID: <20081103190004.19431.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-03 18:59:59 Modified files: . : WHATS_NEW include : .symlinks lib : Makefile.in lib/display : display.c lib/log : lvm-logging.h lib/misc : lib.h lvm-globals.h libdm : Makefile.in libdm-common.c libdm-deptree.c libdm-file.c libdm-report.c libdm-string.c libdm/datastruct: bitset.c hash.c libdm/ioctl : libdm-iface.c libdm/mm : dbg_malloc.c pool-debug.c pool-fast.c pool.c libdm/regex : matcher.c parse_rx.c ttree.c Added files: libdm/misc : dmlib.h Log message: more tweaking to get things to compile - dmlib.h for log fns, list.h Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.989&r2=1.990 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/include/.symlinks.diff?cvsroot=lvm2&r1=1.52&r2=1.53 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/Makefile.in.diff?cvsroot=lvm2&r1=1.86&r2=1.87 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/log/lvm-logging.h.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lib.h.diff?cvsroot=lvm2&r1=1.15&r2=1.16 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-globals.h.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/Makefile.in.diff?cvsroot=lvm2&r1=1.39&r2=1.40 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-file.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-report.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-string.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/datastruct/bitset.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/datastruct/hash.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/misc/dmlib.h.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/dbg_malloc.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/pool-debug.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/pool-fast.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/pool.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/matcher.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/parse_rx.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/ttree.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3 --- LVM2/WHATS_NEW 2008/11/03 16:26:26 1.989 +++ LVM2/WHATS_NEW 2008/11/03 18:59:58 1.990 @@ -1,5 +1,6 @@ Version 2.02.43 - =================================== + Move list.c into libdevmapper and rename functions. Rename a couple of variables that matched function names. Use simplified x.y.z version number in libdevmapper.pc. Merge device-mapper into the lvm2 tree. --- LVM2/include/.symlinks 2008/10/31 22:41:51 1.52 +++ LVM2/include/.symlinks 2008/11/03 18:59:58 1.53 @@ -8,7 +8,6 @@ ../lib/config/config.h ../lib/config/defaults.h ../lib/datastruct/btree.h -../lib/datastruct/list.h ../lib/datastruct/lvm-types.h ../lib/datastruct/str_list.h ../lib/device/dev-cache.h @@ -52,8 +51,10 @@ ../lib/report/report.h ../lib/uuid/uuid.h ../libdm/libdevmapper.h +../libdm/datastruct/list.h ../libdm/misc/dm-ioctl.h ../libdm/misc/dm-logging.h +../libdm/misc/dmlib.h ../libdm/misc/kdev_t.h ../po/pogen.h ../tools/version.h --- LVM2/lib/Makefile.in 2008/10/30 17:27:28 1.86 +++ LVM2/lib/Makefile.in 2008/11/03 18:59:58 1.87 @@ -38,7 +38,6 @@ commands/toolcontext.c \ config/config.c \ datastruct/btree.c \ - datastruct/list.c \ datastruct/str_list.c \ device/dev-cache.c \ device/dev-io.c \ --- LVM2/lib/display/display.c 2008/09/19 06:41:58 1.92 +++ LVM2/lib/display/display.c 2008/11/03 18:59:58 1.93 @@ -572,7 +572,7 @@ void vgdisplay_full(const struct volume_group *vg) { - uint32_t access; + uint32_t access_str; uint32_t active_pvs; uint32_t lv_count = 0; struct lv_list *lvl; @@ -589,12 +589,12 @@ list_size(&vg->fid->metadata_areas)); log_print("Metadata Sequence No %d", vg->seqno); } - access = vg->status & (LVM_READ | LVM_WRITE); + access_str = vg->status & (LVM_READ | LVM_WRITE); log_print("VG Access %s%s%s%s", - access == (LVM_READ | LVM_WRITE) ? "read/write" : "", - access == LVM_READ ? "read" : "", - access == LVM_WRITE ? "write" : "", - access == 0 ? "error" : ""); + access_str == (LVM_READ | LVM_WRITE) ? "read/write" : "", + access_str == LVM_READ ? "read" : "", + access_str == LVM_WRITE ? "write" : "", + access_str == 0 ? "error" : ""); log_print("VG Status %s%sresizable", vg->status & EXPORTED_VG ? "exported/" : "", vg->status & RESIZEABLE_VG ? "" : "NOT "); @@ -658,7 +658,7 @@ uint32_t active_pvs; uint32_t lv_count; struct lv_list *lvl; - const char *access; + const char *access_str; char uuid[64] __attribute((aligned(8))); active_pvs = vg->pv_count - vg_missing_pv_count(vg); @@ -669,16 +669,16 @@ switch (vg->status & (LVM_READ | LVM_WRITE)) { case LVM_READ | LVM_WRITE: - access = "r/w"; + access_str = "r/w"; break; case LVM_READ: - access = "r"; + access_str = "r"; break; case LVM_WRITE: - access = "w"; + access_str = "w"; break; default: - access = ""; + access_str = ""; } if (!id_write_format(&vg->id, uuid, sizeof(uuid))) { @@ -689,7 +689,7 @@ log_print("%s:%s:%d:-1:%u:%u:%u:-1:%u:%u:%u:%" PRIu64 ":%" PRIu32 ":%u:%u:%u:%s", vg->name, - access, + access_str, vg->status, /* internal volume group number; obsolete */ vg->max_lv, --- LVM2/lib/log/lvm-logging.h 2008/10/30 17:27:27 1.1 +++ LVM2/lib/log/lvm-logging.h 2008/11/03 18:59:58 1.2 @@ -16,8 +16,6 @@ #ifndef _LVM_LOGGING_H #define _LVM_LOGGING_H -#include "lvm-globals.h" - void print_log(int level, const char *file, int line, const char *format, ...) __attribute__ ((format(printf, 4, 5))); --- LVM2/lib/misc/lib.h 2008/11/01 02:19:17 1.15 +++ LVM2/lib/misc/lib.h 2008/11/03 18:59:58 1.16 @@ -27,11 +27,17 @@ #include "intl.h" #include "libdevmapper.h" -#include "lvm-logging.h" -#include "lvm-types.h" +#include "lvm-globals.h" #include "lvm-wrappers.h" +#include "lvm-types.h" #include "util.h" +#ifdef DM +# include "dm-logging.h" +#else +# include "lvm-logging.h" +#endif + #include #include #include --- LVM2/lib/misc/lvm-globals.h 2008/10/30 17:40:00 1.1 +++ LVM2/lib/misc/lvm-globals.h 2008/11/03 18:59:58 1.2 @@ -35,7 +35,7 @@ void init_mirror_in_sync(int in_sync); void init_dmeventd_monitor(int reg); void init_ignore_suspended_devices(int ignore); -void init_error_message_produced(int error_message_produced); +void init_error_message_produced(int produced); void set_cmd_name(const char *cmd_name); --- LVM2/libdm/Makefile.in 2008/11/01 02:19:18 1.39 +++ LVM2/libdm/Makefile.in 2008/11/03 18:59:59 1.40 @@ -20,6 +20,7 @@ SOURCES =\ datastruct/bitset.c \ datastruct/hash.c \ + datastruct/list.c \ libdm-common.c \ libdm-file.c \ libdm-deptree.c \ --- LVM2/libdm/libdm-common.c 2008/11/01 02:19:18 1.60 +++ LVM2/libdm/libdm-common.c 2008/11/03 18:59:59 1.61 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include "libdm-targets.h" #include "libdm-common.h" #include "list.h" --- LVM2/libdm/libdm-deptree.c 2008/11/01 02:19:18 1.44 +++ LVM2/libdm/libdm-deptree.c 2008/11/03 18:59:59 1.45 @@ -12,7 +12,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include "libdm-targets.h" #include "libdm-common.h" #include "list.h" --- LVM2/libdm/libdm-file.c 2007/08/21 16:26:06 1.9 +++ LVM2/libdm/libdm-file.c 2008/11/03 18:59:59 1.10 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include #include --- LVM2/libdm/libdm-report.c 2008/10/30 17:24:04 1.24 +++ LVM2/libdm/libdm-report.c 2008/11/03 18:59:59 1.25 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include --- LVM2/libdm/libdm-string.c 2007/08/21 16:26:06 1.9 +++ LVM2/libdm/libdm-string.c 2008/11/03 18:59:59 1.10 @@ -12,7 +12,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include "libdevmapper.h" #include --- LVM2/libdm/datastruct/bitset.c 2007/08/21 16:26:06 1.4 +++ LVM2/libdm/datastruct/bitset.c 2008/11/03 18:59:59 1.5 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" /* FIXME: calculate this. */ #define INT_SHIFT 5 --- LVM2/libdm/datastruct/hash.c 2008/05/21 16:14:45 1.8 +++ LVM2/libdm/datastruct/hash.c 2008/11/03 18:59:59 1.9 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" struct dm_hash_node { struct dm_hash_node *next; --- LVM2/libdm/ioctl/libdm-iface.c 2008/11/01 02:19:18 1.53 +++ LVM2/libdm/ioctl/libdm-iface.c 2008/11/03 18:59:59 1.54 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include "libdm-targets.h" #include "libdm-common.h" /cvs/lvm2/LVM2/libdm/misc/dmlib.h,v --> standard output revision 1.1 --- LVM2/libdm/misc/dmlib.h +++ - 2008-11-03 19:00:02.251494000 +0000 @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. + * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. + * + * This file is part of LVM2. + * + * This copyrighted material is made available to anyone wishing to use, + * modify, copy, or redistribute it subject to the terms and conditions + * of the GNU Lesser General Public License v.2.1. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * This file must be included first by every device-mapper library source file. + */ +#ifndef _DM_LIB_H +#define _DM_LIB_H + +#define DM + +#include "lib.h" + +#endif --- LVM2/libdm/mm/dbg_malloc.c 2008/06/25 14:10:33 1.12 +++ LVM2/libdm/mm/dbg_malloc.c 2008/11/03 18:59:59 1.13 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include #include --- LVM2/libdm/mm/pool-debug.c 2008/04/19 15:50:18 1.4 +++ LVM2/libdm/mm/pool-debug.c 2008/11/03 18:59:59 1.5 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" struct block { struct block *next; --- LVM2/libdm/mm/pool-fast.c 2008/04/19 15:50:18 1.5 +++ LVM2/libdm/mm/pool-fast.c 2008/11/03 18:59:59 1.6 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" struct chunk { char *begin, *end; --- LVM2/libdm/mm/pool.c 2007/08/21 16:26:07 1.3 +++ LVM2/libdm/mm/pool.c 2008/11/03 18:59:59 1.4 @@ -13,6 +13,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "dmlib.h" + #ifdef DEBUG_POOL #include "pool-debug.c" #else --- LVM2/libdm/regex/matcher.c 2007/08/21 16:26:07 1.2 +++ LVM2/libdm/regex/matcher.c 2008/11/03 18:59:59 1.3 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include "parse_rx.h" #include "ttree.h" #include "assert.h" --- LVM2/libdm/regex/parse_rx.c 2007/08/21 16:26:07 1.2 +++ LVM2/libdm/regex/parse_rx.c 2008/11/03 18:59:59 1.3 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include "parse_rx.h" struct parse_sp { /* scratch pad for the parsing process */ --- LVM2/libdm/regex/ttree.c 2007/08/21 16:26:07 1.2 +++ LVM2/libdm/regex/ttree.c 2008/11/03 18:59:59 1.3 @@ -13,7 +13,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include "ttree.h" struct node { From agk@sourceware.org Mon Nov 3 20:03:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 03 Nov 2008 20:03:00 -0000 Subject: LVM2/libdm .exported_symbols Message-ID: <20081103200301.23961.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-03 20:03:01 Modified files: libdm : .exported_symbols Log message: add list fns Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/.exported_symbols.diff?cvsroot=lvm2&r1=1.33&r2=1.34 --- LVM2/libdm/.exported_symbols 2008/04/20 00:11:08 1.33 +++ LVM2/libdm/.exported_symbols 2008/11/03 20:03:00 1.34 @@ -135,3 +135,16 @@ dm_report_set_output_field_name_prefix dm_regex_create dm_regex_match +dm_list_init +dm_list_add +dm_list_add_h +dm_list_del +dm_list_move +dm_list_empty +dm_list_start +dm_list_end +dm_list_first +dm_list_last +dm_list_prev +dm_list_next +dm_list_size From agk@sourceware.org Mon Nov 3 22:14:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 03 Nov 2008 22:14:00 -0000 Subject: LVM2 ./Makefile.in ./configure ./configure.in ... Message-ID: <20081103221442.20407.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-03 22:14:30 Modified files: . : Makefile.in configure configure.in make.tmpl.in daemons/clvmd : clvmd.c daemons/dmeventd: dmeventd.c daemons/dmeventd/plugins/mirror: Makefile.in daemons/dmeventd/plugins/snapshot: Makefile.in lib/activate : activate.c activate.h dev_manager.c fs.c lib/cache : lvmcache.c lvmcache.h lib/commands : toolcontext.c toolcontext.h lib/config : config.c config.h lib/datastruct : list.c list.h lvm-types.h str_list.c str_list.h lib/device : dev-cache.c dev-io.c device.h lib/display : display.c lib/error : errseg.c lib/filters : filter-persistent.c filter-regex.c lib/format1 : Makefile.in disk-rep.c disk-rep.h format1.c import-export.c import-extents.c lvm1-label.c vg_number.c lib/format_pool: Makefile.in disk_rep.c disk_rep.h format_pool.c import_export.c lib/format_text: archive.c archiver.c export.c format-text.c format-text.h import-export.h import_vsn1.c layout.h tags.c text_label.c lib/label : label.c lib/locking : Makefile.in file_locking.c locking.c locking.h lib/metadata : lv_alloc.h lv_manip.c merge.c metadata-exported.h metadata.c metadata.h mirror.c pv_alloc.h pv_manip.c pv_map.c pv_map.h segtype.c segtype.h snapshot_manip.c lib/mirror : Makefile.in mirrored.c lib/report : report.c lib/snapshot : Makefile.in snapshot.c lib/zero : zero.c libdm : Makefile.in libdm-common.c libdm-deptree.c libdm-report.c libdm/datastruct: list.c list.h tools : Makefile.in lvconvert.c lvcreate.c lvmcmdline.c lvresize.c lvscan.c polldaemon.c polldaemon.h pvchange.c pvcreate.c pvmove.c pvremove.c pvresize.c pvscan.c reporter.c toollib.c toollib.h vgchange.c vgconvert.c vgexport.c vgimport.c vgmerge.c vgreduce.c vgrename.c vgsplit.c Log message: Right, a simple build (without options) is working again. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.25&r2=1.26 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.83&r2=1.84 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.87&r2=1.88 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/make.tmpl.in.diff?cvsroot=lvm2&r1=1.59&r2=1.60 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.48&r2=1.49 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/dmeventd.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/mirror/Makefile.in.diff?cvsroot=lvm2&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/snapshot/Makefile.in.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.139&r2=1.140 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.61&r2=1.62 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.141&r2=1.142 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.h.diff?cvsroot=lvm2&r1=1.23&r2=1.24 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.63&r2=1.64 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.h.diff?cvsroot=lvm2&r1=1.26&r2=1.27 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.c.diff?cvsroot=lvm2&r1=1.71&r2=1.72 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.h.diff?cvsroot=lvm2&r1=1.25&r2=1.26 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/list.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/list.h.diff?cvsroot=lvm2&r1=1.27&r2=1.28 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/lvm-types.h.diff?cvsroot=lvm2&r1=1.14&r2=1.15 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/str_list.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/str_list.h.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.h.diff?cvsroot=lvm2&r1=1.36&r2=1.37 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.93&r2=1.94 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-persistent.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-regex.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/Makefile.in.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.77&r2=1.78 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.h.diff?cvsroot=lvm2&r1=1.52&r2=1.53 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.108&r2=1.109 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.99&r2=1.100 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-extents.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/lvm1-label.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/vg_number.c.diff?cvsroot=lvm2&r1=1.15&r2=1.16 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/Makefile.in.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.h.diff?cvsroot=lvm2&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/format_pool.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/import_export.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.64&r2=1.65 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.97&r2=1.98 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.h.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import-export.h.diff?cvsroot=lvm2&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/layout.h.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/tags.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/text_label.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/label/label.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/Makefile.in.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.42&r2=1.43 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_alloc.h.diff?cvsroot=lvm2&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.158&r2=1.159 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.54&r2=1.55 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.194&r2=1.195 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.183&r2=1.184 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.78&r2=1.79 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_alloc.h.diff?cvsroot=lvm2&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.h.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/snapshot_manip.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/Makefile.in.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.88&r2=1.89 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/Makefile.in.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/Makefile.in.diff?cvsroot=lvm2&r1=1.40&r2=1.41 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.45&r2=1.46 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-report.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/datastruct/list.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/datastruct/list.h.diff?cvsroot=lvm2&r1=1.27&r2=1.28 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/Makefile.in.diff?cvsroot=lvm2&r1=1.86&r2=1.87 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.66&r2=1.67 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.177&r2=1.178 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.71&r2=1.72 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.98&r2=1.99 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvscan.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/polldaemon.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/polldaemon.h.diff?cvsroot=lvm2&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvcreate.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvremove.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvresize.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvscan.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.40&r2=1.41 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.136&r2=1.137 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.h.diff?cvsroot=lvm2&r1=1.57&r2=1.58 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.65&r2=1.66 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgconvert.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgexport.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgimport.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgmerge.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.84&r2=1.85 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgrename.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.67&r2=1.68 --- LVM2/Makefile.in 2008/11/01 02:19:17 1.25 +++ LVM2/Makefile.in 2008/11/03 22:14:26 1.26 @@ -46,7 +46,9 @@ tools: lib po: tools daemons +libdm.device-mapper: include.device-mapper tools.device-mapper: libdm.device-mapper +device-mapper: tools.device-mapper ifeq ("@INTL@", "yes") lib.pofile: include.pofile --- LVM2/configure 2008/11/01 20:48:50 1.83 +++ LVM2/configure 2008/11/03 22:14:26 1.84 @@ -11798,14 +11798,14 @@ echo "${ECHO_T}$interface" >&6; } ################################################################################ -DM_LIB_VERSION="\"`cat VERSION_LIB 2>/dev/null || echo Unknown`\"" +DM_LIB_VERSION="\"`cat VERSION_DM 2>/dev/null || echo Unknown`\"" cat >>confdefs.h <<_ACEOF #define DM_LIB_VERSION $DM_LIB_VERSION _ACEOF -DM_LIB_PATCHLEVEL=`cat VERSION_LIB | awk -F '[-. ]' '{printf "%s.%s.%s",$1,$2,$3}'` +DM_LIB_PATCHLEVEL=`cat VERSION_DM | awk -F '[-. ]' '{printf "%s.%s.%s",$1,$2,$3}'` LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\"" --- LVM2/configure.in 2008/11/01 20:48:09 1.87 +++ LVM2/configure.in 2008/11/03 22:14:26 1.88 @@ -718,10 +718,10 @@ AC_MSG_RESULT($interface) ################################################################################ -DM_LIB_VERSION="\"`cat VERSION_LIB 2>/dev/null || echo Unknown`\"" +DM_LIB_VERSION="\"`cat VERSION_DM 2>/dev/null || echo Unknown`\"" AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version]) -DM_LIB_PATCHLEVEL=`cat VERSION_LIB | awk -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'` +DM_LIB_PATCHLEVEL=`cat VERSION_DM | awk -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'` LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\"" --- LVM2/make.tmpl.in 2008/11/01 02:19:17 1.59 +++ LVM2/make.tmpl.in 2008/11/03 22:14:26 1.60 @@ -51,6 +51,9 @@ localedir = $(DESTDIR)@LOCALEDIR@ staticdir = $(DESTDIR)@STATICDIR@ +interface = @interface@ +interfacedir = $(top_srcdir)/libdm/$(interface) + # setup misc variables # define the ownership variables for the binaries and man pages OWNER = @OWNER@ @@ -80,7 +83,8 @@ DEFS += -DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\" endif -LDFLAGS += -L$(top_srcdir)/lib -L$(libdir) +LDFLAGS += -L$(top_srcdir)/libdm -L$(top_srcdir)/lib +CLDFLAGS += -L$(top_srcdir)/libdm -L$(top_srcdir)/lib #DEFS += -DDEBUG_POOL #DEFS += -DBOUNDS_CHECK @@ -93,8 +97,11 @@ LVM_VERSION := $(shell cat $(top_srcdir)/VERSION) -LIB_VERSION := $(shell cat $(top_srcdir)/VERSION | \ - awk -F '.' '{printf "%s.%s",$$1,$$2}') +LIB_VERSION_LVM := $(shell cat $(top_srcdir)/VERSION | \ + awk -F '.' '{printf "%s.%s",$$1,$$2}') + +LIB_VERSION_DM := $(shell cat $(top_srcdir)/VERSION_DM | \ + awk -F '.' '{printf "%s.%s",$$1,$$2}') INCLUDES += -I$(top_srcdir)/include @@ -123,12 +130,10 @@ SUBDIRS.clean := $(SUBDIRS:=.clean) SUBDIRS.distclean := $(SUBDIRS:=.distclean) -TARGETS += $(LIB_SHARED) $(LIB_STATIC) +TARGETS += $(LIB_SHARED) $(LIB_STATIC) $(VERSIONED_SHLIB) all: $(SUBDIRS) $(TARGETS) -device-mapper: $(SUBDIRS.device-mapper) - install: all $(SUBDIRS.install) install_cluster: all $(SUBDIRS.install_cluster) install_device-mapper: $(SUBDIRS.install_device-mapper) --- LVM2/daemons/clvmd/clvmd.c 2008/06/13 07:44:14 1.48 +++ LVM2/daemons/clvmd/clvmd.c 2008/11/03 22:14:26 1.49 @@ -75,7 +75,7 @@ /* Structure of items on the LVM thread list */ struct lvm_thread_cmd { - struct list list; + struct dm_list list; struct local_client *client; struct clvm_header *msg; @@ -90,7 +90,7 @@ static pthread_mutex_t lvm_thread_mutex; static pthread_cond_t lvm_thread_cond; static pthread_mutex_t lvm_start_mutex; -static struct list lvm_cmd_head; +static struct dm_list lvm_cmd_head; static volatile sig_atomic_t quit = 0; static volatile sig_atomic_t reread_config = 0; static int child_pipe[2]; @@ -352,7 +352,7 @@ sigprocmask(SIG_BLOCK, &ss, NULL); /* Initialise the LVM thread variables */ - list_init(&lvm_cmd_head); + dm_list_init(&lvm_cmd_head); pthread_mutex_init(&lvm_thread_mutex, NULL); pthread_cond_init(&lvm_thread_cond, NULL); pthread_mutex_init(&lvm_start_mutex, NULL); @@ -1749,7 +1749,7 @@ */ static __attribute__ ((noreturn)) void *lvm_thread_fn(void *arg) { - struct list *cmdl, *tmp; + struct dm_list *cmdl, *tmp; sigset_t ss; int using_gulm = (int)(long)arg; @@ -1775,15 +1775,15 @@ DEBUGLOG("LVM thread waiting for work\n"); pthread_mutex_lock(&lvm_thread_mutex); - if (list_empty(&lvm_cmd_head)) + if (dm_list_empty(&lvm_cmd_head)) pthread_cond_wait(&lvm_thread_cond, &lvm_thread_mutex); - list_iterate_safe(cmdl, tmp, &lvm_cmd_head) { + dm_list_iterate_safe(cmdl, tmp, &lvm_cmd_head) { struct lvm_thread_cmd *cmd; cmd = - list_struct_base(cmdl, struct lvm_thread_cmd, list); - list_del(&cmd->list); + dm_list_struct_base(cmdl, struct lvm_thread_cmd, list); + dm_list_del(&cmd->list); pthread_mutex_unlock(&lvm_thread_mutex); process_work_item(cmd); @@ -1833,7 +1833,7 @@ ("add_to_lvmqueue: cmd=%p. client=%p, msg=%p, len=%d, csid=%p, xid=%d\n", cmd, client, msg, msglen, csid, cmd->xid); pthread_mutex_lock(&lvm_thread_mutex); - list_add(&lvm_cmd_head, &cmd->list); + dm_list_add(&lvm_cmd_head, &cmd->list); pthread_cond_signal(&lvm_thread_cond); pthread_mutex_unlock(&lvm_thread_mutex); --- LVM2/daemons/dmeventd/dmeventd.c 2008/07/09 13:26:07 1.51 +++ LVM2/daemons/dmeventd/dmeventd.c 2008/11/03 22:14:26 1.52 @@ -58,11 +58,11 @@ static int _debug = 0; /* List (un)link macros. */ -#define LINK(x, head) list_add(head, &(x)->list) +#define LINK(x, head) dm_list_add(head, &(x)->list) #define LINK_DSO(dso) LINK(dso, &_dso_registry) #define LINK_THREAD(thread) LINK(thread, &_thread_registry) -#define UNLINK(x) list_del(&(x)->list) +#define UNLINK(x) dm_list_del(&(x)->list) #define UNLINK_DSO(x) UNLINK(x) #define UNLINK_THREAD(x) UNLINK(x) @@ -101,7 +101,7 @@ /* Data kept about a DSO. */ struct dso_data { - struct list list; + struct dm_list list; char *dso_name; /* DSO name (eg, "evms", "dmraid", "lvm2"). */ @@ -143,7 +143,7 @@ int (*unregister_device)(const char *device, const char *uuid, int major, int minor, void **user); }; -static LIST_INIT(_dso_registry); +static DM_LIST_INIT(_dso_registry); /* Structure to keep parsed register variables from client message. */ struct message_data { @@ -168,7 +168,7 @@ * occurs and the event processing function of the DSO gets called. */ struct thread_status { - struct list list; + struct dm_list list; pthread_t thread; @@ -189,14 +189,14 @@ struct dm_task *current_task; time_t next_time; uint32_t timeout; - struct list timeout_list; + struct dm_list timeout_list; void *dso_private; /* dso per-thread status variable */ }; -static LIST_INIT(_thread_registry); -static LIST_INIT(_thread_registry_unused); +static DM_LIST_INIT(_thread_registry); +static DM_LIST_INIT(_thread_registry_unused); static int _timeout_running; -static LIST_INIT(_timeout_registry); +static DM_LIST_INIT(_timeout_registry); static pthread_mutex_t _timeout_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t _timeout_cond = PTHREAD_COND_INITIALIZER; @@ -239,7 +239,7 @@ ret->dso_data = dso_data; ret->events = data->events.field; ret->timeout = data->timeout.secs; - list_init(&ret->timeout_list); + dm_list_init(&ret->timeout_list); return ret; } @@ -459,7 +459,7 @@ { struct thread_status *thread; - list_iterate_items(thread, &_thread_registry) + dm_list_iterate_items(thread, &_thread_registry) if (!strcmp(data->device_uuid, thread->device.uuid)) return thread; @@ -489,13 +489,13 @@ pthread_cleanup_push(_exit_timeout, NULL); pthread_mutex_lock(&_timeout_mutex); - while (!list_empty(&_timeout_registry)) { + while (!dm_list_empty(&_timeout_registry)) { struct thread_status *thread; timeout.tv_sec = 0; curr_time = time(NULL); - list_iterate_items_gen(thread, &_timeout_registry, timeout_list) { + dm_list_iterate_items_gen(thread, &_timeout_registry, timeout_list) { if (thread->next_time <= curr_time) { thread->next_time = curr_time + thread->timeout; pthread_kill(thread->thread, SIGALRM); @@ -522,8 +522,8 @@ thread->next_time = time(NULL) + thread->timeout; - if (list_empty(&thread->timeout_list)) { - list_add(&_timeout_registry, &thread->timeout_list); + if (dm_list_empty(&thread->timeout_list)) { + dm_list_add(&_timeout_registry, &thread->timeout_list); if (_timeout_running) pthread_cond_signal(&_timeout_cond); } @@ -543,9 +543,9 @@ static void _unregister_for_timeout(struct thread_status *thread) { pthread_mutex_lock(&_timeout_mutex); - if (!list_empty(&thread->timeout_list)) { - list_del(&thread->timeout_list); - list_init(&thread->timeout_list); + if (!dm_list_empty(&thread->timeout_list)) { + dm_list_del(&thread->timeout_list); + dm_list_init(&thread->timeout_list); } pthread_mutex_unlock(&_timeout_mutex); } @@ -698,7 +698,7 @@ } /* we may have been relinked to unused registry since we were called, so check that */ - list_iterate_items(thread_iter, &_thread_registry_unused) + dm_list_iterate_items(thread_iter, &_thread_registry_unused) if (thread_iter == thread) { thread->status = DM_THREAD_DONE; _unlock_mutex(); @@ -839,7 +839,7 @@ { struct dso_data *dso_data, *ret = NULL; - list_iterate_items(dso_data, &_dso_registry) + dm_list_iterate_items(dso_data, &_dso_registry) if (!strcmp(data->dso_name, dso_data->dso_name)) { _lib_get(dso_data); ret = dso_data; @@ -1110,7 +1110,7 @@ _lock_mutex(); /* Iterate list of threads checking if we want a particular one. */ - list_iterate_items(thread, &_thread_registry) + dm_list_iterate_items(thread, &_thread_registry) if (_want_registered_device(message_data->dso_name, message_data->device_uuid, thread)) { @@ -1133,10 +1133,10 @@ thread = hit; while (1) { - if (list_end(&_thread_registry, &thread->list)) + if (dm_list_end(&_thread_registry, &thread->list)) goto out; - thread = list_item(thread->list.n, struct thread_status); + thread = dm_list_item(thread->list.n, struct thread_status); if (_want_registered_device(message_data->dso_name, NULL, thread)) { hit = thread; break; @@ -1440,12 +1440,12 @@ static void _cleanup_unused_threads(void) { int ret; - struct list *l; + struct dm_list *l; struct thread_status *thread; _lock_mutex(); - while ((l = list_first(&_thread_registry_unused))) { - thread = list_item(l, struct thread_status); + while ((l = dm_list_first(&_thread_registry_unused))) { + thread = dm_list_item(l, struct thread_status); if (thread->processing) break; /* cleanup on the next round */ @@ -1470,7 +1470,7 @@ break; } - list_del(l); + dm_list_del(l); syslog(LOG_ERR, "thread can't be on unused list unless !thread->events"); thread->status = DM_THREAD_RUNNING; @@ -1480,7 +1480,7 @@ } if (thread->status == DM_THREAD_DONE) { - list_del(l); + dm_list_del(l); pthread_join(thread->thread, NULL); _lib_put(thread->dso_data); _free_thread_status(thread); @@ -1741,8 +1741,8 @@ while (!_exit_now) { _process_request(&fifos); _cleanup_unused_threads(); - if (!list_empty(&_thread_registry) - || !list_empty(&_thread_registry_unused)) + if (!dm_list_empty(&_thread_registry) + || !dm_list_empty(&_thread_registry_unused)) _thread_registries_empty = 0; else _thread_registries_empty = 1; --- LVM2/daemons/dmeventd/plugins/mirror/Makefile.in 2008/07/09 09:59:42 1.7 +++ LVM2/daemons/dmeventd/plugins/mirror/Makefile.in 2008/11/03 22:14:26 1.8 @@ -27,6 +27,8 @@ LIB_SHARED = libdevmapper-event-lvm2mirror.so endif +LIB_VERSION = $(LIB_VERSION_LVM) + include $(top_srcdir)/make.tmpl install: libdevmapper-event-lvm2mirror.$(LIB_SUFFIX) --- LVM2/daemons/dmeventd/plugins/snapshot/Makefile.in 2008/07/09 09:59:42 1.3 +++ LVM2/daemons/dmeventd/plugins/snapshot/Makefile.in 2008/11/03 22:14:27 1.4 @@ -27,6 +27,8 @@ LIB_SHARED = libdevmapper-event-lvm2snapshot.so endif +LIB_VERSION = $(LIB_VERSION_LVM) + include $(top_srcdir)/make.tmpl install: libdevmapper-event-lvm2snapshot.$(LIB_SUFFIX) --- LVM2/lib/activate/activate.c 2008/09/19 07:12:45 1.139 +++ LVM2/lib/activate/activate.c 2008/11/03 22:14:27 1.140 @@ -52,11 +52,11 @@ } int list_segment_modules(struct dm_pool *mem, const struct lv_segment *seg, - struct list *modules) + struct dm_list *modules) { unsigned int s; struct lv_segment *seg2, *snap_seg; - struct list *snh; + struct dm_list *snh; if (seg->segtype->ops->modules_needed && !seg->segtype->ops->modules_needed(mem, seg, modules)) { @@ -65,9 +65,9 @@ } if (lv_is_origin(seg->lv)) - list_iterate(snh, &seg->lv->snapshot_segs) + dm_list_iterate(snh, &seg->lv->snapshot_segs) if (!list_lv_modules(mem, - list_struct_base(snh, + dm_list_struct_base(snh, struct lv_segment, origin_list)->cow, modules)) @@ -100,11 +100,11 @@ } int list_lv_modules(struct dm_pool *mem, const struct logical_volume *lv, - struct list *modules) + struct dm_list *modules) { struct lv_segment *seg; - list_iterate_items(seg, &lv->segments) + dm_list_iterate_items(seg, &lv->segments) if (!list_segment_modules(mem, seg, modules)) return_0; @@ -264,7 +264,7 @@ if (!(cn = find_config_tree_node(cmd, "activation/volume_list"))) { /* If no host tags defined, activate */ - if (list_empty(&cmd->tags)) + if (dm_list_empty(&cmd->tags)) return 1; /* If any host tag matches any LV or VG tag, activate */ @@ -517,7 +517,7 @@ /* If mirrored LV is temporarily shrinked to 1 area (= linear), * it should be considered in-sync. */ - if (list_size(&lv->segments) == 1 && first_seg(lv)->area_count == 1) { + if (dm_list_size(&lv->segments) == 1 && first_seg(lv)->area_count == 1) { *percent = 100.0; return 1; } @@ -639,7 +639,7 @@ if (!activation()) return 0; - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { if (lvl->lv->status & VISIBLE_LV) count += (_lv_active(vg->cmd, lvl->lv, by_uuid_only) == 1); } @@ -665,7 +665,7 @@ if (!activation()) return 0; - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { if (lvl->lv->status & VISIBLE_LV) count += (_lv_open_count(vg->cmd, lvl->lv) > 0); } @@ -715,7 +715,7 @@ #ifdef DMEVENTD int i, pending = 0, monitored; int r = 1; - struct list *tmp, *snh, *snht; + struct dm_list *tmp, *snh, *snht; struct lv_segment *seg; int (*monitor_fn) (struct lv_segment *s, int e); uint32_t s; @@ -745,15 +745,15 @@ * TODO: This may change when snapshots of mirrors are allowed. */ if (lv_is_origin(lv)) { - list_iterate_safe(snh, snht, &lv->snapshot_segs) - if (!monitor_dev_for_events(cmd, list_struct_base(snh, + dm_list_iterate_safe(snh, snht, &lv->snapshot_segs) + if (!monitor_dev_for_events(cmd, dm_list_struct_base(snh, struct lv_segment, origin_list)->cow, monitor)) r = 0; return r; } - list_iterate(tmp, &lv->segments) { - seg = list_item(tmp, struct lv_segment); + dm_list_iterate(tmp, &lv->segments) { + seg = dm_list_item(tmp, struct lv_segment); /* Recurse for AREA_LV */ for (s = 0; s < seg->area_count; s++) { --- LVM2/lib/activate/activate.h 2008/04/10 21:34:18 1.61 +++ LVM2/lib/activate/activate.h 2008/11/03 22:14:27 1.62 @@ -45,9 +45,9 @@ int target_version(const char *target_name, uint32_t *maj, uint32_t *min, uint32_t *patchlevel); int list_segment_modules(struct dm_pool *mem, const struct lv_segment *seg, - struct list *modules); + struct dm_list *modules); int list_lv_modules(struct dm_pool *mem, const struct logical_volume *lv, - struct list *modules); + struct dm_list *modules); void activation_release(void); void activation_exit(void); --- LVM2/lib/activate/dev_manager.c 2008/09/19 07:05:03 1.141 +++ LVM2/lib/activate/dev_manager.c 2008/11/03 22:14:27 1.142 @@ -330,7 +330,7 @@ uint64_t start, length; char *type = NULL; char *params = NULL; - struct list *segh = &lv->segments; + struct dm_list *segh = &lv->segments; struct lv_segment *seg = NULL; struct segment_type *segtype; @@ -358,12 +358,12 @@ next = dm_get_next_target(dmt, next, &start, &length, &type, ¶ms); if (lv) { - if (!(segh = list_next(&lv->segments, segh))) { + if (!(segh = dm_list_next(&lv->segments, segh))) { log_error("Number of segments in active LV %s " "does not match metadata", lv->name); goto out; } - seg = list_item(segh, struct lv_segment); + seg = dm_list_item(segh, struct lv_segment); } if (!type || !params || strcmp(type, target_type)) @@ -381,7 +381,7 @@ } while (next); - if (lv && (segh = list_next(&lv->segments, segh))) { + if (lv && (segh = dm_list_next(&lv->segments, segh))) { log_error("Number of segments in active LV %s does not " "match metadata", lv->name); goto out; @@ -576,7 +576,7 @@ old_origin = snap_seg->origin; /* Was this the last active snapshot with this origin? */ - list_iterate_items(lvl, active_head) { + dm_list_iterate_items(lvl, active_head) { active = lvl->lv; if ((snap_seg = find_cow(active)) && snap_seg->origin == old_origin) { @@ -657,7 +657,7 @@ static struct dm_tree *_create_partial_dtree(struct dev_manager *dm, struct logical_volume *lv) { struct dm_tree *dtree; - struct list *snh, *snht; + struct dm_list *snh, *snht; struct lv_segment *seg; uint32_t s; @@ -670,12 +670,12 @@ goto_bad; /* Add any snapshots of this LV */ - list_iterate_safe(snh, snht, &lv->snapshot_segs) - if (!_add_lv_to_dtree(dm, dtree, list_struct_base(snh, struct lv_segment, origin_list)->cow)) + dm_list_iterate_safe(snh, snht, &lv->snapshot_segs) + if (!_add_lv_to_dtree(dm, dtree, dm_list_struct_base(snh, struct lv_segment, origin_list)->cow)) goto_bad; /* Add any LVs used by segments in this LV */ - list_iterate_items(seg, &lv->segments) + dm_list_iterate_items(seg, &lv->segments) for (s = 0; s < seg->area_count; s++) if (seg_type(seg, s) == AREA_LV && seg_lv(seg, s)) { if (!_add_lv_to_dtree(dm, dtree, seg_lv(seg, s))) @@ -699,7 +699,7 @@ int segno = -1, i = 0;; uint64_t size = seg->len * seg->lv->vg->extent_size; - list_iterate_items(seg_i, &seg->lv->segments) { + dm_list_iterate_items(seg_i, &seg->lv->segments) { if (seg == seg_i) segno = i; ++i; @@ -862,7 +862,7 @@ const char *layer) { uint32_t s; - struct list *snh; + struct dm_list *snh; struct lv_segment *seg_present; /* Ensure required device-mapper targets are loaded */ @@ -915,8 +915,8 @@ if (lv_is_origin(seg->lv) && !layer) /* Add any snapshots of this LV */ - list_iterate(snh, &seg->lv->snapshot_segs) - if (!_add_new_lv_to_dtree(dm, dtree, list_struct_base(snh, struct lv_segment, origin_list)->cow, NULL)) + dm_list_iterate(snh, &seg->lv->snapshot_segs) + if (!_add_new_lv_to_dtree(dm, dtree, dm_list_struct_base(snh, struct lv_segment, origin_list)->cow, NULL)) return_0; return 1; @@ -970,7 +970,7 @@ /* Create table */ dm->pvmove_mirror_count = 0u; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (!_add_segment_to_dtree(dm, dtree, dnode, seg, layer)) return_0; /* These aren't real segments in the LVM2 metadata */ --- LVM2/lib/activate/fs.c 2008/01/30 13:59:57 1.42 +++ LVM2/lib/activate/fs.c 2008/11/03 22:14:27 1.43 @@ -243,10 +243,10 @@ return 1; } -static LIST_INIT(_fs_ops); +static DM_LIST_INIT(_fs_ops); struct fs_op_parms { - struct list list; + struct dm_list list; fs_op_t type; char *dev_dir; char *vg_name; @@ -286,21 +286,21 @@ _store_str(&pos, &fsp->dev, dev); _store_str(&pos, &fsp->old_lv_name, old_lv_name); - list_add(&_fs_ops, &fsp->list); + dm_list_add(&_fs_ops, &fsp->list); return 1; } static void _pop_fs_ops(void) { - struct list *fsph, *fspht; + struct dm_list *fsph, *fspht; struct fs_op_parms *fsp; - list_iterate_safe(fsph, fspht, &_fs_ops) { - fsp = list_item(fsph, struct fs_op_parms); + dm_list_iterate_safe(fsph, fspht, &_fs_ops) { + fsp = dm_list_item(fsph, struct fs_op_parms); _do_fs_op(fsp->type, fsp->dev_dir, fsp->vg_name, fsp->lv_name, fsp->dev, fsp->old_lv_name); - list_del(&fsp->list); + dm_list_del(&fsp->list); dm_free(fsp); } } --- LVM2/lib/cache/lvmcache.c 2008/09/16 18:05:11 1.60 +++ LVM2/lib/cache/lvmcache.c 2008/11/03 22:14:27 1.61 @@ -30,7 +30,7 @@ static struct dm_hash_table *_vgid_hash = NULL; static struct dm_hash_table *_vgname_hash = NULL; static struct dm_hash_table *_lock_hash = NULL; -static struct list _vginfos; +static struct dm_list _vginfos; static int _scanning_in_progress = 0; static int _has_scanned = 0; static int _vgs_locked = 0; @@ -38,7 +38,7 @@ int lvmcache_init(void) { - list_init(&_vginfos); + dm_list_init(&_vginfos); if (!(_vgname_hash = dm_hash_create(128))) return 0; @@ -117,7 +117,7 @@ struct lvmcache_info *info; int cached_vgmetadata_valid = 1; - list_iterate_items(info, &vginfo->infos) + dm_list_iterate_items(info, &vginfo->infos) _update_cache_info_lock_state(info, locked, &cached_vgmetadata_valid); @@ -151,7 +151,7 @@ */ if (!vginfo->precommitted) - list_iterate_items(info, &vginfo->infos) + dm_list_iterate_items(info, &vginfo->infos) info->status |= CACHE_INVALID; _free_cached_vgmetadata(vginfo); @@ -226,14 +226,14 @@ return; info->vginfo = vginfo; - list_add(&vginfo->infos, &info->list); + dm_list_add(&vginfo->infos, &info->list); } static void _vginfo_detach_info(struct lvmcache_info *info) { - if (!list_empty(&info->list)) { - list_del(&info->list); - list_init(&info->list); + if (!dm_list_empty(&info->list)) { + dm_list_del(&info->list); + dm_list_init(&info->list); } info->vginfo = NULL; @@ -267,8 +267,8 @@ struct lvmcache_vginfo *vginfo; struct lvmcache_info *info; struct label *label; - struct list *devh, *tmp; - struct list devs; + struct dm_list *devh, *tmp; + struct dm_list devs; struct device_list *devl; char vgid_found[ID_LEN + 1] __attribute((aligned(8))); @@ -277,22 +277,22 @@ /* This function is normally called before reading metadata so * we check cached labels here. Unfortunately vginfo is volatile. */ - list_init(&devs); - list_iterate_items(info, &vginfo->infos) { + dm_list_init(&devs); + dm_list_iterate_items(info, &vginfo->infos) { if (!(devl = dm_malloc(sizeof(*devl)))) { log_error("device_list element allocation failed"); return NULL; } devl->dev = info->dev; - list_add(&devs, &devl->list); + dm_list_add(&devs, &devl->list); } memcpy(vgid_found, vginfo->vgid, sizeof(vgid_found)); - list_iterate_safe(devh, tmp, &devs) { - devl = list_item(devh, struct device_list); + dm_list_iterate_safe(devh, tmp, &devs) { + devl = dm_list_item(devh, struct device_list); label_read(devl->dev, &label, UINT64_C(0)); - list_del(&devl->list); + dm_list_del(&devl->list); dm_free(devl); } @@ -362,7 +362,7 @@ struct lvmcache_info *info; /* Invalid if any info is invalid */ - list_iterate_items(info, &vginfo->infos) + dm_list_iterate_items(info, &vginfo->infos) if (!_info_is_valid(info)) return 0; @@ -374,7 +374,7 @@ { struct lvmcache_info *info; - list_iterate_items(info, &vginfo->infos) + dm_list_iterate_items(info, &vginfo->infos) if (_info_is_valid(info)) return 0; @@ -458,7 +458,7 @@ _has_scanned = 1; /* Perform any format-specific scanning e.g. text files */ - list_iterate_items(fmt, &cmd->formats) { + dm_list_iterate_items(fmt, &cmd->formats) { if (fmt->ops->scan && !fmt->ops->scan(fmt)) goto out; } @@ -516,9 +516,9 @@ return vg; } -struct list *lvmcache_get_vgids(struct cmd_context *cmd, int full_scan) +struct dm_list *lvmcache_get_vgids(struct cmd_context *cmd, int full_scan) { - struct list *vgids; + struct dm_list *vgids; struct lvmcache_vginfo *vginfo; lvmcache_label_scan(cmd, full_scan); @@ -528,7 +528,7 @@ return NULL; } - list_iterate_items(vginfo, &_vginfos) { + dm_list_iterate_items(vginfo, &_vginfos) { if (!str_list_add(cmd->mem, vgids, dm_pool_strdup(cmd->mem, vginfo->vgid))) { log_error("strlist allocation failed"); @@ -539,9 +539,9 @@ return vgids; } -struct list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan) +struct dm_list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan) { - struct list *vgnames; + struct dm_list *vgnames; struct lvmcache_vginfo *vginfo; lvmcache_label_scan(cmd, full_scan); @@ -551,7 +551,7 @@ return NULL; } - list_iterate_items(vginfo, &_vginfos) { + dm_list_iterate_items(vginfo, &_vginfos) { if (!str_list_add(cmd->mem, vgnames, dm_pool_strdup(cmd->mem, vginfo->vgname))) { log_error("strlist allocation failed"); @@ -562,10 +562,10 @@ return vgnames; } -struct list *lvmcache_get_pvids(struct cmd_context *cmd, const char *vgname, +struct dm_list *lvmcache_get_pvids(struct cmd_context *cmd, const char *vgname, const char *vgid) { - struct list *pvids; + struct dm_list *pvids; struct lvmcache_vginfo *vginfo; struct lvmcache_info *info; @@ -577,7 +577,7 @@ if (!(vginfo = vginfo_from_vgname(vgname, vgid))) return pvids; - list_iterate_items(info, &vginfo->infos) { + dm_list_iterate_items(info, &vginfo->infos) { if (!str_list_add(cmd->mem, pvids, dm_pool_strdup(cmd->mem, info->dev->pvid))) { log_error("strlist allocation failed"); @@ -664,7 +664,7 @@ vginfo_from_vgid(vginfo->vgid) == vginfo) dm_hash_remove(_vgid_hash, vginfo->vgid); - list_del(&vginfo->list); + dm_list_del(&vginfo->list); dm_free(vginfo); @@ -681,7 +681,7 @@ /* vginfo still referenced? */ if (!vginfo || is_orphan_vg(vginfo->vgname) || - !list_empty(&vginfo->infos)) + !dm_list_empty(&vginfo->infos)) return 1; if (!_free_vginfo(vginfo)) @@ -904,7 +904,7 @@ log_error("cache vgname alloc failed for %s", vgname); return 0; } - list_init(&vginfo->infos); + dm_list_init(&vginfo->infos); /* * If we're scanning and there's an invalidated entry, remove it. @@ -912,13 +912,13 @@ */ while ((primary_vginfo = vginfo_from_vgname(vgname, NULL)) && _scanning_in_progress && _vginfo_is_invalid(primary_vginfo)) - list_iterate_items_safe(info2, info3, &primary_vginfo->infos) { + dm_list_iterate_items_safe(info2, info3, &primary_vginfo->infos) { orphan_vginfo = vginfo_from_vgname(primary_vginfo->fmt->orphan_vg_name, NULL); _drop_vginfo(info2, primary_vginfo); _vginfo_attach_info(orphan_vginfo, info2); if (info2->mdas.n) sprintf(mdabuf, " with %u mdas", - list_size(&info2->mdas)); + dm_list_size(&info2->mdas)); else mdabuf[0] = '\0'; log_debug("lvmcache: %s: now in VG %s%s%s%s%s", @@ -936,9 +936,9 @@ } /* Ensure orphans appear last on list_iterate */ if (is_orphan_vg(vgname)) - list_add(&_vginfos, &vginfo->list); + dm_list_add(&_vginfos, &vginfo->list); else - list_add_h(&_vginfos, &vginfo->list); + dm_list_add_h(&_vginfos, &vginfo->list); /*** } ***/ @@ -956,7 +956,7 @@ if (info) { if (info->mdas.n) - sprintf(mdabuf, " with %u mdas", list_size(&info->mdas)); + sprintf(mdabuf, " with %u mdas", dm_list_size(&info->mdas)); else mdabuf[0] = '\0'; log_debug("lvmcache: %s: now in VG %s%s%s%s%s", @@ -1027,7 +1027,7 @@ } /* If PV without mdas is already in a real VG, don't make it orphan */ - if (is_orphan_vg(vgname) && info->vginfo && !list_size(&info->mdas) && + if (is_orphan_vg(vgname) && info->vginfo && !dm_list_size(&info->mdas) && !is_orphan_vg(info->vginfo->vgname) && memlock()) return 1; @@ -1053,7 +1053,7 @@ pvid_s[sizeof(pvid_s) - 1] = '\0'; - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { strncpy(pvid_s, (char *) &pvl->pv->id, sizeof(pvid_s) - 1); /* FIXME Could pvl->pv->dev->pvid ever be different? */ if ((info = info_from_pvid(pvid_s, 0)) && @@ -1101,7 +1101,7 @@ label->info = info; info->label = label; - list_init(&info->list); + dm_list_init(&info->list); info->dev = dev; } else { if (existing->dev != dev) { @@ -1246,9 +1246,9 @@ _lock_hash = NULL; } - if (!list_empty(&_vginfos)) + if (!dm_list_empty(&_vginfos)) log_error("Internal error: _vginfos list should be empty"); - list_init(&_vginfos); + dm_list_init(&_vginfos); if (retain_orphans) init_lvmcache_orphans(cmd); --- LVM2/lib/cache/lvmcache.h 2008/05/08 18:00:47 1.23 +++ LVM2/lib/cache/lvmcache.h 2008/11/03 22:14:27 1.24 @@ -35,8 +35,8 @@ /* One per VG */ struct lvmcache_vginfo { - struct list list; /* Join these vginfos together */ - struct list infos; /* List head for lvmcache_infos */ + struct dm_list list; /* Join these vginfos together */ + struct dm_list infos; /* List head for lvmcache_infos */ const struct format_type *fmt; char *vgname; /* "" == orphan */ uint32_t status; @@ -50,9 +50,9 @@ /* One per device */ struct lvmcache_info { - struct list list; /* Join VG members together */ - struct list mdas; /* list head for metadata areas */ - struct list das; /* list head for data areas */ + struct dm_list list; /* Join VG members together */ + struct dm_list mdas; /* list head for metadata areas */ + struct dm_list das; /* list head for data areas */ struct lvmcache_vginfo *vginfo; /* NULL == unknown */ struct label *label; const struct format_type *fmt; @@ -98,14 +98,14 @@ /* Returns list of struct str_lists containing pool-allocated copy of vgnames */ /* Set full_scan to 1 to reread every filtered device label */ -struct list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan); +struct dm_list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan); /* Returns list of struct str_lists containing pool-allocated copy of vgids */ /* Set full_scan to 1 to reread every filtered device label */ -struct list *lvmcache_get_vgids(struct cmd_context *cmd, int full_scan); +struct dm_list *lvmcache_get_vgids(struct cmd_context *cmd, int full_scan); /* Returns list of struct str_lists containing pool-allocated copy of pvids */ -struct list *lvmcache_get_pvids(struct cmd_context *cmd, const char *vgname, +struct dm_list *lvmcache_get_pvids(struct cmd_context *cmd, const char *vgname, const char *vgid); /* Returns cached volume group metadata. */ --- LVM2/lib/commands/toolcontext.c 2008/09/19 18:26:41 1.63 +++ LVM2/lib/commands/toolcontext.c 2008/11/03 22:14:27 1.64 @@ -410,7 +410,7 @@ /* Is there a config file? */ if (stat(config_file, &info) == -1) { if (errno == ENOENT) { - list_add(&cmd->config_files, &cfl->list); + dm_list_add(&cmd->config_files, &cfl->list); goto out; } log_sys_error("stat", config_file); @@ -425,7 +425,7 @@ return 0; } - list_add(&cmd->config_files, &cfl->list); + dm_list_add(&cmd->config_files, &cfl->list); out: if (*tag) @@ -461,7 +461,7 @@ struct str_list *sl; /* Tag list may grow while inside this loop */ - list_iterate_items(sl, &cmd->tags) { + dm_list_iterate_items(sl, &cmd->tags) { if (!_load_config_file(cmd, sl->str)) return_0; } @@ -481,7 +481,7 @@ } } - list_iterate_items(cfl, &cmd->config_files) { + dm_list_iterate_items(cfl, &cmd->config_files) { /* Merge all config trees into cmd->cft using merge/tag rules */ if (!merge_config_tree(cmd, cmd->cft, cfl->cft)) return_0; @@ -492,10 +492,10 @@ static void _destroy_tags(struct cmd_context *cmd) { - struct list *slh, *slht; + struct dm_list *slh, *slht; - list_iterate_safe(slh, slht, &cmd->tags) { - list_del(slh); + dm_list_iterate_safe(slh, slht, &cmd->tags) { + dm_list_del(slh); } } @@ -503,7 +503,7 @@ { struct config_tree_list *cfl; - list_iterate_items(cfl, &cmd->config_files) { + dm_list_iterate_items(cfl, &cmd->config_files) { if (config_file_changed(cfl->cft)) return 1; } @@ -520,11 +520,11 @@ cmd->cft = NULL; } - list_iterate_items(cfl, &cmd->config_files) { + dm_list_iterate_items(cfl, &cmd->config_files) { destroy_config_tree(cfl->cft); } - list_init(&cmd->config_files); + dm_list_init(&cmd->config_files); } static int _init_dev_cache(struct cmd_context *cmd) @@ -725,14 +725,14 @@ if (!(fmt = init_lvm1_format(cmd))) return 0; fmt->library = NULL; - list_add(&cmd->formats, &fmt->list); + dm_list_add(&cmd->formats, &fmt->list); #endif #ifdef POOL_INTERNAL if (!(fmt = init_pool_format(cmd))) return 0; fmt->library = NULL; - list_add(&cmd->formats, &fmt->list); + dm_list_add(&cmd->formats, &fmt->list); #endif #ifdef HAVE_LIBDL @@ -764,7 +764,7 @@ if (!(fmt = init_format_fn(cmd))) return 0; fmt->library = lib; - list_add(&cmd->formats, &fmt->list); + dm_list_add(&cmd->formats, &fmt->list); } } #endif @@ -772,14 +772,14 @@ if (!(fmt = create_text_format(cmd))) return 0; fmt->library = NULL; - list_add(&cmd->formats, &fmt->list); + dm_list_add(&cmd->formats, &fmt->list); cmd->fmt_backup = fmt; format = find_config_tree_str(cmd, "global/format", DEFAULT_FORMAT); - list_iterate_items(fmt, &cmd->formats) { + dm_list_iterate_items(fmt, &cmd->formats) { if (!strcasecmp(fmt->name, format) || (fmt->alias && !strcasecmp(fmt->alias, format))) { cmd->default_settings.fmt = fmt; @@ -795,7 +795,7 @@ { struct format_type *fmt; - list_iterate_items(fmt, &cmd->formats) + dm_list_iterate_items(fmt, &cmd->formats) if (!lvmcache_add_orphan_vginfo(fmt->orphan_vg_name, fmt)) return_0; @@ -813,35 +813,35 @@ if (!(segtype = init_striped_segtype(cmd))) return 0; segtype->library = NULL; - list_add(&cmd->segtypes, &segtype->list); + dm_list_add(&cmd->segtypes, &segtype->list); if (!(segtype = init_zero_segtype(cmd))) return 0; segtype->library = NULL; - list_add(&cmd->segtypes, &segtype->list); + dm_list_add(&cmd->segtypes, &segtype->list); if (!(segtype = init_error_segtype(cmd))) return 0; segtype->library = NULL; - list_add(&cmd->segtypes, &segtype->list); + dm_list_add(&cmd->segtypes, &segtype->list); if (!(segtype = init_free_segtype(cmd))) return 0; segtype->library = NULL; - list_add(&cmd->segtypes, &segtype->list); + dm_list_add(&cmd->segtypes, &segtype->list); #ifdef SNAPSHOT_INTERNAL if (!(segtype = init_snapshot_segtype(cmd))) return 0; segtype->library = NULL; - list_add(&cmd->segtypes, &segtype->list); + dm_list_add(&cmd->segtypes, &segtype->list); #endif #ifdef MIRRORED_INTERNAL if (!(segtype = init_mirrored_segtype(cmd))) return 0; segtype->library = NULL; - list_add(&cmd->segtypes, &segtype->list); + dm_list_add(&cmd->segtypes, &segtype->list); #endif #ifdef HAVE_LIBDL @@ -874,16 +874,16 @@ if (!(segtype = init_segtype_fn(cmd))) return 0; segtype->library = lib; - list_add(&cmd->segtypes, &segtype->list); + dm_list_add(&cmd->segtypes, &segtype->list); - list_iterate_items(segtype2, &cmd->segtypes) { + dm_list_iterate_items(segtype2, &cmd->segtypes) { if ((segtype == segtype2) || strcmp(segtype2->name, segtype->name)) continue; log_error("Duplicate segment type %s: " "unloading shared library %s", segtype->name, cv->v.str); - list_del(&segtype->list); + dm_list_del(&segtype->list); segtype->ops->destroy(segtype); dlclose(lib); } @@ -1008,10 +1008,10 @@ cmd->is_long_lived = is_long_lived; cmd->handles_missing_pvs = 0; cmd->hosttags = 0; - list_init(&cmd->formats); - list_init(&cmd->segtypes); - list_init(&cmd->tags); - list_init(&cmd->config_files); + dm_list_init(&cmd->formats); + dm_list_init(&cmd->segtypes); + dm_list_init(&cmd->tags); + dm_list_init(&cmd->config_files); strcpy(cmd->sys_dir, DEFAULT_SYS_DIR); @@ -1088,15 +1088,15 @@ return NULL; } -static void _destroy_formats(struct list *formats) +static void _destroy_formats(struct dm_list *formats) { - struct list *fmtl, *tmp; + struct dm_list *fmtl, *tmp; struct format_type *fmt; void *lib; - list_iterate_safe(fmtl, tmp, formats) { - fmt = list_item(fmtl, struct format_type); - list_del(&fmt->list); + dm_list_iterate_safe(fmtl, tmp, formats) { + fmt = dm_list_item(fmtl, struct format_type); + dm_list_del(&fmt->list); lib = fmt->library; fmt->ops->destroy(fmt); #ifdef HAVE_LIBDL @@ -1106,15 +1106,15 @@ } } -static void _destroy_segtypes(struct list *segtypes) +static void _destroy_segtypes(struct dm_list *segtypes) { - struct list *sgtl, *tmp; + struct dm_list *sgtl, *tmp; struct segment_type *segtype; void *lib; - list_iterate_safe(sgtl, tmp, segtypes) { - segtype = list_item(sgtl, struct segment_type); - list_del(&segtype->list); + dm_list_iterate_safe(sgtl, tmp, segtypes) { + segtype = dm_list_item(sgtl, struct segment_type); + dm_list_del(&segtype->list); lib = segtype->library; segtype->ops->destroy(segtype); #ifdef HAVE_LIBDL --- LVM2/lib/commands/toolcontext.h 2008/09/19 07:12:08 1.26 +++ LVM2/lib/commands/toolcontext.h 2008/11/03 22:14:27 1.27 @@ -57,8 +57,8 @@ const struct format_type *fmt; /* Current format to use by default */ struct format_type *fmt_backup; /* Format to use for backups */ - struct list formats; /* Available formats */ - struct list segtypes; /* Available segment types */ + struct dm_list formats; /* Available formats */ + struct dm_list segtypes; /* Available segment types */ const char *hostname; const char *kernel_vsn; @@ -74,7 +74,7 @@ struct dev_filter *filter; int dump_filter; /* Dump filter when exiting? */ - struct list config_files; + struct dm_list config_files; int config_valid; struct config_tree *cft; struct config_tree *cft_override; @@ -86,7 +86,7 @@ const char *stripe_filler; /* List of defined tags */ - struct list tags; + struct dm_list tags; int hosttags; char sys_dir[PATH_MAX]; --- LVM2/lib/config/config.c 2008/08/07 14:02:32 1.71 +++ LVM2/lib/config/config.c 2008/11/03 22:14:27 1.72 @@ -1165,7 +1165,7 @@ } } -static int _match_host_tags(struct list *tags, struct config_node *tn) +static int _match_host_tags(struct dm_list *tags, struct config_node *tn) { struct config_value *tv; const char *str; --- LVM2/lib/config/config.h 2007/08/20 20:55:24 1.25 +++ LVM2/lib/config/config.h 2008/11/03 22:14:27 1.26 @@ -49,7 +49,7 @@ }; struct config_tree_list { - struct list list; + struct dm_list list; struct config_tree *cft; }; --- LVM2/lib/datastruct/list.c 2008/04/10 19:14:26 1.4 +++ LVM2/lib/datastruct/list.c 2008/11/03 22:14:27 1.5 @@ -19,7 +19,7 @@ * Initialise a list before use. * The list head's next and previous pointers point back to itself. */ -void list_init(struct list *head) +void dm_list_init(struct dm_list *head) { head->n = head->p = head; } @@ -28,7 +28,7 @@ * Insert an element before 'head'. * If 'head' is the list head, this adds an element to the end of the list. */ -void list_add(struct list *head, struct list *elem) +void dm_list_add(struct dm_list *head, struct dm_list *elem) { assert(head->n); @@ -43,7 +43,7 @@ * Insert an element after 'head'. * If 'head' is the list head, this adds an element to the front of the list. */ -void list_add_h(struct list *head, struct list *elem) +void dm_list_add_h(struct dm_list *head, struct dm_list *elem) { assert(head->n); @@ -59,7 +59,7 @@ * Note that this doesn't change the element itself - it may still be safe * to follow its pointers. */ -void list_del(struct list *elem) +void dm_list_del(struct dm_list *elem) { elem->n->p = elem->p; elem->p->n = elem->n; @@ -68,16 +68,16 @@ /* * Remove an element from existing list and insert before 'head'. */ -void list_move(struct list *head, struct list *elem) +void dm_list_move(struct dm_list *head, struct dm_list *elem) { - list_del(elem); - list_add(head, elem); + dm_list_del(elem); + dm_list_add(head, elem); } /* * Is the list empty? */ -int list_empty(const struct list *head) +int dm_list_empty(const struct dm_list *head) { return head->n == head; } @@ -85,7 +85,7 @@ /* * Is this the first element of the list? */ -int list_start(const struct list *head, const struct list *elem) +int dm_list_start(const struct dm_list *head, const struct dm_list *elem) { return elem->p == head; } @@ -93,7 +93,7 @@ /* * Is this the last element of the list? */ -int list_end(const struct list *head, const struct list *elem) +int dm_list_end(const struct dm_list *head, const struct dm_list *elem) { return elem->n == head; } @@ -101,44 +101,44 @@ /* * Return first element of the list or NULL if empty */ -struct list *list_first(const struct list *head) +struct dm_list *dm_list_first(const struct dm_list *head) { - return (list_empty(head) ? NULL : head->n); + return (dm_list_empty(head) ? NULL : head->n); } /* * Return last element of the list or NULL if empty */ -struct list *list_last(const struct list *head) +struct dm_list *dm_list_last(const struct dm_list *head) { - return (list_empty(head) ? NULL : head->p); + return (dm_list_empty(head) ? NULL : head->p); } /* * Return the previous element of the list, or NULL if we've reached the start. */ -struct list *list_prev(const struct list *head, const struct list *elem) +struct dm_list *dm_list_prev(const struct dm_list *head, const struct dm_list *elem) { - return (list_start(head, elem) ? NULL : elem->p); + return (dm_list_start(head, elem) ? NULL : elem->p); } /* * Return the next element of the list, or NULL if we've reached the end. */ -struct list *list_next(const struct list *head, const struct list *elem) +struct dm_list *dm_list_next(const struct dm_list *head, const struct dm_list *elem) { - return (list_end(head, elem) ? NULL : elem->n); + return (dm_list_end(head, elem) ? NULL : elem->n); } /* * Return the number of elements in a list by walking it. */ -unsigned int list_size(const struct list *head) +unsigned int dm_list_size(const struct dm_list *head) { unsigned int s = 0; - const struct list *v; + const struct dm_list *v; - list_iterate(v, head) + dm_list_iterate(v, head) s++; return s; --- LVM2/lib/datastruct/list.h 2008/04/10 19:14:26 1.27 +++ LVM2/lib/datastruct/list.h 2008/11/03 22:14:27 1.28 @@ -24,106 +24,106 @@ * The list head's pointers point to the first and the last element. */ -struct list { - struct list *n, *p; +struct dm_list { + struct dm_list *n, *p; }; /* * Initialise a list before use. * The list head's next and previous pointers point back to itself. */ -#define LIST_INIT(name) struct list name = { &(name), &(name) } -void list_init(struct list *head); +#define DM_LIST_INIT(name) struct dm_list name = { &(name), &(name) } +void dm_list_init(struct dm_list *head); /* * Insert an element before 'head'. * If 'head' is the list head, this adds an element to the end of the list. */ -void list_add(struct list *head, struct list *elem); +void dm_list_add(struct dm_list *head, struct dm_list *elem); /* * Insert an element after 'head'. * If 'head' is the list head, this adds an element to the front of the list. */ -void list_add_h(struct list *head, struct list *elem); +void dm_list_add_h(struct dm_list *head, struct dm_list *elem); /* * Delete an element from its list. * Note that this doesn't change the element itself - it may still be safe * to follow its pointers. */ -void list_del(struct list *elem); +void dm_list_del(struct dm_list *elem); /* * Remove an element from existing list and insert before 'head'. */ -void list_move(struct list *head, struct list *elem); +void dm_list_move(struct dm_list *head, struct dm_list *elem); /* * Is the list empty? */ -int list_empty(const struct list *head); +int dm_list_empty(const struct dm_list *head); /* * Is this the first element of the list? */ -int list_start(const struct list *head, const struct list *elem); +int dm_list_start(const struct dm_list *head, const struct dm_list *elem); /* * Is this the last element of the list? */ -int list_end(const struct list *head, const struct list *elem); +int dm_list_end(const struct dm_list *head, const struct dm_list *elem); /* * Return first element of the list or NULL if empty */ -struct list *list_first(const struct list *head); +struct dm_list *dm_list_first(const struct dm_list *head); /* * Return last element of the list or NULL if empty */ -struct list *list_last(const struct list *head); +struct dm_list *dm_list_last(const struct dm_list *head); /* * Return the previous element of the list, or NULL if we've reached the start. */ -struct list *list_prev(const struct list *head, const struct list *elem); +struct dm_list *dm_list_prev(const struct dm_list *head, const struct dm_list *elem); /* * Return the next element of the list, or NULL if we've reached the end. */ -struct list *list_next(const struct list *head, const struct list *elem); +struct dm_list *dm_list_next(const struct dm_list *head, const struct dm_list *elem); /* - * Given the address v of an instance of 'struct list' called 'head' + * Given the address v of an instance of 'struct dm_list' called 'head' * contained in a structure of type t, return the containing structure. */ -#define list_struct_base(v, t, head) \ +#define dm_list_struct_base(v, t, head) \ ((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->head)) /* - * Given the address v of an instance of 'struct list list' contained in + * Given the address v of an instance of 'struct dm_list list' contained in * a structure of type t, return the containing structure. */ -#define list_item(v, t) list_struct_base((v), t, list) +#define dm_list_item(v, t) dm_list_struct_base((v), t, list) /* * Given the address v of one known element e in a known structure of type t, * return another element f. */ -#define struct_field(v, t, e, f) \ +#define dm_struct_field(v, t, e, f) \ (((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->e))->f) /* * Given the address v of a known element e in a known structure of type t, * return the list head 'list' */ -#define list_head(v, t, e) struct_field(v, t, e, list) +#define dm_list_head(v, t, e) dm_struct_field(v, t, e, list) /* * Set v to each element of a list in turn. */ -#define list_iterate(v, head) \ +#define dm_list_iterate(v, head) \ for (v = (head)->n; v != head; v = v->n) /* @@ -133,7 +133,7 @@ * already-processed elements. * If 'start' is 'head' it walks the list backwards. */ -#define list_uniterate(v, head, start) \ +#define dm_list_uniterate(v, head, start) \ for (v = (start)->p; v != head; v = v->p) /* @@ -141,68 +141,68 @@ * the way. * t must be defined as a temporary variable of the same type as v. */ -#define list_iterate_safe(v, t, head) \ +#define dm_list_iterate_safe(v, t, head) \ for (v = (head)->n, t = v->n; v != head; v = t, t = v->n) /* * Walk a list, setting 'v' in turn to the containing structure of each item. * The containing structure should be the same type as 'v'. - * The 'struct list' variable within the containing structure is 'field'. + * The 'struct dm_list' variable within the containing structure is 'field'. */ -#define list_iterate_items_gen(v, head, field) \ - for (v = list_struct_base((head)->n, typeof(*v), field); \ +#define dm_list_iterate_items_gen(v, head, field) \ + for (v = dm_list_struct_base((head)->n, typeof(*v), field); \ &v->field != (head); \ - v = list_struct_base(v->field.n, typeof(*v), field)) + v = dm_list_struct_base(v->field.n, typeof(*v), field)) /* * Walk a list, setting 'v' in turn to the containing structure of each item. * The containing structure should be the same type as 'v'. - * The list should be 'struct list list' within the containing structure. + * The list should be 'struct dm_list list' within the containing structure. */ -#define list_iterate_items(v, head) list_iterate_items_gen(v, (head), list) +#define dm_list_iterate_items(v, head) dm_list_iterate_items_gen(v, (head), list) /* * Walk a list, setting 'v' in turn to the containing structure of each item. * The containing structure should be the same type as 'v'. - * The 'struct list' variable within the containing structure is 'field'. + * The 'struct dm_list' variable within the containing structure is 'field'. * t must be defined as a temporary variable of the same type as v. */ -#define list_iterate_items_gen_safe(v, t, head, field) \ - for (v = list_struct_base((head)->n, typeof(*v), field), \ - t = list_struct_base(v->field.n, typeof(*v), field); \ +#define dm_list_iterate_items_gen_safe(v, t, head, field) \ + for (v = dm_list_struct_base((head)->n, typeof(*v), field), \ + t = dm_list_struct_base(v->field.n, typeof(*v), field); \ &v->field != (head); \ - v = t, t = list_struct_base(v->field.n, typeof(*v), field)) + v = t, t = dm_list_struct_base(v->field.n, typeof(*v), field)) /* * Walk a list, setting 'v' in turn to the containing structure of each item. * The containing structure should be the same type as 'v'. - * The list should be 'struct list list' within the containing structure. + * The list should be 'struct dm_list list' within the containing structure. * t must be defined as a temporary variable of the same type as v. */ -#define list_iterate_items_safe(v, t, head) \ - list_iterate_items_gen_safe(v, t, (head), list) +#define dm_list_iterate_items_safe(v, t, head) \ + dm_list_iterate_items_gen_safe(v, t, (head), list) /* * Walk a list backwards, setting 'v' in turn to the containing structure * of each item. * The containing structure should be the same type as 'v'. - * The 'struct list' variable within the containing structure is 'field'. + * The 'struct dm_list' variable within the containing structure is 'field'. */ -#define list_iterate_back_items_gen(v, head, field) \ - for (v = list_struct_base((head)->p, typeof(*v), field); \ +#define dm_list_iterate_back_items_gen(v, head, field) \ + for (v = dm_list_struct_base((head)->p, typeof(*v), field); \ &v->field != (head); \ - v = list_struct_base(v->field.p, typeof(*v), field)) + v = dm_list_struct_base(v->field.p, typeof(*v), field)) /* * Walk a list backwards, setting 'v' in turn to the containing structure * of each item. * The containing structure should be the same type as 'v'. - * The list should be 'struct list list' within the containing structure. + * The list should be 'struct dm_list list' within the containing structure. */ -#define list_iterate_back_items(v, head) list_iterate_back_items_gen(v, (head), list) +#define dm_list_iterate_back_items(v, head) dm_list_iterate_back_items_gen(v, (head), list) /* * Return the number of elements in a list by walking it. */ -unsigned int list_size(const struct list *head); +unsigned int dm_list_size(const struct dm_list *head); #endif --- LVM2/lib/datastruct/lvm-types.h 2008/08/01 19:51:27 1.14 +++ LVM2/lib/datastruct/lvm-types.h 2008/11/03 22:14:27 1.15 @@ -27,7 +27,7 @@ #define PRIpid_t PRId32 struct str_list { - struct list list; + struct dm_list list; const char *str; }; --- LVM2/lib/datastruct/str_list.c 2008/01/30 13:19:44 1.10 +++ LVM2/lib/datastruct/str_list.c 2008/11/03 22:14:27 1.11 @@ -16,19 +16,19 @@ #include "lib.h" #include "str_list.h" -struct list *str_list_create(struct dm_pool *mem) +struct dm_list *str_list_create(struct dm_pool *mem) { - struct list *sl; + struct dm_list *sl; - if (!(sl = dm_pool_alloc(mem, sizeof(struct list)))) + if (!(sl = dm_pool_alloc(mem, sizeof(struct dm_list)))) return_NULL; - list_init(sl); + dm_list_init(sl); return sl; } -int str_list_add(struct dm_pool *mem, struct list *sll, const char *str) +int str_list_add(struct dm_pool *mem, struct dm_list *sll, const char *str) { struct str_list *sln; @@ -43,31 +43,31 @@ return_0; sln->str = str; - list_add(sll, &sln->list); + dm_list_add(sll, &sln->list); return 1; } -int str_list_del(struct list *sll, const char *str) +int str_list_del(struct dm_list *sll, const char *str) { - struct list *slh, *slht; + struct dm_list *slh, *slht; - list_iterate_safe(slh, slht, sll) { - if (!strcmp(str, list_item(slh, struct str_list)->str)) - list_del(slh); + dm_list_iterate_safe(slh, slht, sll) { + if (!strcmp(str, dm_list_item(slh, struct str_list)->str)) + dm_list_del(slh); } return 1; } -int str_list_dup(struct dm_pool *mem, struct list *sllnew, - const struct list *sllold) +int str_list_dup(struct dm_pool *mem, struct dm_list *sllnew, + const struct dm_list *sllold) { struct str_list *sl; - list_init(sllnew); + dm_list_init(sllnew); - list_iterate_items(sl, sllold) { + dm_list_iterate_items(sl, sllold) { if (!str_list_add(mem, sllnew, dm_pool_strdup(mem, sl->str))) return_0; } @@ -78,11 +78,11 @@ /* * Is item on list? */ -int str_list_match_item(const struct list *sll, const char *str) +int str_list_match_item(const struct dm_list *sll, const char *str) { struct str_list *sl; - list_iterate_items(sl, sll) + dm_list_iterate_items(sl, sll) if (!strcmp(str, sl->str)) return 1; @@ -92,11 +92,11 @@ /* * Is at least one item on both lists? */ -int str_list_match_list(const struct list *sll, const struct list *sll2) +int str_list_match_list(const struct dm_list *sll, const struct dm_list *sll2) { struct str_list *sl; - list_iterate_items(sl, sll) + dm_list_iterate_items(sl, sll) if (str_list_match_item(sll2, sl->str)) return 1; @@ -106,14 +106,14 @@ /* * Do both lists contain the same set of items? */ -int str_list_lists_equal(const struct list *sll, const struct list *sll2) +int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2) { struct str_list *sl; - if (list_size(sll) != list_size(sll2)) + if (dm_list_size(sll) != dm_list_size(sll2)) return 0; - list_iterate_items(sl, sll) + dm_list_iterate_items(sl, sll) if (!str_list_match_item(sll2, sl->str)) return 0; --- LVM2/lib/datastruct/str_list.h 2007/08/20 20:55:24 1.8 +++ LVM2/lib/datastruct/str_list.h 2008/11/03 22:14:27 1.9 @@ -16,13 +16,13 @@ #ifndef _LVM_STR_LIST_H #define _LVM_STR_LIST_H -struct list *str_list_create(struct dm_pool *mem); -int str_list_add(struct dm_pool *mem, struct list *sll, const char *str); -int str_list_del(struct list *sll, const char *str); -int str_list_match_item(const struct list *sll, const char *str); -int str_list_match_list(const struct list *sll, const struct list *sll2); -int str_list_lists_equal(const struct list *sll, const struct list *sll2); -int str_list_dup(struct dm_pool *mem, struct list *sllnew, - const struct list *sllold); +struct dm_list *str_list_create(struct dm_pool *mem); +int str_list_add(struct dm_pool *mem, struct dm_list *sll, const char *str); +int str_list_del(struct dm_list *sll, const char *str); +int str_list_match_item(const struct dm_list *sll, const char *str); +int str_list_match_list(const struct dm_list *sll, const struct dm_list *sll2); +int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2); +int str_list_dup(struct dm_pool *mem, struct dm_list *sllnew, + const struct dm_list *sllold); #endif --- LVM2/lib/device/dev-cache.c 2008/05/28 22:27:47 1.53 +++ LVM2/lib/device/dev-cache.c 2008/11/03 22:14:27 1.54 @@ -31,7 +31,7 @@ }; struct dir_list { - struct list list; + struct dm_list list; char dir[0]; }; @@ -42,8 +42,8 @@ struct dm_regex *preferred_names_matcher; int has_scanned; - struct list dirs; - struct list files; + struct dm_list dirs; + struct dm_list files; } _cache; @@ -97,15 +97,15 @@ } dev->flags |= DEV_REGULAR; - list_init(&dev->aliases); - list_add(&dev->aliases, &alias->list); + dm_list_init(&dev->aliases); + dm_list_add(&dev->aliases, &alias->list); dev->end = UINT64_C(0); dev->dev = 0; dev->fd = -1; dev->open_count = 0; dev->block_size = -1; memset(dev->pvid, 0, sizeof(dev->pvid)); - list_init(&dev->open_list); + dm_list_init(&dev->open_list); return dev; } @@ -119,14 +119,14 @@ return NULL; } dev->flags = 0; - list_init(&dev->aliases); + dm_list_init(&dev->aliases); dev->dev = d; dev->fd = -1; dev->open_count = 0; dev->block_size = -1; dev->end = UINT64_C(0); memset(dev->pvid, 0, sizeof(dev->pvid)); - list_init(&dev->open_list); + dm_list_init(&dev->open_list); return dev; } @@ -140,8 +140,8 @@ return; log_debug("%s: New preferred name", sl->str); - list_del(&sl->list); - list_add_h(&dev->aliases, &sl->list); + dm_list_del(&sl->list); + dm_list_add_h(&dev->aliases, &sl->list); } /* Return 1 if we prefer path1 else return 0 */ @@ -240,7 +240,7 @@ return_0; /* Is name already there? */ - list_iterate_items(strl, &dev->aliases) { + dm_list_iterate_items(strl, &dev->aliases) { if (!strcmp(strl->str, path)) { log_debug("%s: Already in device cache", path); return 1; @@ -250,8 +250,8 @@ if (!(sl->str = dm_pool_strdup(_cache.mem, path))) return_0; - if (!list_empty(&dev->aliases)) { - oldpath = list_item(dev->aliases.n, struct str_list)->str; + if (!dm_list_empty(&dev->aliases)) { + oldpath = dm_list_item(dev->aliases.n, struct str_list)->str; prefer_old = _compare_paths(path, oldpath); log_debug("%s: Aliased to %s in device cache%s", path, oldpath, prefer_old ? "" : " (preferred name)"); @@ -260,9 +260,9 @@ log_debug("%s: Added to device cache", path); if (prefer_old) - list_add(&dev->aliases, &sl->list); + dm_list_add(&dev->aliases, &sl->list); else - list_add_h(&dev->aliases, &sl->list); + dm_list_add_h(&dev->aliases, &sl->list); return 1; } @@ -443,10 +443,10 @@ if (_cache.has_scanned && !dev_scan) return; - list_iterate_items(dl, &_cache.dirs) + dm_list_iterate_items(dl, &_cache.dirs) _insert_dir(dl->dir); - list_iterate_items(dl, &_cache.files) + dm_list_iterate_items(dl, &_cache.files) _insert_file(dl->dir); _cache.has_scanned = 1; @@ -543,8 +543,8 @@ goto bad; } - list_init(&_cache.dirs); - list_init(&_cache.files); + dm_list_init(&_cache.dirs); + dm_list_init(&_cache.files); if (!_init_preferred_names(cmd)) goto_bad; @@ -587,8 +587,8 @@ _cache.devices = NULL; _cache.has_scanned = 0; - list_init(&_cache.dirs); - list_init(&_cache.files); + dm_list_init(&_cache.dirs); + dm_list_init(&_cache.files); } int dev_cache_add_dir(const char *path) @@ -613,7 +613,7 @@ } strcpy(dl->dir, path); - list_add(&_cache.dirs, &dl->list); + dm_list_add(&_cache.dirs, &dl->list); return 1; } @@ -639,7 +639,7 @@ } strcpy(dl->dir, path); - list_add(&_cache.files, &dl->list); + dm_list_add(&_cache.files, &dl->list); return 1; } @@ -656,7 +656,7 @@ if ((dev->flags & DEV_REGULAR)) return dev_name(dev); - while ((r = stat(name = list_item(dev->aliases.n, + while ((r = stat(name = dm_list_item(dev->aliases.n, struct str_list)->str, &buf)) || (buf.st_rdev != dev->dev)) { if (r < 0) { @@ -680,8 +680,8 @@ /* Leave list alone if there isn't an alternative name */ /* so dev_name will always find something to return. */ /* Otherwise add the name to the correct device. */ - if (list_size(&dev->aliases) > 1) { - list_del(dev->aliases.n); + if (dm_list_size(&dev->aliases) > 1) { + dm_list_del(dev->aliases.n); if (!r) _insert(name, 0); continue; @@ -776,6 +776,6 @@ const char *dev_name(const struct device *dev) { - return (dev) ? list_item(dev->aliases.n, struct str_list)->str : + return (dev) ? dm_list_item(dev->aliases.n, struct str_list)->str : "unknown device"; } --- LVM2/lib/device/dev-io.c 2008/01/30 13:59:58 1.62 +++ LVM2/lib/device/dev-io.c 2008/11/03 22:14:27 1.63 @@ -51,7 +51,7 @@ # endif #endif -static LIST_INIT(_open_devices); +static DM_LIST_INIT(_open_devices); /*----------------------------------------------------------------- * The standard io loop that keeps submitting an io until it's @@ -431,7 +431,7 @@ if ((flags & O_CREAT) && !(flags & O_TRUNC)) dev->end = lseek(dev->fd, (off_t) 0, SEEK_END); - list_add(&_open_devices, &dev->open_list); + dm_list_add(&_open_devices, &dev->open_list); log_debug("Opened %s %s%s%s", dev_name(dev), dev->flags & DEV_OPENED_RW ? "RW" : "RO", @@ -480,12 +480,12 @@ log_sys_error("close", dev_name(dev)); dev->fd = -1; dev->block_size = -1; - list_del(&dev->open_list); + dm_list_del(&dev->open_list); log_debug("Closed %s", dev_name(dev)); if (dev->flags & DEV_ALLOCED) { - dm_free((void *) list_item(dev->aliases.n, struct str_list)-> + dm_free((void *) dm_list_item(dev->aliases.n, struct str_list)-> str); dm_free(dev->aliases.n); dm_free(dev); @@ -537,11 +537,11 @@ void dev_close_all(void) { - struct list *doh, *doht; + struct dm_list *doh, *doht; struct device *dev; - list_iterate_safe(doh, doht, &_open_devices) { - dev = list_struct_base(doh, struct device, open_list); + dm_list_iterate_safe(doh, doht, &_open_devices) { + dev = dm_list_struct_base(doh, struct device, open_list); if (dev->open_count < 1) _close(dev); } --- LVM2/lib/device/device.h 2008/09/19 05:19:09 1.36 +++ LVM2/lib/device/device.h 2008/11/03 22:14:27 1.37 @@ -33,7 +33,7 @@ * pointer comparisons are valid. */ struct device { - struct list aliases; /* struct str_list from lvm-types.h */ + struct dm_list aliases; /* struct str_list from lvm-types.h */ dev_t dev; /* private */ @@ -42,14 +42,14 @@ int block_size; uint32_t flags; uint64_t end; - struct list open_list; + struct dm_list open_list; char pvid[ID_LEN + 1]; char _padding[7]; }; struct device_list { - struct list list; + struct dm_list list; struct device *dev; }; --- LVM2/lib/display/display.c 2008/11/03 18:59:58 1.93 +++ LVM2/lib/display/display.c 2008/11/03 22:14:28 1.94 @@ -266,7 +266,7 @@ if (pv->pe_size) log_print("--- Physical Segments ---"); - list_iterate_items(pvseg, &pv->segments) { + dm_list_iterate_items(pvseg, &pv->segments) { log_print("Physical extent %u to %u:", pvseg->pe, pvseg->pe + pvseg->len - 1); @@ -425,7 +425,7 @@ if (lv_is_origin(lv)) { log_print("LV snapshot status source of"); - list_iterate_items_gen(snap_seg, &lv->snapshot_segs, + dm_list_iterate_items_gen(snap_seg, &lv->snapshot_segs, origin_list) { if (inkernel && (snap_active = lv_snapshot_percent(snap_seg->cow, @@ -483,7 +483,7 @@ display_size(cmd, (uint64_t) snap_seg->chunk_size)); } - log_print("Segments %u", list_size(&lv->segments)); + log_print("Segments %u", dm_list_size(&lv->segments)); /********* FIXME Stripes & stripesize for each segment log_print("Stripe size (KByte) %u", lv->stripesize / 2); @@ -551,7 +551,7 @@ log_print("--- Segments ---"); - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { log_print("Logical extent %u to %u:", seg->le, seg->le + seg->len - 1); @@ -586,7 +586,7 @@ log_print("Format %s", vg->fid->fmt->name); if (vg->fid->fmt->features & FMT_MDAS) { log_print("Metadata Areas %d", - list_size(&vg->fid->metadata_areas)); + dm_list_size(&vg->fid->metadata_areas)); log_print("Metadata Sequence No %d", vg->seqno); } access_str = vg->status & (LVM_READ | LVM_WRITE); @@ -607,7 +607,7 @@ vg->status & SHARED ? "yes" : "no"); } - list_iterate_items(lvl, &vg->lvs) + dm_list_iterate_items(lvl, &vg->lvs) if (lv_is_visible(lvl->lv) && !(lvl->lv->status & SNAPSHOT)) lv_count++; @@ -663,7 +663,7 @@ active_pvs = vg->pv_count - vg_missing_pv_count(vg); - list_iterate_items(lvl, &vg->lvs) + dm_list_iterate_items(lvl, &vg->lvs) if (lv_is_visible(lvl->lv) && !(lvl->lv->status & SNAPSHOT)) lv_count++; @@ -726,7 +726,7 @@ { const struct format_type *fmt; - list_iterate_items(fmt, &cmd->formats) { + dm_list_iterate_items(fmt, &cmd->formats) { log_print("%s", fmt->name); } } @@ -735,7 +735,7 @@ { const struct segment_type *segtype; - list_iterate_items(segtype, &cmd->segtypes) { + dm_list_iterate_items(segtype, &cmd->segtypes) { log_print("%s", segtype->name); } } --- LVM2/lib/error/errseg.c 2008/04/07 10:23:46 1.17 +++ LVM2/lib/error/errseg.c 2008/11/03 22:14:28 1.18 @@ -69,7 +69,7 @@ static int _errseg_modules_needed(struct dm_pool *mem, const struct lv_segment *seg __attribute((unused)), - struct list *modules) + struct dm_list *modules) { if (!str_list_add(mem, modules, "error")) { log_error("error module string list allocation failed"); --- LVM2/lib/filters/filter-persistent.c 2008/03/12 16:03:21 1.36 +++ LVM2/lib/filters/filter-persistent.c 2008/11/03 22:14:28 1.37 @@ -273,7 +273,7 @@ l = pf->real->passes_filter(pf->real, dev) ? PF_GOOD_DEVICE : PF_BAD_DEVICE; - list_iterate_items(sl, &dev->aliases) + dm_list_iterate_items(sl, &dev->aliases) dm_hash_insert(pf->devices, sl->str, l); } else if (l == PF_BAD_DEVICE) --- LVM2/lib/filters/filter-regex.c 2008/01/30 13:59:58 1.25 +++ LVM2/lib/filters/filter-regex.c 2008/11/03 22:14:28 1.26 @@ -151,7 +151,7 @@ struct rfilter *rf = (struct rfilter *) f->private; struct str_list *sl; - list_iterate_items(sl, &dev->aliases) { + dm_list_iterate_items(sl, &dev->aliases) { m = dm_regex_match(rf->engine, sl->str); if (m >= 0) { --- LVM2/lib/format1/Makefile.in 2007/09/21 10:16:44 1.9 +++ LVM2/lib/format1/Makefile.in 2008/11/03 22:14:28 1.10 @@ -26,6 +26,7 @@ vg_number.c LIB_SHARED = liblvm2format1.so +LIB_VERSION = $(LIB_VERSION_LVM) include $(top_srcdir)/make.tmpl --- LVM2/lib/format1/disk-rep.c 2008/11/03 16:26:27 1.77 +++ LVM2/lib/format1/disk-rep.c 2008/11/03 22:14:28 1.78 @@ -261,7 +261,7 @@ memcpy(ul->uuid, buffer, NAME_LEN); ul->uuid[NAME_LEN - 1] = '\0'; - list_add(&data->uuids, &ul->list); + dm_list_add(&data->uuids, &ul->list); pos += NAME_LEN; num_read++; @@ -296,7 +296,7 @@ continue; lvs_read++; - list_add(&data->lvds, &ll->list); + dm_list_add(&data->lvds, &ll->list); } return 1; @@ -336,7 +336,7 @@ } info->device_size = xlate32(dl->pvd.pv_size) << SECTOR_SHIFT; - list_init(&info->mdas); + dm_list_init(&info->mdas); info->status &= ~CACHE_INVALID; } @@ -352,8 +352,8 @@ dl->dev = dev; dl->mem = mem; - list_init(&dl->uuids); - list_init(&dl->lvds); + dm_list_init(&dl->uuids); + dm_list_init(&dl->lvds); if (!_read_pvd(dev, &dl->pvd)) goto_bad; @@ -426,12 +426,12 @@ return dl; } -static void _add_pv_to_list(struct list *head, struct disk_list *data) +static void _add_pv_to_list(struct dm_list *head, struct disk_list *data) { struct pv_disk *pvd; struct disk_list *diskl; - list_iterate_items(diskl, head) { + dm_list_iterate_items(diskl, head) { pvd = &diskl->pvd; if (!strncmp((char *)data->pvd.pv_uuid, (char *)pvd->pv_uuid, sizeof(pvd->pv_uuid))) { @@ -443,11 +443,11 @@ } log_very_verbose("Duplicate PV %s - using md %s", pvd->pv_uuid, dev_name(data->dev)); - list_del(&diskl->list); + dm_list_del(&diskl->list); break; } } - list_add(head, &data->list); + dm_list_add(head, &data->list); } /* @@ -457,7 +457,7 @@ */ int read_pvs_in_vg(const struct format_type *fmt, const char *vg_name, struct dev_filter *filter, struct dm_pool *mem, - struct list *head) + struct dm_list *head) { struct dev_iter *iter; struct device *dev; @@ -468,7 +468,7 @@ /* Fast path if we already saw this VG and cached the list of PVs */ if (vg_name && (vginfo = vginfo_from_vgname(vg_name, NULL)) && vginfo->infos.n) { - list_iterate_items(info, &vginfo->infos) { + dm_list_iterate_items(info, &vginfo->infos) { dev = info->dev; if (dev && !(data = read_disk(fmt, dev, mem, vg_name))) break; @@ -478,11 +478,11 @@ /* Did we find the whole VG? */ if (!vg_name || is_orphan_vg(vg_name) || (data && *data->pvd.vg_name && - list_size(head) == data->vgd.pv_cur)) + dm_list_size(head) == data->vgd.pv_cur)) return 1; /* Failed */ - list_init(head); + dm_list_init(head); /* vgcache_del(vg_name); */ } @@ -499,7 +499,7 @@ } dev_iter_destroy(iter); - if (list_empty(head)) + if (dm_list_empty(head)) return 0; return 1; @@ -528,7 +528,7 @@ uint64_t pos = data->pvd.pv_uuidlist_on_disk.base; uint64_t end = pos + data->pvd.pv_uuidlist_on_disk.size; - list_iterate_items(ul, &data->uuids) { + dm_list_iterate_items(ul, &data->uuids) { if (pos >= end) { log_error("Too many uuids to fit on %s", dev_name(data->dev)); @@ -576,7 +576,7 @@ return 0; } - list_iterate_items(ll, &data->lvds) { + dm_list_iterate_items(ll, &data->lvds) { offset = sizeof(struct lv_disk) * ll->lvd.lv_number; if (offset + sizeof(struct lv_disk) > data->pvd.lv_on_disk.size) { log_error("lv_number %d too large", ll->lvd.lv_number); @@ -719,11 +719,11 @@ * little sanity checking, so make sure correct * data is passed to here. */ -int write_disks(const struct format_type *fmt, struct list *pvs) +int write_disks(const struct format_type *fmt, struct dm_list *pvs) { struct disk_list *dl; - list_iterate_items(dl, pvs) { + dm_list_iterate_items(dl, pvs) { if (!(_write_all_pvd(fmt, dl))) return_0; --- LVM2/lib/format1/disk-rep.h 2008/09/19 06:41:58 1.52 +++ LVM2/lib/format1/disk-rep.h 2008/11/03 22:14:28 1.53 @@ -147,24 +147,24 @@ } __attribute__ ((packed)); struct uuid_list { - struct list list; + struct dm_list list; char uuid[NAME_LEN] __attribute((aligned(8))); }; struct lvd_list { - struct list list; + struct dm_list list; struct lv_disk lvd; }; struct disk_list { - struct list list; + struct dm_list list; struct dm_pool *mem; struct device *dev; struct pv_disk pvd __attribute((aligned(8))); struct vg_disk vgd __attribute((aligned(8))); - struct list uuids __attribute((aligned(8))); - struct list lvds __attribute((aligned(8))); + struct dm_list uuids __attribute((aligned(8))); + struct dm_list lvds __attribute((aligned(8))); struct pe_disk *extents __attribute((aligned(8))); }; @@ -195,9 +195,9 @@ int read_pvs_in_vg(const struct format_type *fmt, const char *vg_name, struct dev_filter *filter, - struct dm_pool *mem, struct list *results); + struct dm_pool *mem, struct dm_list *results); -int write_disks(const struct format_type *fmt, struct list *pvds); +int write_disks(const struct format_type *fmt, struct dm_list *pvds); /* * Functions to translate to between disk and in @@ -218,33 +218,33 @@ int import_lv(struct dm_pool *mem, struct logical_volume *lv, struct lv_disk *lvd); int import_extents(struct cmd_context *cmd, struct volume_group *vg, - struct list *pvds); + struct dm_list *pvds); int export_extents(struct disk_list *dl, uint32_t lv_num, struct logical_volume *lv, struct physical_volume *pv); int import_pvs(const struct format_type *fmt, struct dm_pool *mem, struct volume_group *vg, - struct list *pvds, struct list *results, uint32_t *count); + struct dm_list *pvds, struct dm_list *results, uint32_t *count); -int import_lvs(struct dm_pool *mem, struct volume_group *vg, struct list *pvds); +int import_lvs(struct dm_pool *mem, struct volume_group *vg, struct dm_list *pvds); int export_lvs(struct disk_list *dl, struct volume_group *vg, struct physical_volume *pv, const char *dev_dir); int import_snapshots(struct dm_pool *mem, struct volume_group *vg, - struct list *pvds); + struct dm_list *pvds); int export_uuids(struct disk_list *dl, struct volume_group *vg); -void export_numbers(struct list *pvds, struct volume_group *vg); +void export_numbers(struct dm_list *pvds, struct volume_group *vg); -void export_pv_act(struct list *pvds); +void export_pv_act(struct dm_list *pvds); int munge_pvd(struct device *dev, struct pv_disk *pvd); int read_vgd(struct device *dev, struct vg_disk *vgd, struct pv_disk *pvd); /* blech */ int get_free_vg_number(struct format_instance *fid, struct dev_filter *filter, const char *candidate_vg, int *result); -int export_vg_number(struct format_instance *fid, struct list *pvds, +int export_vg_number(struct format_instance *fid, struct dm_list *pvds, const char *vg_name, struct dev_filter *filter); #endif --- LVM2/lib/format1/format1.c 2008/09/19 06:41:58 1.108 +++ LVM2/lib/format1/format1.c 2008/11/03 22:14:28 1.109 @@ -23,9 +23,9 @@ #include "segtype.h" /* VG consistency checks */ -static int _check_vgs(struct list *pvs) +static int _check_vgs(struct dm_list *pvs) { - struct list *pvh, *t; + struct dm_list *pvh, *t; struct disk_list *dl = NULL; struct disk_list *first = NULL; @@ -38,7 +38,7 @@ * This means an active VG won't be affected if disks are inserted * bearing an exported VG with the same name. */ - list_iterate_items(dl, pvs) { + dm_list_iterate_items(dl, pvs) { if (first_time) { exported = dl->pvd.pv_status & VG_EXPORTED; first_time = 0; @@ -47,18 +47,18 @@ if (exported != (dl->pvd.pv_status & VG_EXPORTED)) { /* Remove exported PVs */ - list_iterate_safe(pvh, t, pvs) { - dl = list_item(pvh, struct disk_list); + dm_list_iterate_safe(pvh, t, pvs) { + dl = dm_list_item(pvh, struct disk_list); if (dl->pvd.pv_status & VG_EXPORTED) - list_del(pvh); + dm_list_del(pvh); } break; } } /* Remove any PVs with VG structs that differ from the first */ - list_iterate_safe(pvh, t, pvs) { - dl = list_item(pvh, struct disk_list); + dm_list_iterate_safe(pvh, t, pvs) { + dl = dm_list_item(pvh, struct disk_list); if (!first) first = dl; @@ -95,7 +95,7 @@ dl->vgd.vgda, dl->vgd.pe_size, dl->vgd.pe_total, dl->vgd.pe_allocated, dl->vgd.pvg_total); - list_del(pvh); + dm_list_del(pvh); return 0; } pv_count++; @@ -111,7 +111,7 @@ } static struct volume_group *_build_vg(struct format_instance *fid, - struct list *pvs) + struct dm_list *pvs) { struct dm_pool *mem = fid->fmt->cmd->mem; struct volume_group *vg = dm_pool_alloc(mem, sizeof(*vg)); @@ -120,7 +120,7 @@ if (!vg) goto_bad; - if (list_empty(pvs)) + if (dm_list_empty(pvs)) goto_bad; memset(vg, 0, sizeof(*vg)); @@ -128,14 +128,14 @@ vg->cmd = fid->fmt->cmd; vg->fid = fid; vg->seqno = 0; - list_init(&vg->pvs); - list_init(&vg->lvs); - list_init(&vg->tags); + dm_list_init(&vg->pvs); + dm_list_init(&vg->lvs); + dm_list_init(&vg->tags); if (!_check_vgs(pvs)) goto_bad; - dl = list_item(pvs->n, struct disk_list); + dl = dm_list_item(pvs->n, struct disk_list); if (!import_vg(mem, vg, dl)) goto_bad; @@ -164,9 +164,9 @@ struct metadata_area *mda __attribute((unused))) { struct dm_pool *mem = dm_pool_create("lvm1 vg_read", 1024 * 10); - struct list pvs; + struct dm_list pvs; struct volume_group *vg = NULL; - list_init(&pvs); + dm_list_init(&pvs); if (!mem) return_NULL; @@ -199,8 +199,8 @@ dl->mem = mem; dl->dev = pv->dev; - list_init(&dl->uuids); - list_init(&dl->lvds); + dm_list_init(&dl->uuids); + dm_list_init(&dl->lvds); if (!export_pv(fid->fmt->cmd, mem, vg, &dl->pvd, pv) || !export_vg(&dl->vgd, vg) || @@ -215,17 +215,17 @@ static int _flatten_vg(struct format_instance *fid, struct dm_pool *mem, struct volume_group *vg, - struct list *pvds, const char *dev_dir, + struct dm_list *pvds, const char *dev_dir, struct dev_filter *filter) { struct pv_list *pvl; struct disk_list *data; - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (!(data = _flatten_pv(fid, mem, vg, pvl->pv, dev_dir))) return_0; - list_add(pvds, &data->list); + dm_list_add(pvds, &data->list); } export_numbers(pvds, vg); @@ -241,13 +241,13 @@ struct metadata_area *mda __attribute((unused))) { struct dm_pool *mem = dm_pool_create("lvm1 vg_write", 1024 * 10); - struct list pvds; + struct dm_list pvds; int r = 0; if (!mem) return_0; - list_init(&pvds); + dm_list_init(&pvds); r = (_flatten_vg(fid, mem, vg, &pvds, fid->fmt->cmd->dev_dir, fid->fmt->cmd->filter) && @@ -259,7 +259,7 @@ } static int _format1_pv_read(const struct format_type *fmt, const char *pv_name, - struct physical_volume *pv, struct list *mdas __attribute((unused))) + struct physical_volume *pv, struct dm_list *mdas __attribute((unused))) { struct dm_pool *mem = dm_pool_create("lvm1 pv_read", 1024); struct disk_list *dl; @@ -293,7 +293,7 @@ uint64_t pe_start, uint32_t extent_count, uint32_t extent_size, int pvmetadatacopies __attribute((unused)), - uint64_t pvmetadatasize __attribute((unused)), struct list *mdas __attribute((unused)), + uint64_t pvmetadatasize __attribute((unused)), struct dm_list *mdas __attribute((unused)), struct physical_volume *pv, struct volume_group *vg __attribute((unused))) { if (pv->size > MAX_PV_SIZE) @@ -346,11 +346,11 @@ } static int _format1_pv_write(const struct format_type *fmt, struct physical_volume *pv, - struct list *mdas __attribute((unused)), int64_t sector __attribute((unused))) + struct dm_list *mdas __attribute((unused)), int64_t sector __attribute((unused))) { struct dm_pool *mem; struct disk_list *dl; - struct list pvs; + struct dm_list pvs; struct label *label; struct lvmcache_info *info; @@ -361,9 +361,9 @@ info->device_size = pv->size << SECTOR_SHIFT; info->fmt = fmt; - list_init(&info->mdas); + dm_list_init(&info->mdas); - list_init(&pvs); + dm_list_init(&pvs); /* Ensure any residual PE structure is gone */ pv->pe_size = pv->pe_count = 0; @@ -387,7 +387,7 @@ dl->pvd.pv_on_disk.size = PV_SIZE; dl->pvd.pe_on_disk.base = LVM1_PE_ALIGN << SECTOR_SHIFT; - list_add(&pvs, &dl->list); + dm_list_add(&pvs, &dl->list); if (!write_disks(fmt, &pvs)) goto_bad; @@ -457,7 +457,7 @@ return_NULL; fid->fmt = fmt; - list_init(&fid->metadata_areas); + dm_list_init(&fid->metadata_areas); /* Define a NULL metadata area */ if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda)))) { @@ -467,7 +467,7 @@ mda->ops = &_metadata_format1_ops; mda->metadata_locn = NULL; - list_add(&fid->metadata_areas, &mda->list); + dm_list_add(&fid->metadata_areas, &mda->list); return fid; } --- LVM2/lib/format1/import-export.c 2008/09/19 06:41:58 1.99 +++ LVM2/lib/format1/import-export.c 2008/11/03 22:14:28 1.100 @@ -116,8 +116,8 @@ } } - list_init(&pv->tags); - list_init(&pv->segments); + dm_list_init(&pv->tags); + dm_list_init(&pv->segments); if (!alloc_pv_segment_whole_pv(mem, pv)) return_0; @@ -339,10 +339,10 @@ lv->le_count = lvd->lv_allocated_le; lv->snapshot = NULL; - list_init(&lv->snapshot_segs); - list_init(&lv->segments); - list_init(&lv->tags); - list_init(&lv->segs_using_this_lv); + dm_list_init(&lv->snapshot_segs); + dm_list_init(&lv->segments); + dm_list_init(&lv->tags); + dm_list_init(&lv->segs_using_this_lv); return 1; } @@ -379,9 +379,9 @@ lvd->lv_read_ahead = lv->read_ahead; lvd->lv_stripes = - list_item(lv->segments.n, struct lv_segment)->area_count; + dm_list_item(lv->segments.n, struct lv_segment)->area_count; lvd->lv_stripesize = - list_item(lv->segments.n, struct lv_segment)->stripe_size; + dm_list_item(lv->segments.n, struct lv_segment)->stripe_size; lvd->lv_size = lv->size; lvd->lv_allocated_le = lv->le_count; @@ -400,7 +400,7 @@ struct lv_segment *seg; uint32_t pe, s; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { for (s = 0; s < seg->area_count; s++) { if (!(seg->segtype->flags & SEG_FORMAT1_SUPPORT)) { log_error("Segment type %s in LV %s: " @@ -430,13 +430,13 @@ int import_pvs(const struct format_type *fmt, struct dm_pool *mem, struct volume_group *vg, - struct list *pvds, struct list *results, uint32_t *count) + struct dm_list *pvds, struct dm_list *results, uint32_t *count) { struct disk_list *dl; struct pv_list *pvl; *count = 0; - list_iterate_items(dl, pvds) { + dm_list_iterate_items(dl, pvds) { if (!(pvl = dm_pool_zalloc(mem, sizeof(*pvl))) || !(pvl->pv = dm_pool_alloc(mem, sizeof(*pvl->pv)))) return_0; @@ -445,7 +445,7 @@ return_0; pvl->pv->fmt = fmt; - list_add(results, &pvl->list); + dm_list_add(results, &pvl->list); (*count)++; } @@ -468,20 +468,20 @@ if (!import_lv(mem, lv, lvd)) return_NULL; - list_add(&vg->lvs, &ll->list); + dm_list_add(&vg->lvs, &ll->list); vg->lv_count++; return lv; } -int import_lvs(struct dm_pool *mem, struct volume_group *vg, struct list *pvds) +int import_lvs(struct dm_pool *mem, struct volume_group *vg, struct dm_list *pvds) { struct disk_list *dl; struct lvd_list *ll; struct lv_disk *lvd; - list_iterate_items(dl, pvds) { - list_iterate_items(ll, &dl->lvds) { + dm_list_iterate_items(dl, pvds) { + dm_list_iterate_items(ll, &dl->lvds) { lvd = &ll->lvd; if (!find_lv(vg, (char *)lvd->lv_name) && @@ -518,7 +518,7 @@ goto_out; memset(dl->extents, 0, len); - list_iterate_items(ll, &vg->lvs) { + dm_list_iterate_items(ll, &vg->lvs) { if (ll->lv->status & SNAPSHOT) continue; @@ -546,7 +546,7 @@ lvnum_from_lvid(&ll->lv->snapshot->origin->lvid); } - list_add(&dl->lvds, &lvdl->list); + dm_list_add(&dl->lvds, &lvdl->list); dl->pvd.lv_cur++; } @@ -561,7 +561,7 @@ * FIXME: More inefficient code. */ int import_snapshots(struct dm_pool *mem __attribute((unused)), struct volume_group *vg, - struct list *pvds) + struct dm_list *pvds) { struct logical_volume *lvs[MAX_LV]; struct disk_list *dl; @@ -572,8 +572,8 @@ /* build an index of lv numbers */ memset(lvs, 0, sizeof(lvs)); - list_iterate_items(dl, pvds) { - list_iterate_items(ll, &dl->lvds) { + dm_list_iterate_items(dl, pvds) { + dm_list_iterate_items(ll, &dl->lvds) { lvd = &ll->lvd; lvnum = lvd->lv_number; @@ -596,8 +596,8 @@ /* * Now iterate through yet again adding the snapshots. */ - list_iterate_items(dl, pvds) { - list_iterate_items(ll, &dl->lvds) { + dm_list_iterate_items(dl, pvds) { + dm_list_iterate_items(ll, &dl->lvds) { lvd = &ll->lvd; if (!(lvd->lv_access & LV_SNAPSHOT)) @@ -633,14 +633,14 @@ struct uuid_list *ul; struct pv_list *pvl; - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (!(ul = dm_pool_alloc(dl->mem, sizeof(*ul)))) return_0; memset(ul->uuid, 0, sizeof(ul->uuid)); memcpy(ul->uuid, pvl->pv->id.uuid, ID_LEN); - list_add(&dl->uuids, &ul->list); + dm_list_add(&dl->uuids, &ul->list); } return 1; } @@ -649,32 +649,32 @@ * This calculates the nasty pv_number field * used by LVM1. */ -void export_numbers(struct list *pvds, struct volume_group *vg __attribute((unused))) +void export_numbers(struct dm_list *pvds, struct volume_group *vg __attribute((unused))) { struct disk_list *dl; int pv_num = 1; - list_iterate_items(dl, pvds) + dm_list_iterate_items(dl, pvds) dl->pvd.pv_number = pv_num++; } /* * Calculate vg_disk->pv_act. */ -void export_pv_act(struct list *pvds) +void export_pv_act(struct dm_list *pvds) { struct disk_list *dl; int act = 0; - list_iterate_items(dl, pvds) + dm_list_iterate_items(dl, pvds) if (dl->pvd.pv_status & PV_ACTIVE) act++; - list_iterate_items(dl, pvds) + dm_list_iterate_items(dl, pvds) dl->vgd.pv_act = act; } -int export_vg_number(struct format_instance *fid, struct list *pvds, +int export_vg_number(struct format_instance *fid, struct dm_list *pvds, const char *vg_name, struct dev_filter *filter) { struct disk_list *dl; @@ -683,7 +683,7 @@ if (!get_free_vg_number(fid, filter, vg_name, &vg_num)) return_0; - list_iterate_items(dl, pvds) + dm_list_iterate_items(dl, pvds) dl->vgd.vg_number = vg_num; return 1; --- LVM2/lib/format1/import-extents.c 2008/01/30 13:59:59 1.36 +++ LVM2/lib/format1/import-extents.c 2008/11/03 22:14:28 1.37 @@ -55,7 +55,7 @@ return NULL; } - list_iterate_items(ll, &vg->lvs) { + dm_list_iterate_items(ll, &vg->lvs) { if (ll->lv->status & SNAPSHOT) continue; @@ -86,7 +86,7 @@ memset(lvs, 0, sizeof(*lvs) * MAX_LV); - list_iterate_items(ll, &dl->lvds) { + dm_list_iterate_items(ll, &dl->lvds) { if (!(lvm = dm_hash_lookup(maps, strrchr((char *)ll->lvd.lv_name, '/') + 1))) { log_err("Physical volume (%s) contains an " @@ -105,7 +105,7 @@ } static int _fill_maps(struct dm_hash_table *maps, struct volume_group *vg, - struct list *pvds) + struct dm_list *pvds) { struct disk_list *dl; struct physical_volume *pv; @@ -113,7 +113,7 @@ struct pe_disk *e; uint32_t i, lv_num, le; - list_iterate_items(dl, pvds) { + dm_list_iterate_items(dl, pvds) { pv = find_pv(vg, dl->dev); e = dl->extents; @@ -228,7 +228,7 @@ lvm->map[le].pe)) return_0; - list_add(&lvm->lv->segments, &seg->list); + dm_list_add(&lvm->lv->segments, &seg->list); le += seg->len; } @@ -307,7 +307,7 @@ lvm->map[first_area_le + st * total_area_len].pe)) return_0; - list_add(&lvm->lv->segments, &seg->list); + dm_list_add(&lvm->lv->segments, &seg->list); first_area_le += area_len; } @@ -336,7 +336,7 @@ } int import_extents(struct cmd_context *cmd, struct volume_group *vg, - struct list *pvds) + struct dm_list *pvds) { int r = 0; struct dm_pool *scratch = dm_pool_create("lvm1 import_extents", 10 * 1024); --- LVM2/lib/format1/lvm1-label.c 2008/02/06 15:47:27 1.19 +++ LVM2/lib/format1/lvm1-label.c 2008/11/03 22:14:28 1.20 @@ -80,7 +80,7 @@ *label = info->label; info->device_size = xlate32(pvd->pv_size) << SECTOR_SHIFT; - list_init(&info->mdas); + dm_list_init(&info->mdas); info->status &= ~CACHE_INVALID; --- LVM2/lib/format1/vg_number.c 2008/01/30 13:59:59 1.15 +++ LVM2/lib/format1/vg_number.c 2008/11/03 22:14:28 1.16 @@ -26,12 +26,12 @@ int get_free_vg_number(struct format_instance *fid, struct dev_filter *filter, const char *candidate_vg, int *result) { - struct list all_pvs; + struct dm_list all_pvs; struct disk_list *dl; struct dm_pool *mem = dm_pool_create("lvm1 vg_number", 10 * 1024); int numbers[MAX_VG], i, r = 0; - list_init(&all_pvs); + dm_list_init(&all_pvs); if (!mem) return_0; @@ -41,7 +41,7 @@ memset(numbers, 0, sizeof(numbers)); - list_iterate_items(dl, &all_pvs) { + dm_list_iterate_items(dl, &all_pvs) { if (!*dl->pvd.vg_name || !strcmp((char *)dl->pvd.vg_name, candidate_vg)) continue; --- LVM2/lib/format_pool/Makefile.in 2007/09/21 10:16:44 1.5 +++ LVM2/lib/format_pool/Makefile.in 2008/11/03 22:14:28 1.6 @@ -23,6 +23,7 @@ pool_label.c LIB_SHARED = liblvm2formatpool.so +LIB_VERSION = $(LIB_VERSION_LVM) include $(top_srcdir)/make.tmpl --- LVM2/lib/format_pool/disk_rep.c 2008/01/30 13:59:59 1.13 +++ LVM2/lib/format_pool/disk_rep.c 2008/11/03 22:14:28 1.14 @@ -51,11 +51,11 @@ return 1; } -static void _add_pl_to_list(struct list *head, struct pool_list *data) +static void _add_pl_to_list(struct dm_list *head, struct pool_list *data) { struct pool_list *pl; - list_iterate_items(pl, head) { + dm_list_iterate_items(pl, head) { if (id_equal(&data->pv_uuid, &pl->pv_uuid)) { char uuid[ID_LEN + 7] __attribute((aligned(8))); @@ -69,11 +69,11 @@ } log_very_verbose("Duplicate PV %s - using md %s", uuid, dev_name(data->dev)); - list_del(&pl->list); + dm_list_del(&pl->list); break; } } - list_add(head, &data->list); + dm_list_add(head, &data->list); } int read_pool_label(struct pool_list *pl, struct labeller *l, @@ -102,7 +102,7 @@ *label = info->label; info->device_size = xlate32_be(pd->pl_blocks) << SECTOR_SHIFT; - list_init(&info->mdas); + dm_list_init(&info->mdas); info->status &= ~CACHE_INVALID; @@ -235,7 +235,7 @@ } static int _read_vg_pds(const struct format_type *fmt, struct dm_pool *mem, - struct lvmcache_vginfo *vginfo, struct list *head, + struct lvmcache_vginfo *vginfo, struct dm_list *head, uint32_t *devcount) { struct lvmcache_info *info; @@ -251,7 +251,7 @@ if (!(tmpmem = dm_pool_create("pool read_vg", 512))) return_0; - list_iterate_items(info, &vginfo->infos) { + dm_list_iterate_items(info, &vginfo->infos) { if (info->dev && !(pl = read_pool_disk(fmt, info->dev, mem, vginfo->vgname))) break; @@ -298,7 +298,7 @@ } int read_pool_pds(const struct format_type *fmt, const char *vg_name, - struct dm_pool *mem, struct list *pdhead) + struct dm_pool *mem, struct dm_list *pdhead) { struct lvmcache_vginfo *vginfo; uint32_t totaldevs; @@ -316,7 +316,7 @@ * If we found all the devices we were * expecting, return success */ - if (list_size(pdhead) == totaldevs) + if (dm_list_size(pdhead) == totaldevs) return 1; /* @@ -328,7 +328,7 @@ } } /* Failed */ - list_init(pdhead); + dm_list_init(pdhead); full_scan++; if (full_scan > 1) { --- LVM2/lib/format_pool/disk_rep.h 2007/08/20 20:55:25 1.6 +++ LVM2/lib/format_pool/disk_rep.h 2008/11/03 22:14:28 1.7 @@ -106,7 +106,7 @@ }; struct pool_list { - struct list list; + struct dm_list list; struct pool_disk pd; struct physical_volume *pv; struct id pv_uuid; @@ -137,18 +137,18 @@ void pool_label_out(struct pool_disk *pl, void *buf); void pool_label_in(struct pool_disk *pl, void *buf); void get_pool_uuid(char *uuid, uint64_t poolid, uint32_t spid, uint32_t devid); -int import_pool_vg(struct volume_group *vg, struct dm_pool *mem, struct list *pls); +int import_pool_vg(struct volume_group *vg, struct dm_pool *mem, struct dm_list *pls); int import_pool_lvs(struct volume_group *vg, struct dm_pool *mem, - struct list *pls); + struct dm_list *pls); int import_pool_pvs(const struct format_type *fmt, struct volume_group *vg, - struct list *pvs, struct dm_pool *mem, struct list *pls); + struct dm_list *pvs, struct dm_pool *mem, struct dm_list *pls); int import_pool_pv(const struct format_type *fmt, struct dm_pool *mem, struct volume_group *vg, struct physical_volume *pv, struct pool_list *pl); -int import_pool_segments(struct list *lvs, struct dm_pool *mem, +int import_pool_segments(struct dm_list *lvs, struct dm_pool *mem, struct user_subpool *usp, int sp_count); int read_pool_pds(const struct format_type *fmt, const char *vgname, - struct dm_pool *mem, struct list *head); + struct dm_pool *mem, struct dm_list *head); struct pool_list *read_pool_disk(const struct format_type *fmt, struct device *dev, struct dm_pool *mem, const char *vg_name); --- LVM2/lib/format_pool/format_pool.c 2008/06/11 13:14:41 1.17 +++ LVM2/lib/format_pool/format_pool.c 2008/11/03 22:14:28 1.18 @@ -25,7 +25,7 @@ #include "pool_label.h" /* Must be called after pvs are imported */ -static struct user_subpool *_build_usp(struct list *pls, struct dm_pool *mem, +static struct user_subpool *_build_usp(struct dm_list *pls, struct dm_pool *mem, int *sps) { struct pool_list *pl; @@ -36,7 +36,7 @@ * FIXME: Need to do some checks here - I'm tempted to add a * user_pool structure and build the entire thing to check against. */ - list_iterate_items(pl, pls) { + dm_list_iterate_items(pl, pls) { *sps = pl->pd.pl_subpools; if (!usp && (!(usp = dm_pool_zalloc(mem, sizeof(*usp) * (*sps))))) { log_error("Unable to allocate %d subpool structures", @@ -100,7 +100,7 @@ static struct volume_group *_build_vg_from_pds(struct format_instance *fid, struct dm_pool *mem, - struct list *pds) + struct dm_list *pds) { struct dm_pool *smem = fid->fmt->cmd->mem; struct volume_group *vg = NULL; @@ -122,9 +122,9 @@ vg->snapshot_count = 0; vg->seqno = 1; vg->system_id = NULL; - list_init(&vg->pvs); - list_init(&vg->lvs); - list_init(&vg->tags); + dm_list_init(&vg->pvs); + dm_list_init(&vg->lvs); + dm_list_init(&vg->tags); if (!import_pool_vg(vg, smem, pds)) return_NULL; @@ -161,10 +161,10 @@ struct metadata_area *mda __attribute((unused))) { struct dm_pool *mem = dm_pool_create("pool vg_read", 1024); - struct list pds; + struct dm_list pds; struct volume_group *vg = NULL; - list_init(&pds); + dm_list_init(&pds); /* We can safely ignore the mda passed in */ @@ -193,7 +193,7 @@ uint32_t extent_size __attribute((unused)), int pvmetadatacopies __attribute((unused)), uint64_t pvmetadatasize __attribute((unused)), - struct list *mdas __attribute((unused)), + struct dm_list *mdas __attribute((unused)), struct physical_volume *pv __attribute((unused)), struct volume_group *vg __attribute((unused))) { @@ -202,7 +202,7 @@ static int _pool_pv_read(const struct format_type *fmt, const char *pv_name, struct physical_volume *pv, - struct list *mdas __attribute((unused))) + struct dm_list *mdas __attribute((unused))) { struct dm_pool *mem = dm_pool_create("pool pv_read", 1024); struct pool_list *pl; @@ -258,7 +258,7 @@ } fid->fmt = fmt; - list_init(&fid->metadata_areas); + dm_list_init(&fid->metadata_areas); /* Define a NULL metadata area */ if (!(mda = dm_pool_zalloc(fmt->cmd->mem, sizeof(*mda)))) { @@ -270,7 +270,7 @@ mda->ops = &_metadata_format_pool_ops; mda->metadata_locn = NULL; - list_add(&fid->metadata_areas, &mda->list); + dm_list_add(&fid->metadata_areas, &mda->list); return fid; } --- LVM2/lib/format_pool/import_export.c 2008/09/19 04:27:26 1.24 +++ LVM2/lib/format_pool/import_export.c 2008/11/03 22:14:28 1.25 @@ -28,11 +28,11 @@ /* This file contains only imports at the moment... */ -int import_pool_vg(struct volume_group *vg, struct dm_pool *mem, struct list *pls) +int import_pool_vg(struct volume_group *vg, struct dm_pool *mem, struct dm_list *pls) { struct pool_list *pl; - list_iterate_items(pl, pls) { + dm_list_iterate_items(pl, pls) { vg->extent_count += ((pl->pd.pl_blocks) / POOL_PE_SIZE); @@ -55,7 +55,7 @@ return 1; } -int import_pool_lvs(struct volume_group *vg, struct dm_pool *mem, struct list *pls) +int import_pool_lvs(struct volume_group *vg, struct dm_pool *mem, struct dm_list *pls) { struct pool_list *pl; struct lv_list *lvl = dm_pool_zalloc(mem, sizeof(*lvl)); @@ -80,12 +80,12 @@ lv->le_count = 0; lv->read_ahead = vg->cmd->default_settings.read_ahead; lv->snapshot = NULL; - list_init(&lv->snapshot_segs); - list_init(&lv->segments); - list_init(&lv->tags); - list_init(&lv->segs_using_this_lv); + dm_list_init(&lv->snapshot_segs); + dm_list_init(&lv->segments); + dm_list_init(&lv->tags); + dm_list_init(&lv->segs_using_this_lv); - list_iterate_items(pl, pls) { + dm_list_iterate_items(pl, pls) { lv->size += pl->pd.pl_blocks; if (lv->name) @@ -109,26 +109,26 @@ lv->minor = -1; } lv->snapshot = NULL; - list_init(&lv->snapshot_segs); - list_init(&lv->segments); - list_init(&lv->tags); + dm_list_init(&lv->snapshot_segs); + dm_list_init(&lv->segments); + dm_list_init(&lv->tags); } lv->le_count = lv->size / POOL_PE_SIZE; lvl->lv = lv; - list_add(&vg->lvs, &lvl->list); + dm_list_add(&vg->lvs, &lvl->list); vg->lv_count++; return 1; } int import_pool_pvs(const struct format_type *fmt, struct volume_group *vg, - struct list *pvs, struct dm_pool *mem, struct list *pls) + struct dm_list *pvs, struct dm_pool *mem, struct dm_list *pls) { struct pv_list *pvl; struct pool_list *pl; - list_iterate_items(pl, pls) { + dm_list_iterate_items(pl, pls) { if (!(pvl = dm_pool_zalloc(mem, sizeof(*pvl)))) { log_error("Unable to allocate pv list structure"); return 0; @@ -143,7 +143,7 @@ pl->pv = pvl->pv; pvl->mdas = NULL; pvl->pe_ranges = NULL; - list_add(pvs, &pvl->list); + dm_list_add(pvs, &pvl->list); } return 1; @@ -175,8 +175,8 @@ pv->pe_alloc_count = 0; pv->pe_align = 0; - list_init(&pv->tags); - list_init(&pv->segments); + dm_list_init(&pv->tags); + dm_list_init(&pv->segments); if (!alloc_pv_segment_whole_pv(mem, pv)) return_0; @@ -232,7 +232,7 @@ /* add the subpool type to the segment tag list */ str_list_add(mem, &seg->tags, _cvt_sptype(usp->type)); - list_add(&lv->segments, &seg->list); + dm_list_add(&lv->segments, &seg->list); *le_cur += seg->len; @@ -268,7 +268,7 @@ if (!set_lv_segment_area_pv(seg, 0, usp->devs[j].pv, 0)) return_0; - list_add(&lv->segments, &seg->list); + dm_list_add(&lv->segments, &seg->list); *le_cur += seg->len; } @@ -276,7 +276,7 @@ return 1; } -int import_pool_segments(struct list *lvs, struct dm_pool *mem, +int import_pool_segments(struct dm_list *lvs, struct dm_pool *mem, struct user_subpool *usp, int subpools) { struct lv_list *lvl; @@ -284,7 +284,7 @@ uint32_t le_cur = 0; int i; - list_iterate_items(lvl, lvs) { + dm_list_iterate_items(lvl, lvs) { lv = lvl->lv; if (lv->status & SNAPSHOT) --- LVM2/lib/format_text/archive.c 2008/01/30 13:59:59 1.31 +++ LVM2/lib/format_text/archive.c 2008/11/03 22:14:28 1.32 @@ -48,7 +48,7 @@ * with the least recent at the head. */ struct archive_file { - struct list list; + struct dm_list list; char *path; uint32_t index; @@ -87,24 +87,24 @@ return 1; } -static void _insert_archive_file(struct list *head, struct archive_file *b) +static void _insert_archive_file(struct dm_list *head, struct archive_file *b) { struct archive_file *bf = NULL; - if (list_empty(head)) { - list_add(head, &b->list); + if (dm_list_empty(head)) { + dm_list_add(head, &b->list); return; } /* index reduces through list */ - list_iterate_items(bf, head) { + dm_list_iterate_items(bf, head) { if (b->index > bf->index) { - list_add(&bf->list, &b->list); + dm_list_add(&bf->list, &b->list); return; } } - list_add_h(&bf->list, &b->list); + dm_list_add_h(&bf->list, &b->list); } static char *_join_file_to_dir(struct dm_pool *mem, const char *dir, const char *name) @@ -122,7 +122,7 @@ /* * Returns a list of archive_files. */ -static struct list *_scan_archive(struct dm_pool *mem, +static struct dm_list *_scan_archive(struct dm_pool *mem, const char *vgname, const char *dir) { int i, count; @@ -130,12 +130,12 @@ char vgname_found[64], *path; struct dirent **dirent; struct archive_file *af; - struct list *results; + struct dm_list *results; if (!(results = dm_pool_alloc(mem, sizeof(*results)))) return_NULL; - list_init(results); + dm_list_init(results); /* Sort fails beyond 5-digit indexes */ if ((count = scandir(dir, &dirent, NULL, alphasort)) < 0) { @@ -186,7 +186,7 @@ return results; } -static void _remove_expired(struct list *archives, uint32_t archives_size, +static void _remove_expired(struct dm_list *archives, uint32_t archives_size, uint32_t retain_days, uint32_t min_archive) { struct archive_file *bf; @@ -202,7 +202,7 @@ retain_time = time(NULL) - (time_t) retain_days *SECS_PER_DAY; /* Assume list is ordered newest first (by index) */ - list_iterate_back_items(bf, archives) { + dm_list_iterate_back_items(bf, archives) { /* Get the mtime of the file and unlink if too old */ if (stat(bf->path, &sb)) { log_sys_error("stat", bf->path); @@ -231,7 +231,7 @@ struct archive_file *last; FILE *fp = NULL; char temp_file[PATH_MAX], archive_name[PATH_MAX]; - struct list *archives; + struct dm_list *archives; /* * Write the vg out to a temporary file. @@ -263,10 +263,10 @@ if (!(archives = _scan_archive(vg->cmd->mem, vg->name, dir))) return_0; - if (list_empty(archives)) + if (dm_list_empty(archives)) ix = 0; else { - last = list_item(list_first(archives), struct archive_file); + last = dm_list_item(dm_list_first(archives), struct archive_file); ix = last->index + 1; } @@ -286,7 +286,7 @@ if (!renamed) log_error("Archive rename failed for %s", temp_file); - _remove_expired(archives, list_size(archives) + renamed, retain_days, + _remove_expired(archives, dm_list_size(archives) + renamed, retain_days, min_archive); return 1; @@ -331,16 +331,16 @@ int archive_list(struct cmd_context *cmd, const char *dir, const char *vgname) { - struct list *archives; + struct dm_list *archives; struct archive_file *af; if (!(archives = _scan_archive(cmd->mem, vgname, dir))) return_0; - if (list_empty(archives)) + if (dm_list_empty(archives)) log_print("No archives found in %s.", dir); - list_iterate_back_items(af, archives) + dm_list_iterate_back_items(af, archives) _display_archive(cmd, af); dm_pool_free(cmd->mem, archives); --- LVM2/lib/format_text/archiver.c 2008/09/19 06:41:58 1.14 +++ LVM2/lib/format_text/archiver.c 2008/11/03 22:14:28 1.15 @@ -261,7 +261,7 @@ return NULL; } - list_iterate_items(mda, &tf->metadata_areas) { + dm_list_iterate_items(mda, &tf->metadata_areas) { if (!(vg = mda->ops->vg_read(tf, vg_name, mda))) stack; break; @@ -291,7 +291,7 @@ } /* Add any metadata areas on the PVs */ - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { pv = pvl->pv; if (!(info = info_from_pvid(pv->dev->pvid, 0))) { log_error("PV %s missing from cache", @@ -366,7 +366,7 @@ } /* Write and commit the metadata area */ - list_iterate_items(mda, &tf->metadata_areas) { + dm_list_iterate_items(mda, &tf->metadata_areas) { if (!(r = mda->ops->vg_write(tf, vg, mda))) { stack; continue; --- LVM2/lib/format_text/export.c 2008/07/10 11:30:57 1.64 +++ LVM2/lib/format_text/export.c 2008/11/03 22:14:28 1.65 @@ -349,7 +349,7 @@ if (!_print_flag_config(f, vg->status, VG_FLAGS)) return_0; - if (!list_empty(&vg->tags)) { + if (!dm_list_empty(&vg->tags)) { if (!print_tags(&vg->tags, buffer, sizeof(buffer))) return_0; outf(f, "tags = %s", buffer); @@ -395,7 +395,7 @@ outf(f, "physical_volumes {"); _inc_indent(f); - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { pv = pvl->pv; if (!(name = _get_pv_name(f, pv))) @@ -424,7 +424,7 @@ if (!_print_flag_config(f, pv->status, PV_FLAGS)) return_0; - if (!list_empty(&pv->tags)) { + if (!dm_list_empty(&pv->tags)) { if (!print_tags(&pv->tags, buffer, sizeof(buffer))) return_0; outf(f, "tags = %s", buffer); @@ -463,7 +463,7 @@ outnl(f); outf(f, "type = \"%s\"", seg->segtype->name); - if (!list_empty(&seg->tags)) { + if (!dm_list_empty(&seg->tags)) { if (!print_tags(&seg->tags, buffer, sizeof(buffer))) return_0; outf(f, "tags = %s", buffer); @@ -535,7 +535,7 @@ if (!_print_flag_config(f, lv->status, LV_FLAGS)) return_0; - if (!list_empty(&lv->tags)) { + if (!dm_list_empty(&lv->tags)) { if (!print_tags(&lv->tags, buffer, sizeof(buffer))) return_0; outf(f, "tags = %s", buffer); @@ -560,11 +560,11 @@ outf(f, "major = %d", lv->major); if (lv->minor >= 0) outf(f, "minor = %d", lv->minor); - outf(f, "segment_count = %u", list_size(&lv->segments)); + outf(f, "segment_count = %u", dm_list_size(&lv->segments)); outnl(f); seg_count = 1; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (!_print_segment(f, lv->vg, seg_count++, seg)) return_0; } @@ -582,7 +582,7 @@ /* * Don't bother with an lv section if there are no lvs. */ - if (list_empty(&vg->lvs)) + if (dm_list_empty(&vg->lvs)) return 1; outf(f, "logical_volumes {"); @@ -591,14 +591,14 @@ /* * Write visible LVs first */ - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { if (!(lvl->lv->status & VISIBLE_LV)) continue; if (!_print_lv(f, lvl->lv)) return_0; } - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { if ((lvl->lv->status & VISIBLE_LV)) continue; if (!_print_lv(f, lvl->lv)) @@ -629,7 +629,7 @@ if (!(f->pv_names = dm_hash_create(128))) return_0; - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { pv = pvl->pv; /* FIXME But skip if there's already an LV called pv%d ! */ --- LVM2/lib/format_text/format-text.c 2008/10/17 00:55:46 1.97 +++ LVM2/lib/format_text/format-text.c 2008/11/03 22:14:28 1.98 @@ -50,12 +50,12 @@ }; struct dir_list { - struct list list; + struct dm_list list; char dir[0]; }; struct raw_list { - struct list list; + struct dm_list list; struct device_area dev_area; }; @@ -96,7 +96,7 @@ struct mda_context *mdac = (struct mda_context *) mda->metadata_locn; struct pv_list *pvl; - list_iterate_items(pvl, &vg->pvs) + dm_list_iterate_items(pvl, &vg->pvs) if (pvl->pv->dev == mdac->area.dev) return 1; @@ -518,7 +518,7 @@ int noprecommit = 0; /* Ignore any mda on a PV outside the VG. vgsplit relies on this */ - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (pvl->pv->dev == mdac->area.dev) { found = 1; break; @@ -626,7 +626,7 @@ int noprecommit = 0; /* Ignore any mda on a PV outside the VG. vgsplit relies on this */ - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (pvl->pv->dev == mdac->area.dev) { found = 1; break; @@ -718,7 +718,7 @@ int found = 0; /* Ignore any mda on a PV outside the VG. vgsplit relies on this */ - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (pvl->pv->dev == mdac->area.dev) { found = 1; break; @@ -981,7 +981,7 @@ { struct dirent *dirent; struct dir_list *dl; - struct list *dir_list; + struct dm_list *dir_list; char *tmp; DIR *d; struct volume_group *vg; @@ -991,7 +991,7 @@ dir_list = &((struct mda_lists *) fmt->private)->dirs; - list_iterate_items(dl, dir_list) { + dm_list_iterate_items(dl, dir_list) { if (!(d = opendir(dl->dir))) { log_sys_error("opendir", dl->dir); continue; @@ -1126,7 +1126,7 @@ static int _scan_raw(const struct format_type *fmt) { struct raw_list *rl; - struct list *raw_list; + struct dm_list *raw_list; const char *vgname; struct volume_group *vg; struct format_instance fid; @@ -1136,9 +1136,9 @@ raw_list = &((struct mda_lists *) fmt->private)->raws; fid.fmt = fmt; - list_init(&fid.metadata_areas); + dm_list_init(&fid.metadata_areas); - list_iterate_items(rl, raw_list) { + dm_list_iterate_items(rl, raw_list) { /* FIXME We're reading mdah twice here... */ if ((vgname = vgname_from_mda(fmt, &rl->dev_area, &vgid, &vgstatus, NULL, NULL))) { @@ -1161,7 +1161,7 @@ static int _mda_setup(const struct format_type *fmt, uint64_t pe_start, uint64_t pe_end, int pvmetadatacopies, - uint64_t pvmetadatasize, struct list *mdas, + uint64_t pvmetadatasize, struct dm_list *mdas, struct physical_volume *pv, struct volume_group *vg __attribute((unused))) { @@ -1289,7 +1289,7 @@ /* Only for orphans */ /* Set label_sector to -1 if rewriting existing label into same sector */ static int _text_pv_write(const struct format_type *fmt, struct physical_volume *pv, - struct list *mdas, int64_t label_sector) + struct dm_list *mdas, int64_t label_sector) { struct label *label; struct lvmcache_info *info; @@ -1318,8 +1318,8 @@ if (info->mdas.n) del_mdas(&info->mdas); else - list_init(&info->mdas); - list_iterate_items(mda, mdas) { + dm_list_init(&info->mdas); + dm_list_iterate_items(mda, mdas) { mdac = mda->metadata_locn; log_debug("Creating metadata area on %s at sector %" PRIu64 " size %" PRIu64 " sectors", @@ -1331,18 +1331,18 @@ } /* FIXME Temporary until mda creation supported by tools */ } else if (!info->mdas.n) { - list_init(&info->mdas); + dm_list_init(&info->mdas); } if (info->das.n) del_das(&info->das); else - list_init(&info->das); + dm_list_init(&info->das); /* Set pe_start to first aligned sector after any metadata * areas that begin before pe_start */ pv->pe_start = pe_align(pv); - list_iterate_items(mda, &info->mdas) { + dm_list_iterate_items(mda, &info->mdas) { mdac = (struct mda_context *) mda->metadata_locn; if (pv->dev == mdac->area.dev && (mdac->area.start <= (pv->pe_start << SECTOR_SHIFT)) && @@ -1362,7 +1362,7 @@ if (!dev_open(pv->dev)) return_0; - list_iterate_items(mda, &info->mdas) { + dm_list_iterate_items(mda, &info->mdas) { mdac = mda->metadata_locn; memset(&buf, 0, sizeof(buf)); mdah->size = mdac->area.size; @@ -1385,12 +1385,12 @@ return 1; } -static int _add_raw(struct list *raw_list, struct device_area *dev_area) +static int _add_raw(struct dm_list *raw_list, struct device_area *dev_area) { struct raw_list *rl; /* Already present? */ - list_iterate_items(rl, raw_list) { + dm_list_iterate_items(rl, raw_list) { /* FIXME Check size/overlap consistency too */ if (rl->dev_area.dev == dev_area->dev && rl->dev_area.start == dev_area->start) @@ -1402,7 +1402,7 @@ return 0; } memcpy(&rl->dev_area, dev_area, sizeof(*dev_area)); - list_add(raw_list, &rl->list); + dm_list_add(raw_list, &rl->list); return 1; } @@ -1444,20 +1444,20 @@ memcpy(&pv->id, &info->dev->pvid, sizeof(pv->id)); /* Currently only support exactly one data area */ - if (list_size(&info->das) != 1) { + if (dm_list_size(&info->das) != 1) { log_error("Must be exactly one data area (found %d) on PV %s", - list_size(&info->das), dev_name(info->dev)); + dm_list_size(&info->das), dev_name(info->dev)); return 0; } - list_iterate_items(da, &info->das) + dm_list_iterate_items(da, &info->das) pv->pe_start = da->disk_locn.offset >> SECTOR_SHIFT; return 1; } static int _text_pv_read(const struct format_type *fmt, const char *pv_name, - struct physical_volume *pv, struct list *mdas) + struct physical_volume *pv, struct dm_list *mdas) { struct label *label; struct device *dev; @@ -1479,7 +1479,7 @@ return 1; /* Add copy of mdas to supplied list */ - list_iterate_items(mda, &info->mdas) { + dm_list_iterate_items(mda, &info->mdas) { mdac = (struct mda_context *) mda->metadata_locn; if (!(mda_new = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda_new)))) { log_error("metadata_area allocation failed"); @@ -1492,7 +1492,7 @@ memcpy(mda_new, mda, sizeof(*mda)); memcpy(mdac_new, mdac, sizeof(*mdac)); mda_new->metadata_locn = mdac_new; - list_add(mdas, &mda_new->list); + dm_list_add(mdas, &mda_new->list); } return 1; @@ -1503,22 +1503,22 @@ return; } -static void _free_dirs(struct list *dir_list) +static void _free_dirs(struct dm_list *dir_list) { - struct list *dl, *tmp; + struct dm_list *dl, *tmp; - list_iterate_safe(dl, tmp, dir_list) { - list_del(dl); + dm_list_iterate_safe(dl, tmp, dir_list) { + dm_list_del(dl); dm_free(dl); } } -static void _free_raws(struct list *raw_list) +static void _free_raws(struct dm_list *raw_list) { - struct list *rl, *tmp; + struct dm_list *rl, *tmp; - list_iterate_safe(rl, tmp, raw_list) { - list_del(rl); + dm_list_iterate_safe(rl, tmp, raw_list) { + dm_list_del(rl); dm_free(rl); } } @@ -1567,12 +1567,12 @@ uint64_t pe_start, uint32_t extent_count, uint32_t extent_size, int pvmetadatacopies, - uint64_t pvmetadatasize, struct list *mdas, + uint64_t pvmetadatasize, struct dm_list *mdas, struct physical_volume *pv, struct volume_group *vg) { struct metadata_area *mda, *mda_new, *mda2; struct mda_context *mdac, *mdac_new, *mdac2; - struct list *pvmdas; + struct dm_list *pvmdas; struct lvmcache_info *info; int found; uint64_t pe_end = 0; @@ -1588,7 +1588,7 @@ /* Iterate through all mdas on this PV */ if ((info = info_from_pvid(pv->dev->pvid, 0))) { pvmdas = &info->mdas; - list_iterate_items(mda, pvmdas) { + dm_list_iterate_items(mda, pvmdas) { mda_count++; mdac = (struct mda_context *) mda->metadata_locn; @@ -1601,7 +1601,7 @@ /* Ensure it isn't already on list */ found = 0; - list_iterate_items(mda2, mdas) { + dm_list_iterate_items(mda2, mdas) { if (mda2->ops != &_metadata_text_raw_ops) continue; mdac2 = @@ -1628,7 +1628,7 @@ memcpy(mda_new, mda, sizeof(*mda)); memcpy(mdac_new, mdac, sizeof(*mdac)); mda_new->metadata_locn = mdac_new; - list_add(mdas, &mda_new->list); + dm_list_add(mdas, &mda_new->list); } } @@ -1678,7 +1678,7 @@ struct mda_context *mdac, *mdac_new; struct dir_list *dl; struct raw_list *rl; - struct list *dir_list, *raw_list, *mdas; + struct dm_list *dir_list, *raw_list, *mdas; char path[PATH_MAX]; struct lvmcache_vginfo *vginfo; struct lvmcache_info *info; @@ -1698,18 +1698,18 @@ fid->private = (void *) fidtc; fid->fmt = fmt; - list_init(&fid->metadata_areas); + dm_list_init(&fid->metadata_areas); if (!vgname) { if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda)))) return_NULL; mda->ops = &_metadata_text_file_backup_ops; mda->metadata_locn = context; - list_add(&fid->metadata_areas, &mda->list); + dm_list_add(&fid->metadata_areas, &mda->list); } else { dir_list = &((struct mda_lists *) fmt->private)->dirs; - list_iterate_items(dl, dir_list) { + dm_list_iterate_items(dl, dir_list) { if (dm_snprintf(path, PATH_MAX, "%s/%s", dl->dir, vgname) < 0) { log_error("Name too long %s/%s", dl->dir, @@ -1722,12 +1722,12 @@ return_NULL; mda->ops = &_metadata_text_file_ops; mda->metadata_locn = context; - list_add(&fid->metadata_areas, &mda->list); + dm_list_add(&fid->metadata_areas, &mda->list); } raw_list = &((struct mda_lists *) fmt->private)->raws; - list_iterate_items(rl, raw_list) { + dm_list_iterate_items(rl, raw_list) { /* FIXME Cache this; rescan below if some missing */ if (!_raw_holds_vgname(fid, &rl->dev_area, vgname)) continue; @@ -1742,16 +1742,16 @@ memcpy(&mdac->area, &rl->dev_area, sizeof(mdac->area)); mda->ops = &_metadata_text_raw_ops; /* FIXME MISTAKE? mda->metadata_locn = context; */ - list_add(&fid->metadata_areas, &mda->list); + dm_list_add(&fid->metadata_areas, &mda->list); } /* Scan PVs in VG for any further MDAs */ lvmcache_label_scan(fmt->cmd, 0); if (!(vginfo = vginfo_from_vgname(vgname, vgid))) goto_out; - list_iterate_items(info, &vginfo->infos) { + dm_list_iterate_items(info, &vginfo->infos) { mdas = &info->mdas; - list_iterate_items(mda, mdas) { + dm_list_iterate_items(mda, mdas) { mdac = (struct mda_context *) mda->metadata_locn; @@ -1767,7 +1767,7 @@ memcpy(mda_new, mda, sizeof(*mda)); memcpy(mdac_new, mdac, sizeof(*mdac)); mda_new->metadata_locn = mdac_new; - list_add(&fid->metadata_areas, &mda_new->list); + dm_list_add(&fid->metadata_areas, &mda_new->list); } } /* FIXME Check raw metadata area count - rescan if required */ @@ -1827,18 +1827,18 @@ .destroy = _text_destroy }; -static int _add_dir(const char *dir, struct list *dir_list) +static int _add_dir(const char *dir, struct dm_list *dir_list) { struct dir_list *dl; if (dm_create_dir(dir)) { - if (!(dl = dm_malloc(sizeof(struct list) + strlen(dir) + 1))) { + if (!(dl = dm_malloc(sizeof(struct dm_list) + strlen(dir) + 1))) { log_error("_add_dir allocation failed"); return 0; } log_very_verbose("Adding text format metadata dir: %s", dir); strcpy(dl->dir, dir); - list_add(dir_list, &dl->list); + dm_list_add(dir_list, &dl->list); return 1; } @@ -1846,7 +1846,7 @@ } static int _get_config_disk_area(struct cmd_context *cmd, - struct config_node *cn, struct list *raw_list) + struct config_node *cn, struct dm_list *raw_list) { struct device_area dev_area; char *id_str; @@ -1922,8 +1922,8 @@ return NULL; } - list_init(&mda_lists->dirs); - list_init(&mda_lists->raws); + dm_list_init(&mda_lists->dirs); + dm_list_init(&mda_lists->raws); mda_lists->file_ops = &_metadata_text_file_ops; mda_lists->raw_ops = &_metadata_text_raw_ops; fmt->private = (void *) mda_lists; --- LVM2/lib/format_text/format-text.h 2008/02/06 15:47:27 1.24 +++ LVM2/lib/format_text/format-text.h 2008/11/03 22:14:28 1.25 @@ -51,13 +51,13 @@ int pvhdr_read(struct device *dev, char *buf); -int add_da(struct dm_pool *mem, struct list *das, +int add_da(struct dm_pool *mem, struct dm_list *das, uint64_t start, uint64_t size); -void del_das(struct list *das); +void del_das(struct dm_list *das); -int add_mda(const struct format_type *fmt, struct dm_pool *mem, struct list *mdas, +int add_mda(const struct format_type *fmt, struct dm_pool *mem, struct dm_list *mdas, struct device *dev, uint64_t start, uint64_t size); -void del_mdas(struct list *mdas); +void del_mdas(struct dm_list *mdas); const char *vgname_from_mda(const struct format_type *fmt, struct device_area *dev_area, struct id *vgid, --- LVM2/lib/format_text/import-export.h 2008/07/10 11:30:57 1.21 +++ LVM2/lib/format_text/import-export.h 2008/11/03 22:14:28 1.22 @@ -60,8 +60,8 @@ int print_flags(uint32_t status, int type, char *buffer, size_t size); int read_flags(uint32_t *status, int type, struct config_value *cv); -int print_tags(struct list *tags, char *buffer, size_t size); -int read_tags(struct dm_pool *mem, struct list *tags, struct config_value *cv); +int print_tags(struct dm_list *tags, char *buffer, size_t size); +int read_tags(struct dm_pool *mem, struct dm_list *tags, struct config_value *cv); int text_vg_export_file(struct volume_group *vg, const char *desc, FILE *fp); int text_vg_export_raw(struct volume_group *vg, const char *desc, char **buf); --- LVM2/lib/format_text/import_vsn1.c 2008/09/19 06:41:58 1.54 +++ LVM2/lib/format_text/import_vsn1.c 2008/11/03 22:14:28 1.55 @@ -223,8 +223,8 @@ return 0; } - list_init(&pv->tags); - list_init(&pv->segments); + dm_list_init(&pv->tags); + dm_list_init(&pv->segments); /* Optional tags */ if ((cn = find_config_node(pvn, "tags")) && @@ -267,7 +267,7 @@ return_0; vg->pv_count++; - list_add(&vg->pvs, &pvl->list); + dm_list_add(&vg->pvs, &pvl->list); return 1; } @@ -276,15 +276,15 @@ { struct lv_segment *comp; - list_iterate_items(comp, &lv->segments) { + dm_list_iterate_items(comp, &lv->segments) { if (comp->le > seg->le) { - list_add(&comp->list, &seg->list); + dm_list_add(&comp->list, &seg->list); return; } } lv->le_count += seg->len; - list_add(&lv->segments, &seg->list); + dm_list_add(&lv->segments, &seg->list); } static int _read_segment(struct dm_pool *mem, struct volume_group *vg, @@ -548,10 +548,10 @@ } lv->snapshot = NULL; - list_init(&lv->snapshot_segs); - list_init(&lv->segments); - list_init(&lv->tags); - list_init(&lv->segs_using_this_lv); + dm_list_init(&lv->snapshot_segs); + dm_list_init(&lv->segments); + dm_list_init(&lv->tags); + dm_list_init(&lv->segs_using_this_lv); /* Optional tags */ if ((cn = find_config_node(lvn, "tags")) && @@ -563,7 +563,7 @@ lv->vg = vg; vg->lv_count++; - list_add(&vg->lvs, &lvl->list); + dm_list_add(&vg->lvs, &lvl->list); return 1; } @@ -609,7 +609,7 @@ */ if (lv->status & SNAPSHOT) { vg->lv_count--; - list_del(&lvl->list); + dm_list_del(&lvl->list); return 1; } @@ -758,7 +758,7 @@ goto bad; } - list_init(&vg->pvs); + dm_list_init(&vg->pvs); if (!_read_sections(fid, "physical_volumes", _read_pv, mem, vg, vgn, pv_hash, 0)) { log_error("Couldn't find all physical volumes for volume " @@ -766,8 +766,8 @@ goto bad; } - list_init(&vg->lvs); - list_init(&vg->tags); + dm_list_init(&vg->lvs); + dm_list_init(&vg->tags); /* Optional tags */ if ((cn = find_config_node(vgn, "tags")) && --- LVM2/lib/format_text/layout.h 2007/11/05 17:17:55 1.8 +++ LVM2/lib/format_text/layout.h 2008/11/03 22:14:28 1.9 @@ -29,7 +29,7 @@ /* Data areas (holding PEs) */ struct data_area_list { - struct list list; + struct dm_list list; struct disk_locn disk_locn; }; @@ -67,8 +67,8 @@ } __attribute__ ((packed)); struct mda_lists { - struct list dirs; - struct list raws; + struct dm_list dirs; + struct dm_list raws; struct metadata_area_ops *file_ops; struct metadata_area_ops *raw_ops; }; --- LVM2/lib/format_text/tags.c 2008/01/30 13:59:59 1.6 +++ LVM2/lib/format_text/tags.c 2008/11/03 22:14:28 1.7 @@ -19,7 +19,7 @@ #include "str_list.h" #include "lvm-string.h" -int print_tags(struct list *tags, char *buffer, size_t size) +int print_tags(struct dm_list *tags, char *buffer, size_t size) { struct str_list *sl; int first = 1; @@ -27,7 +27,7 @@ if (!emit_to_buffer(&buffer, &size, "[")) return_0; - list_iterate_items(sl, tags) { + dm_list_iterate_items(sl, tags) { if (!first) { if (!emit_to_buffer(&buffer, &size, ", ")) return_0; @@ -44,7 +44,7 @@ return 1; } -int read_tags(struct dm_pool *mem, struct list *tags, struct config_value *cv) +int read_tags(struct dm_pool *mem, struct dm_list *tags, struct config_value *cv) { if (cv->type == CFG_EMPTY_ARRAY) return 1; --- LVM2/lib/format_text/text_label.c 2008/02/06 15:47:27 1.21 +++ LVM2/lib/format_text/text_label.c 2008/11/03 22:14:28 1.22 @@ -58,7 +58,7 @@ pvh_dlocn_xl = &pvhdr->disk_areas_xl[0]; /* List of data areas (holding PEs) */ - list_iterate_items(da, &info->das) { + dm_list_iterate_items(da, &info->das) { pvh_dlocn_xl->offset = xlate64(da->disk_locn.offset); pvh_dlocn_xl->size = xlate64(da->disk_locn.size); pvh_dlocn_xl++; @@ -70,7 +70,7 @@ pvh_dlocn_xl++; /* List of metadata area header locations */ - list_iterate_items(mda, &info->mdas) { + dm_list_iterate_items(mda, &info->mdas) { mdac = (struct mda_context *) mda->metadata_locn; if (mdac->area.dev != info->dev) @@ -88,7 +88,7 @@ return 1; } -int add_da(struct dm_pool *mem, struct list *das, +int add_da(struct dm_pool *mem, struct dm_list *das, uint64_t start, uint64_t size) { struct data_area_list *dal; @@ -108,24 +108,24 @@ dal->disk_locn.offset = start; dal->disk_locn.size = size; - list_add(das, &dal->list); + dm_list_add(das, &dal->list); return 1; } -void del_das(struct list *das) +void del_das(struct dm_list *das) { - struct list *dah, *tmp; + struct dm_list *dah, *tmp; struct data_area_list *da; - list_iterate_safe(dah, tmp, das) { - da = list_item(dah, struct data_area_list); - list_del(&da->list); + dm_list_iterate_safe(dah, tmp, das) { + da = dm_list_item(dah, struct data_area_list); + dm_list_del(&da->list); dm_free(da); } } -int add_mda(const struct format_type *fmt, struct dm_pool *mem, struct list *mdas, +int add_mda(const struct format_type *fmt, struct dm_pool *mem, struct dm_list *mdas, struct device *dev, uint64_t start, uint64_t size) { /* FIXME List size restricted by pv_header SECTOR_SIZE */ @@ -165,19 +165,19 @@ mdac->free_sectors = UINT64_C(0); memset(&mdac->rlocn, 0, sizeof(mdac->rlocn)); - list_add(mdas, &mdal->list); + dm_list_add(mdas, &mdal->list); return 1; } -void del_mdas(struct list *mdas) +void del_mdas(struct dm_list *mdas) { - struct list *mdah, *tmp; + struct dm_list *mdah, *tmp; struct metadata_area *mda; - list_iterate_safe(mdah, tmp, mdas) { - mda = list_item(mdah, struct metadata_area); + dm_list_iterate_safe(mdah, tmp, mdas) { + mda = dm_list_item(mdah, struct metadata_area); dm_free(mda->metadata_locn); - list_del(&mda->list); + dm_list_del(&mda->list); dm_free(mda); } } @@ -217,11 +217,11 @@ if (info->das.n) del_das(&info->das); - list_init(&info->das); + dm_list_init(&info->das); if (info->mdas.n) del_mdas(&info->mdas); - list_init(&info->mdas); + dm_list_init(&info->mdas); /* Data areas holding the PEs */ dlocn_xl = pvhdr->disk_areas_xl; @@ -239,7 +239,7 @@ dlocn_xl++; } - list_iterate_items(mda, &info->mdas) { + dm_list_iterate_items(mda, &info->mdas) { mdac = (struct mda_context *) mda->metadata_locn; if ((vgname = vgname_from_mda(info->fmt, &mdac->area, &vgid, &vgstatus, &creation_host, --- LVM2/lib/label/label.c 2008/09/15 17:06:55 1.44 +++ LVM2/lib/label/label.c 2008/11/03 22:14:28 1.45 @@ -30,13 +30,13 @@ * Internal labeller struct. */ struct labeller_i { - struct list list; + struct dm_list list; struct labeller *l; char name[0]; }; -static struct list _labellers; +static struct dm_list _labellers; static struct labeller_i *_alloc_li(const char *name, struct labeller *l) { @@ -63,23 +63,23 @@ int label_init(void) { - list_init(&_labellers); + dm_list_init(&_labellers); return 1; } void label_exit(void) { - struct list *c, *n; + struct dm_list *c, *n; struct labeller_i *li; for (c = _labellers.n; c != &_labellers; c = n) { n = c->n; - li = list_item(c, struct labeller_i); + li = dm_list_item(c, struct labeller_i); li->l->ops->destroy(li->l); _free_li(li); } - list_init(&_labellers); + dm_list_init(&_labellers); } int label_register_handler(const char *name, struct labeller *handler) @@ -89,7 +89,7 @@ if (!(li = _alloc_li(name, handler))) return_0; - list_add(&_labellers, &li->list); + dm_list_add(&_labellers, &li->list); return 1; } @@ -97,7 +97,7 @@ { struct labeller_i *li; - list_iterate_items(li, &_labellers) + dm_list_iterate_items(li, &_labellers) if (!strcmp(li->name, name)) return li->l; @@ -153,7 +153,7 @@ continue; } - list_iterate_items(li, &_labellers) { + dm_list_iterate_items(li, &_labellers) { if (li->l->ops->can_handle(li->l, (char *) lh, sector + scan_sector)) { log_very_verbose("%s: %s label detected", @@ -228,7 +228,7 @@ if (xlate64(lh->sector_xl) == sector) wipe = 1; } else { - list_iterate_items(li, &_labellers) { + dm_list_iterate_items(li, &_labellers) { if (li->l->ops->can_handle(li->l, (char *) lh, sector)) { wipe = 1; --- LVM2/lib/locking/Makefile.in 2007/09/21 10:16:44 1.3 +++ LVM2/lib/locking/Makefile.in 2008/11/03 22:14:29 1.4 @@ -19,6 +19,7 @@ SOURCES = cluster_locking.c LIB_SHARED = liblvm2clusterlock.so +LIB_VERSION = $(LIB_VERSION_LVM) include $(top_srcdir)/make.tmpl --- LVM2/lib/locking/file_locking.c 2008/05/09 19:26:58 1.39 +++ LVM2/lib/locking/file_locking.c 2008/11/03 22:14:29 1.40 @@ -31,12 +31,12 @@ #include struct lock_list { - struct list list; + struct dm_list list; int lf; char *res; }; -static struct list _lock_list; +static struct dm_list _lock_list; static char _lock_dir[NAME_LEN]; static sig_t _oldhandler; @@ -46,15 +46,15 @@ static int _release_lock(const char *file, int unlock) { struct lock_list *ll; - struct list *llh, *llt; + struct dm_list *llh, *llt; struct stat buf1, buf2; - list_iterate_safe(llh, llt, &_lock_list) { - ll = list_item(llh, struct lock_list); + dm_list_iterate_safe(llh, llt, &_lock_list) { + ll = dm_list_item(llh, struct lock_list); if (!file || !strcmp(ll->res, file)) { - list_del(llh); + dm_list_del(llh); if (unlock) { log_very_verbose("Unlocking %s", ll->res); if (flock(ll->lf, LOCK_NB | LOCK_UN)) @@ -194,7 +194,7 @@ break; } while (!(flags & LCK_NONBLOCK)); - list_add(&_lock_list, &ll->list); + dm_list_add(&_lock_list, &ll->list); return 1; err: @@ -290,7 +290,7 @@ if ((access(_lock_dir, R_OK | W_OK | X_OK) == -1) && (errno == EROFS)) return 0; - list_init(&_lock_list); + dm_list_init(&_lock_list); if (sigfillset(&_intsigset) || sigfillset(&_fullsigset)) { log_sys_error("sigfillset", "init_file_locking"); --- LVM2/lib/locking/locking.c 2008/10/24 01:16:16 1.51 +++ LVM2/lib/locking/locking.c 2008/11/03 22:14:29 1.52 @@ -401,27 +401,27 @@ } /* Unlock list of LVs */ -int resume_lvs(struct cmd_context *cmd, struct list *lvs) +int resume_lvs(struct cmd_context *cmd, struct dm_list *lvs) { struct lv_list *lvl; - list_iterate_items(lvl, lvs) + dm_list_iterate_items(lvl, lvs) resume_lv(cmd, lvl->lv); return 1; } /* Lock a list of LVs */ -int suspend_lvs(struct cmd_context *cmd, struct list *lvs) +int suspend_lvs(struct cmd_context *cmd, struct dm_list *lvs) { - struct list *lvh; + struct dm_list *lvh; struct lv_list *lvl; - list_iterate_items(lvl, lvs) { + dm_list_iterate_items(lvl, lvs) { if (!suspend_lv(cmd, lvl->lv)) { log_error("Failed to suspend %s", lvl->lv->name); - list_uniterate(lvh, lvs, &lvl->list) { - lvl = list_item(lvh, struct lv_list); + dm_list_uniterate(lvh, lvs, &lvl->list) { + lvl = dm_list_item(lvh, struct lv_list); resume_lv(cmd, lvl->lv); } @@ -433,12 +433,12 @@ } /* Lock a list of LVs */ -int activate_lvs(struct cmd_context *cmd, struct list *lvs, unsigned exclusive) +int activate_lvs(struct cmd_context *cmd, struct dm_list *lvs, unsigned exclusive) { - struct list *lvh; + struct dm_list *lvh; struct lv_list *lvl; - list_iterate_items(lvl, lvs) { + dm_list_iterate_items(lvl, lvs) { if (!exclusive) { if (!activate_lv(cmd, lvl->lv)) { log_error("Failed to activate %s", lvl->lv->name); @@ -446,8 +446,8 @@ } } else if (!activate_lv_excl(cmd, lvl->lv)) { log_error("Failed to activate %s", lvl->lv->name); - list_uniterate(lvh, lvs, &lvl->list) { - lvl = list_item(lvh, struct lv_list); + dm_list_uniterate(lvh, lvs, &lvl->list) { + lvl = dm_list_item(lvh, struct lv_list); activate_lv(cmd, lvl->lv); } return 0; --- LVM2/lib/locking/locking.h 2008/09/19 06:41:58 1.42 +++ LVM2/lib/locking/locking.h 2008/11/03 22:14:29 1.43 @@ -130,9 +130,9 @@ lock_vol((vg)->cmd, (vg)->name, LCK_VG_DROP_CACHE) /* Process list of LVs */ -int suspend_lvs(struct cmd_context *cmd, struct list *lvs); -int resume_lvs(struct cmd_context *cmd, struct list *lvs); -int activate_lvs(struct cmd_context *cmd, struct list *lvs, unsigned exclusive); +int suspend_lvs(struct cmd_context *cmd, struct dm_list *lvs); +int resume_lvs(struct cmd_context *cmd, struct dm_list *lvs); +int activate_lvs(struct cmd_context *cmd, struct dm_list *lvs, unsigned exclusive); /* Interrupt handling */ void sigint_clear(void); --- LVM2/lib/metadata/lv_alloc.h 2008/01/16 19:00:59 1.21 +++ LVM2/lib/metadata/lv_alloc.h 2008/11/03 22:14:29 1.22 @@ -48,9 +48,9 @@ uint32_t stripes, uint32_t mirrors, uint32_t log_count, uint32_t extents, - struct list *allocatable_pvs, + struct dm_list *allocatable_pvs, alloc_policy_t alloc, - struct list *parallel_areas); + struct dm_list *parallel_areas); int lv_add_segment(struct alloc_handle *ah, uint32_t first_area, uint32_t num_areas, @@ -75,7 +75,7 @@ void alloc_destroy(struct alloc_handle *ah); -struct list *build_parallel_areas_from_lv(struct cmd_context *cmd, +struct dm_list *build_parallel_areas_from_lv(struct cmd_context *cmd, struct logical_volume *lv); #endif --- LVM2/lib/metadata/lv_manip.c 2008/10/23 11:21:04 1.158 +++ LVM2/lib/metadata/lv_manip.c 2008/11/03 22:14:29 1.159 @@ -36,7 +36,7 @@ { struct seg_list *sl; - list_iterate_items(sl, &lv->segs_using_this_lv) { + dm_list_iterate_items(sl, &lv->segs_using_this_lv) { if (sl->seg == seg) { sl->count++; return 1; @@ -53,7 +53,7 @@ sl->count = 1; sl->seg = seg; - list_add(&lv->segs_using_this_lv, &sl->list); + dm_list_add(&lv->segs_using_this_lv, &sl->list); return 1; } @@ -63,7 +63,7 @@ { struct seg_list *sl; - list_iterate_items(sl, &lv->segs_using_this_lv) { + dm_list_iterate_items(sl, &lv->segs_using_this_lv) { if (sl->seg != seg) continue; if (sl->count > 1) @@ -72,7 +72,7 @@ log_very_verbose("%s:%" PRIu32 " is no longer a user " "of %s", seg->lv->name, seg->le, lv->name); - list_del(&sl->list); + dm_list_del(&sl->list); } return 1; } @@ -91,14 +91,14 @@ { struct seg_list *sl; - if (list_size(&lv->segs_using_this_lv) != 1) { + if (dm_list_size(&lv->segs_using_this_lv) != 1) { log_error("%s is expected to have only one segment using it, " "while it has %d", lv->name, - list_size(&lv->segs_using_this_lv)); + dm_list_size(&lv->segs_using_this_lv)); return NULL; } - sl = list_item(list_first(&lv->segs_using_this_lv), struct seg_list); + sl = dm_list_item(dm_list_first(&lv->segs_using_this_lv), struct seg_list); if (sl->count != 1) { log_error("%s is expected to have only one segment using it, " @@ -114,19 +114,19 @@ * PVs used by a segment of an LV */ struct seg_pvs { - struct list list; + struct dm_list list; - struct list pvs; /* struct pv_list */ + struct dm_list pvs; /* struct pv_list */ uint32_t le; uint32_t len; }; -static struct seg_pvs *_find_seg_pvs_by_le(struct list *list, uint32_t le) +static struct seg_pvs *_find_seg_pvs_by_le(struct dm_list *list, uint32_t le) { struct seg_pvs *spvs; - list_iterate_items(spvs, list) + dm_list_iterate_items(spvs, list) if (le >= spvs->le && le < spvs->le + spvs->len) return spvs; @@ -145,7 +145,7 @@ memset(&lvnum_used, 0, sizeof(lvnum_used)); - list_iterate_items(lvl, &lv->vg->lvs) { + dm_list_iterate_items(lvl, &lv->vg->lvs) { lvnum = lvnum_from_lvid(&lvl->lv->lvid); if (lvnum <= MAX_RESTRICTED_LVS) lvnum_used[lvnum] = 1; @@ -203,7 +203,7 @@ seg->region_size = region_size; seg->extents_copied = extents_copied; seg->log_lv = log_lv; - list_init(&seg->tags); + dm_list_init(&seg->tags); if (log_lv && !attach_mirror_log(seg, log_lv)) return_NULL; @@ -231,7 +231,7 @@ return NULL; } - list_add(&lv->segments, &seg->list); + dm_list_add(&lv->segments, &seg->list); lv->status |= VIRTUAL; return seg; @@ -407,7 +407,7 @@ uint32_t count = extents; uint32_t reduction; - list_iterate_back_items(seg, &lv->segments) { + dm_list_iterate_back_items(seg, &lv->segments) { if (!count) break; @@ -416,7 +416,7 @@ /* FIXME Check this is safe */ if (seg->log_lv && !lv_remove(seg->log_lv)) return_0; - list_del(&seg->list); + dm_list_del(&seg->list); reduction = seg->len; } else reduction = count; @@ -437,7 +437,7 @@ if (!(lvl = find_lv_in_vg(lv->vg, lv->name))) return_0; - list_del(&lvl->list); + dm_list_del(&lvl->list); if (!(lv->status & SNAPSHOT)) lv->vg->lv_count--; @@ -498,7 +498,7 @@ * A set of contiguous physical extents allocated */ struct alloced_area { - struct list list; + struct dm_list list; struct physical_volume *pv; uint32_t pe; @@ -518,10 +518,10 @@ uint32_t log_count; /* Number of parallel 1-extent logs */ uint32_t total_area_len; /* Total number of parallel extents */ - struct list *parallel_areas; /* PVs to avoid */ + struct dm_list *parallel_areas; /* PVs to avoid */ struct alloced_area log_area; /* Extent used for log */ - struct list alloced_areas[0]; /* Lists of areas in each stripe */ + struct dm_list alloced_areas[0]; /* Lists of areas in each stripe */ }; static uint32_t calc_area_multiple(const struct segment_type *segtype, @@ -543,7 +543,7 @@ uint32_t mirrors, uint32_t stripes, uint32_t log_count, - struct list *parallel_areas) + struct dm_list *parallel_areas) { struct alloc_handle *ah; uint32_t s, area_count; @@ -586,7 +586,7 @@ ah->area_multiple = calc_area_multiple(segtype, area_count); for (s = 0; s < ah->area_count; s++) - list_init(&ah->alloced_areas[s]); + dm_list_init(&ah->alloced_areas[s]); ah->parallel_areas = parallel_areas; @@ -599,7 +599,7 @@ dm_pool_destroy(ah->mem); } -static int _log_parallel_areas(struct dm_pool *mem, struct list *parallel_areas) +static int _log_parallel_areas(struct dm_pool *mem, struct dm_list *parallel_areas) { struct seg_pvs *spvs; struct pv_list *pvl; @@ -613,8 +613,8 @@ return 0; } - list_iterate_items(spvs, parallel_areas) { - list_iterate_items(pvl, &spvs->pvs) { + dm_list_iterate_items(spvs, parallel_areas) { + dm_list_iterate_items(pvl, &spvs->pvs) { if (!dm_pool_grow_object(mem, pv_dev_name(pvl->pv), strlen(pv_dev_name(pvl->pv)))) { log_error("dm_pool_grow_object failed"); dm_pool_abandon_object(mem); @@ -670,7 +670,7 @@ if (!set_lv_segment_area_pv(seg, s, aa[s].pv, aa[s].pe)) return_0; - list_add(&lv->segments, &seg->list); + dm_list_add(&lv->segments, &seg->list); extents = aa[0].len * area_multiple; lv->le_count += extents; @@ -683,7 +683,7 @@ } static int _setup_alloced_segments(struct logical_volume *lv, - struct list *alloced_areas, + struct dm_list *alloced_areas, uint32_t area_count, uint32_t status, uint32_t stripe_size, @@ -693,7 +693,7 @@ { struct alloced_area *aa; - list_iterate_items(aa, &alloced_areas[0]) { + dm_list_iterate_items(aa, &alloced_areas[0]) { if (!_setup_alloced_segment(lv, status, area_count, stripe_size, segtype, aa, region_size, log_lv)) @@ -734,7 +734,7 @@ aa[s].pv = areas[s]->map->pv; aa[s].pe = areas[s]->start; aa[s].len = area_len; - list_add(&ah->alloced_areas[s], &aa[s].list); + dm_list_add(&ah->alloced_areas[s], &aa[s].list); } ah->total_area_len += area_len; @@ -958,7 +958,7 @@ * Choose sets of parallel areas to use, respecting any constraints. */ static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc, - struct list *pvms, struct pv_area **areas, + struct dm_list *pvms, struct pv_area **areas, uint32_t areas_size, unsigned can_split, struct lv_segment *prev_lvseg, uint32_t *allocated, uint32_t needed) @@ -973,7 +973,7 @@ uint32_t max_parallel; /* Maximum extents to allocate */ uint32_t next_le; struct seg_pvs *spvs; - struct list *parallel_pvs; + struct dm_list *parallel_pvs; uint32_t free_pes; /* Is there enough total space? */ @@ -1015,7 +1015,7 @@ */ if (ah->parallel_areas) { next_le = (prev_lvseg ? prev_lvseg->le + prev_lvseg->len : 0) + *allocated / ah->area_multiple; - list_iterate_items(spvs, ah->parallel_areas) { + dm_list_iterate_items(spvs, ah->parallel_areas) { if (next_le >= spvs->le + spvs->len) continue; @@ -1032,8 +1032,8 @@ * that fits completely and we're allowed more than one * LV segment, then take the largest remaining instead. */ - list_iterate_items(pvm, pvms) { - if (list_empty(&pvm->areas)) + dm_list_iterate_items(pvm, pvms) { + if (dm_list_empty(&pvm->areas)) continue; /* Next PV */ if (alloc != ALLOC_ANYWHERE) { @@ -1044,14 +1044,14 @@ /* Avoid PVs used by existing parallel areas */ if (parallel_pvs) - list_iterate_items(pvl, parallel_pvs) + dm_list_iterate_items(pvl, parallel_pvs) if (pvm->pv == pvl->pv) goto next_pv; } already_found_one = 0; /* First area in each list is the largest */ - list_iterate_items(pva, &pvm->areas) { + dm_list_iterate_items(pva, &pvm->areas) { if (contiguous) { if (prev_lvseg && _check_contiguous(ah->cmd, @@ -1137,14 +1137,14 @@ struct logical_volume *lv, uint32_t new_extents, unsigned can_split, - struct list *allocatable_pvs) + struct dm_list *allocatable_pvs) { struct pv_area **areas; uint32_t allocated = lv ? lv->le_count : 0; uint32_t old_allocated; struct lv_segment *prev_lvseg = NULL; int r = 0; - struct list *pvms; + struct dm_list *pvms; uint32_t areas_size; alloc_policy_t alloc; @@ -1156,8 +1156,8 @@ if (ah->alloc == ALLOC_CONTIGUOUS) can_split = 0; - if (lv && !list_empty(&lv->segments)) - prev_lvseg = list_item(list_last(&lv->segments), + if (lv && !dm_list_empty(&lv->segments)) + prev_lvseg = dm_list_item(dm_list_last(&lv->segments), struct lv_segment); /* * Build the sets of available areas on the pv's. @@ -1168,7 +1168,7 @@ if (!_log_parallel_areas(ah->mem, ah->parallel_areas)) stack; - areas_size = list_size(pvms); + areas_size = dm_list_size(pvms); if (areas_size && areas_size < (ah->area_count + ah->log_count)) { if (ah->alloc != ALLOC_ANYWHERE) { log_error("Not enough PVs with free space available " @@ -1238,7 +1238,7 @@ return 0; } - list_add(&lv->segments, &seg->list); + dm_list_add(&lv->segments, &seg->list); lv->le_count += extents; lv->size += (uint64_t) extents *lv->vg->extent_size; @@ -1257,9 +1257,9 @@ uint32_t stripes, uint32_t mirrors, uint32_t log_count, uint32_t extents, - struct list *allocatable_pvs, + struct dm_list *allocatable_pvs, alloc_policy_t alloc, - struct list *parallel_areas) + struct dm_list *parallel_areas) { struct alloc_handle *ah; @@ -1375,8 +1375,8 @@ if (!move_lv_segment_area(newseg, s, seg, s)) return_NULL; - list_add(&seg->list, &newseg->list); - list_del(&seg->list); + dm_list_add(&seg->list, &newseg->list); + dm_list_del(&seg->list); return newseg; } @@ -1393,7 +1393,7 @@ uint32_t current_le = le; uint32_t s, old_area_count, new_area_count; - list_iterate_items(aa, &ah->alloced_areas[0]) { + dm_list_iterate_items(aa, &ah->alloced_areas[0]) { if (!(seg = find_seg_by_le(lv, current_le))) { log_error("Failed to find segment for %s extent %" PRIu32, lv->name, current_le); @@ -1452,7 +1452,7 @@ seg = first_seg(lv); - if (list_size(&lv->segments) != 1 || seg_type(seg, 0) != AREA_LV) { + if (dm_list_size(&lv->segments) != 1 || seg_type(seg, 0) != AREA_LV) { log_error("Mirror layer must be inserted before adding mirrors"); return_0; } @@ -1498,7 +1498,7 @@ { struct lv_segment *seg; - if (list_size(&log_lv->segments)) { + if (dm_list_size(&log_lv->segments)) { log_error("Log segments can only be added to an empty LV"); return 0; } @@ -1515,7 +1515,7 @@ if (!set_lv_segment_area_pv(seg, 0, ah->log_area.pv, ah->log_area.pe)) return_0; - list_add(&log_lv->segments, &seg->list); + dm_list_add(&log_lv->segments, &seg->list); log_lv->le_count += ah->log_area.len; log_lv->size += (uint64_t) log_lv->le_count * log_lv->vg->extent_size; @@ -1568,7 +1568,7 @@ uint32_t mirrors, uint32_t extents, struct physical_volume *mirrored_pv __attribute((unused)), uint32_t mirrored_pe __attribute((unused)), - uint32_t status, struct list *allocatable_pvs, + uint32_t status, struct dm_list *allocatable_pvs, alloc_policy_t alloc) { int r = 1; @@ -1687,7 +1687,7 @@ struct lv_segment *seg; uint32_t s; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (seg->log_lv && !func(cmd, seg->log_lv, data)) return 0; for (s = 0; s < seg->area_count; s++) { @@ -1775,7 +1775,7 @@ struct lv_list *lvl; int high = -1, i; - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { if (sscanf(lvl->lv->name, format, &i) != 1) continue; @@ -1847,10 +1847,10 @@ lv->size = UINT64_C(0); lv->le_count = 0; lv->snapshot = NULL; - list_init(&lv->snapshot_segs); - list_init(&lv->segments); - list_init(&lv->tags); - list_init(&lv->segs_using_this_lv); + dm_list_init(&lv->snapshot_segs); + dm_list_init(&lv->segments); + dm_list_init(&lv->tags); + dm_list_init(&lv->segs_using_this_lv); if (lvid) lv->lvid = *lvid; @@ -1864,7 +1864,7 @@ if (!import) vg->lv_count++; - list_add(&vg->lvs, &ll->list); + dm_list_add(&vg->lvs, &ll->list); return lv; } @@ -1886,18 +1886,18 @@ pvl->pv = peg->pv; - list_add(&spvs->pvs, &pvl->list); + dm_list_add(&spvs->pvs, &pvl->list); return 1; } /* - * Construct list of segments of LVs showing which PVs they use. + * Construct dm_list of segments of LVs showing which PVs they use. */ -struct list *build_parallel_areas_from_lv(struct cmd_context *cmd, +struct dm_list *build_parallel_areas_from_lv(struct cmd_context *cmd, struct logical_volume *lv) { - struct list *parallel_areas; + struct dm_list *parallel_areas; struct seg_pvs *spvs; uint32_t current_le = 0; @@ -1906,7 +1906,7 @@ return NULL; } - list_init(parallel_areas); + dm_list_init(parallel_areas); do { if (!(spvs = dm_pool_zalloc(cmd->mem, sizeof(*spvs)))) { @@ -1914,12 +1914,12 @@ return NULL; } - list_init(&spvs->pvs); + dm_list_init(&spvs->pvs); spvs->le = current_le; spvs->len = lv->le_count - current_le; - list_add(parallel_areas, &spvs->list); + dm_list_add(parallel_areas, &spvs->list); /* Find next segment end */ /* FIXME Unnecessary nesting! */ @@ -2054,12 +2054,12 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *lv, const force_t force) { - struct list *snh, *snht; + struct dm_list *snh, *snht; if (lv_is_origin(lv)) { /* remove snapshot LVs first */ - list_iterate_safe(snh, snht, &lv->snapshot_segs) { - if (!lv_remove_with_dependencies(cmd, list_struct_base(snh, struct lv_segment, + dm_list_iterate_safe(snh, snht, &lv->snapshot_segs) { + if (!lv_remove_with_dependencies(cmd, dm_list_struct_base(snh, struct lv_segment, origin_list)->cow, force)) return 0; @@ -2078,7 +2078,7 @@ * is used to find the lowest-level segment boundaries. */ static int _split_parent_area(struct lv_segment *seg, uint32_t s, - struct list *layer_seg_pvs) + struct dm_list *layer_seg_pvs) { uint32_t parent_area_len, parent_le, layer_le; uint32_t area_multiple; @@ -2132,19 +2132,19 @@ struct logical_volume *parent_lv; struct lv_segment *seg; uint32_t s; - struct list *parallel_areas; + struct dm_list *parallel_areas; if (!(parallel_areas = build_parallel_areas_from_lv(cmd, layer_lv))) return_0; /* Loop through all LVs except itself */ - list_iterate_items(lvl, &layer_lv->vg->lvs) { + dm_list_iterate_items(lvl, &layer_lv->vg->lvs) { parent_lv = lvl->lv; if (parent_lv == layer_lv) continue; /* Find all segments that point at the layer LV */ - list_iterate_items(seg, &parent_lv->segments) { + dm_list_iterate_items(seg, &parent_lv->segments) { for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_LV || seg_lv(seg, s) != layer_lv) @@ -2163,7 +2163,7 @@ int remove_layers_for_segments(struct cmd_context *cmd, struct logical_volume *lv, struct logical_volume *layer_lv, - uint32_t status_mask, struct list *lvs_changed) + uint32_t status_mask, struct dm_list *lvs_changed) { struct lv_segment *seg, *lseg; uint32_t s; @@ -2174,7 +2174,7 @@ layer_lv->name, lv->name); /* Find all segments that point at the temporary mirror */ - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_LV || seg_lv(seg, s) != layer_lv) @@ -2230,7 +2230,7 @@ return 0; } lvl->lv = lv; - list_add(lvs_changed, &lvl->list); + dm_list_add(lvs_changed, &lvl->list); lv_changed = 1; } } @@ -2245,13 +2245,13 @@ int remove_layers_for_segments_all(struct cmd_context *cmd, struct logical_volume *layer_lv, uint32_t status_mask, - struct list *lvs_changed) + struct dm_list *lvs_changed) { struct lv_list *lvl; struct logical_volume *lv1; /* Loop through all LVs except the temporary mirror */ - list_iterate_items(lvl, &layer_lv->vg->lvs) { + dm_list_iterate_items(lvl, &layer_lv->vg->lvs) { lv1 = lvl->lv; if (lv1 == layer_lv) continue; @@ -2273,7 +2273,7 @@ { struct lv_segment *seg; - list_iterate_items(seg, &lv_to->segments) { + dm_list_iterate_items(seg, &lv_to->segments) { if (seg->origin) { log_error("Can't move snapshot segment"); return 0; @@ -2284,13 +2284,13 @@ lv_to->segments.n->p = &lv_to->segments; lv_to->segments.p->n = &lv_to->segments; - list_iterate_items(seg, &lv_to->segments) { + dm_list_iterate_items(seg, &lv_to->segments) { seg->lv = lv_to; seg->status &= ~reset_status; seg->status |= set_status; } - list_init(&lv_from->segments); + dm_list_init(&lv_from->segments); lv_to->le_count = lv_from->le_count; lv_to->size = lv_from->size; @@ -2322,7 +2322,7 @@ * Before removal, the layer should be cleaned up, * i.e. additional segments and areas should have been removed. */ - if (list_size(&parent->segments) != 1 || + if (dm_list_size(&parent->segments) != 1 || parent_seg->area_count != 1 || seg_type(parent_seg, 0) != AREA_LV || layer_lv != seg_lv(parent_seg, 0) || @@ -2428,7 +2428,7 @@ return_NULL; /* add the new segment to the layer LV */ - list_add(&lv_where->segments, &mapseg->list); + dm_list_add(&lv_where->segments, &mapseg->list); lv_where->le_count = layer_lv->le_count; lv_where->size = lv_where->le_count * lv_where->vg->extent_size; @@ -2471,7 +2471,7 @@ return_0; /* add the new segment to the layer LV */ - list_add(&layer_lv->segments, &mapseg->list); + dm_list_add(&layer_lv->segments, &mapseg->list); layer_lv->le_count += seg->area_len; layer_lv->size += seg->area_len * layer_lv->vg->extent_size; @@ -2502,7 +2502,7 @@ pe_start = seg_pe(seg, s); /* Do these PEs match to any of the PEs in pvl? */ - list_iterate_items(per, pvl->pe_ranges) { + dm_list_iterate_items(per, pvl->pe_ranges) { per_end = per->start + per->count - 1; if ((pe_start < per->start) || (pe_start > per_end)) @@ -2535,14 +2535,14 @@ return 1; /* Split LV segments to match PE ranges */ - list_iterate_items(seg, &lv_where->segments) { + dm_list_iterate_items(seg, &lv_where->segments) { for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_PV || seg_dev(seg, s) != pvl->pv->dev) continue; /* Do these PEs match with the condition? */ - list_iterate_items(per, pvl->pe_ranges) { + dm_list_iterate_items(per, pvl->pe_ranges) { pe_start = seg_pe(seg, s); pe_end = pe_start + seg->area_len - 1; per_end = per->start + per->count - 1; @@ -2589,7 +2589,7 @@ struct logical_volume *layer_lv, uint32_t status, struct pv_list *pvl, - struct list *lvs_changed) + struct dm_list *lvs_changed) { struct lv_segment *seg; struct lv_list *lvl; @@ -2604,7 +2604,7 @@ return_0; /* Work through all segments on the supplied PV */ - list_iterate_items(seg, &lv_where->segments) { + dm_list_iterate_items(seg, &lv_where->segments) { for (s = 0; s < seg->area_count; s++) { if (!_match_seg_area_to_pe_range(seg, s, pvl)) continue; @@ -2616,7 +2616,7 @@ return 0; } lvl->lv = lv_where; - list_add(lvs_changed, &lvl->list); + dm_list_add(lvs_changed, &lvl->list); lv_used = 1; } --- LVM2/lib/metadata/merge.c 2008/02/22 13:22:44 1.35 +++ LVM2/lib/metadata/merge.c 2008/11/03 22:14:29 1.36 @@ -37,17 +37,17 @@ int lv_merge_segments(struct logical_volume *lv) { - struct list *segh, *t; + struct dm_list *segh, *t; struct lv_segment *current, *prev = NULL; if (lv->status & LOCKED || lv->status & PVMOVE) return 1; - list_iterate_safe(segh, t, &lv->segments) { - current = list_item(segh, struct lv_segment); + dm_list_iterate_safe(segh, t, &lv->segments) { + current = dm_list_item(segh, struct lv_segment); if (_merge(prev, current)) - list_del(¤t->list); + dm_list_del(¤t->list); else prev = current; } @@ -67,7 +67,7 @@ uint32_t area_multiplier, s; struct seg_list *sl; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { seg_count++; if (seg->le != le) { log_error("LV %s invalid: segment %u should begin at " @@ -175,7 +175,7 @@ } */ seg_found = 0; - list_iterate_items(sl, &seg_lv(seg, s)->segs_using_this_lv) + dm_list_iterate_items(sl, &seg_lv(seg, s)->segs_using_this_lv) if (sl->seg == seg) seg_found++; if (!seg_found) { @@ -198,7 +198,7 @@ le += seg->len; } - list_iterate_items(sl, &lv->segs_using_this_lv) { + dm_list_iterate_items(sl, &lv->segs_using_this_lv) { seg = sl->seg; seg_found = 0; for (s = 0; s < seg->area_count; s++) { @@ -226,7 +226,7 @@ } seg_found = 0; - list_iterate_items(seg2, &seg->lv->segments) + dm_list_iterate_items(seg2, &seg->lv->segments) if (sl->seg == seg2) { seg_found++; break; @@ -334,7 +334,7 @@ } /* Add split off segment to the list _after_ the original one */ - list_add_h(&seg->list, &split_seg->list); + dm_list_add_h(&seg->list, &split_seg->list); return 1; } --- LVM2/lib/metadata/metadata-exported.h 2008/09/25 15:57:02 1.54 +++ LVM2/lib/metadata/metadata-exported.h 2008/11/03 22:14:29 1.55 @@ -134,7 +134,7 @@ struct labeller; struct format_type { - struct list list; + struct dm_list list; struct cmd_context *cmd; struct format_handler *ops; struct labeller *labeller; @@ -147,7 +147,7 @@ }; struct pv_segment { - struct list list; /* Member of pv->segments: ordered list + struct dm_list list; /* Member of pv->segments: ordered list * covering entire data area on this PV */ struct physical_volume *pv; @@ -177,13 +177,13 @@ uint32_t pe_alloc_count; unsigned long pe_align; - struct list segments; /* Ordered pv_segments covering complete PV */ - struct list tags; + struct dm_list segments; /* Ordered pv_segments covering complete PV */ + struct dm_list tags; }; struct format_instance { const struct format_type *fmt; - struct list metadata_areas; /* e.g. metadata locations */ + struct dm_list metadata_areas; /* e.g. metadata locations */ void *private; }; @@ -208,12 +208,12 @@ /* physical volumes */ uint32_t pv_count; - struct list pvs; + struct dm_list pvs; /* * logical volumes * The following relationship should always hold: - * list_size(lvs) = lv_count + 2 * snapshot_count + * dm_list_size(lvs) = lv_count + 2 * snapshot_count * * Snapshots consist of 2 instances of "struct logical_volume": * - cow (lv_name is visible to the user) @@ -229,9 +229,9 @@ */ uint32_t lv_count; uint32_t snapshot_count; - struct list lvs; + struct dm_list lvs; - struct list tags; + struct dm_list tags; }; /* There will be one area for each stripe */ @@ -250,7 +250,7 @@ struct segment_type; struct lv_segment { - struct list list; + struct dm_list list; struct logical_volume *lv; const struct segment_type *segtype; @@ -265,13 +265,13 @@ uint32_t area_len; struct logical_volume *origin; struct logical_volume *cow; - struct list origin_list; + struct dm_list origin_list; uint32_t chunk_size; /* For snapshots - in sectors */ uint32_t region_size; /* For mirrors - in sectors */ uint32_t extents_copied; struct logical_volume *log_lv; - struct list tags; + struct dm_list tags; struct lv_segment_area *areas; }; @@ -296,29 +296,29 @@ uint32_t le_count; uint32_t origin_count; - struct list snapshot_segs; + struct dm_list snapshot_segs; struct lv_segment *snapshot; - struct list segments; - struct list tags; - struct list segs_using_this_lv; + struct dm_list segments; + struct dm_list tags; + struct dm_list segs_using_this_lv; }; struct pe_range { - struct list list; + struct dm_list list; uint32_t start; /* PEs */ uint32_t count; /* PEs */ }; struct pv_list { - struct list list; + struct dm_list list; struct physical_volume *pv; - struct list *mdas; /* Metadata areas */ - struct list *pe_ranges; /* Ranges of PEs e.g. for allocation */ + struct dm_list *mdas; /* Metadata areas */ + struct dm_list *pe_ranges; /* Ranges of PEs e.g. for allocation */ }; struct lv_list { - struct list list; + struct dm_list list; struct logical_volume *lv; }; @@ -331,17 +331,17 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const char *vgid, int *consistent); struct physical_volume *pv_read(struct cmd_context *cmd, const char *pv_name, - struct list *mdas, uint64_t *label_sector, + struct dm_list *mdas, uint64_t *label_sector, int warnings); -struct list *get_pvs(struct cmd_context *cmd); +struct dm_list *get_pvs(struct cmd_context *cmd); /* Set full_scan to 1 to re-read every (filtered) device label */ -struct list *get_vgs(struct cmd_context *cmd, int full_scan); -struct list *get_vgids(struct cmd_context *cmd, int full_scan); +struct dm_list *get_vgs(struct cmd_context *cmd, int full_scan); +struct dm_list *get_vgids(struct cmd_context *cmd, int full_scan); int scan_vgs_for_pvs(struct cmd_context *cmd); int pv_write(struct cmd_context *cmd, struct physical_volume *pv, - struct list *mdas, int64_t label_sector); + struct dm_list *mdas, int64_t label_sector); int is_pv(pv_t *pv); int is_orphan_vg(const char *vg_name); int is_orphan(const pv_t *pv); @@ -363,14 +363,14 @@ uint32_t existing_extent_count, uint32_t existing_extent_size, int pvmetadatacopies, - uint64_t pvmetadatasize, struct list *mdas); + uint64_t pvmetadatasize, struct dm_list *mdas); int pv_resize(struct physical_volume *pv, struct volume_group *vg, uint32_t new_pe_count); int pv_analyze(struct cmd_context *cmd, const char *pv_name, uint64_t label_sector); /* FIXME: move internal to library */ -uint32_t pv_list_extents_free(const struct list *pvh); +uint32_t pv_list_extents_free(const struct dm_list *pvh); struct volume_group *vg_create(struct cmd_context *cmd, const char *name, uint32_t extent_size, uint32_t max_pv, @@ -415,7 +415,7 @@ uint32_t stripes, uint32_t stripe_size, uint32_t mirrors, uint32_t extents, struct physical_volume *mirrored_pv, uint32_t mirrored_pe, - uint32_t status, struct list *allocatable_pvs, + uint32_t status, struct dm_list *allocatable_pvs, alloc_policy_t alloc); /* lv must be part of lv->vg->lvs */ @@ -438,15 +438,15 @@ struct logical_volume *layer_lv, uint32_t status, struct pv_list *pv, - struct list *lvs_changed); + struct dm_list *lvs_changed); int remove_layers_for_segments(struct cmd_context *cmd, struct logical_volume *lv, struct logical_volume *layer_lv, - uint32_t status_mask, struct list *lvs_changed); + uint32_t status_mask, struct dm_list *lvs_changed); int remove_layers_for_segments_all(struct cmd_context *cmd, struct logical_volume *layer_lv, uint32_t status_mask, - struct list *lvs_changed); + struct dm_list *lvs_changed); int split_parent_segments_for_layer(struct cmd_context *cmd, struct logical_volume *layer_lv); int remove_layer_from_lv(struct logical_volume *lv, @@ -507,10 +507,10 @@ int lv_add_mirrors(struct cmd_context *cmd, struct logical_volume *lv, uint32_t mirrors, uint32_t stripes, uint32_t region_size, uint32_t log_count, - struct list *pvs, alloc_policy_t alloc, uint32_t flags); + struct dm_list *pvs, alloc_policy_t alloc, uint32_t flags); int lv_remove_mirrors(struct cmd_context *cmd, struct logical_volume *lv, uint32_t mirrors, uint32_t log_count, - struct list *pvs, uint32_t status_mask); + struct dm_list *pvs, uint32_t status_mask); int is_temporary_mirror_layer(const struct logical_volume *lv); struct logical_volume * find_temporary_mirror(const struct logical_volume *lv); @@ -521,24 +521,24 @@ uint32_t new_mirrors, uint32_t status_mask); int add_mirrors_to_segments(struct cmd_context *cmd, struct logical_volume *lv, uint32_t mirrors, uint32_t region_size, - struct list *allocatable_pvs, alloc_policy_t alloc); + struct dm_list *allocatable_pvs, alloc_policy_t alloc); int remove_mirror_images(struct logical_volume *lv, uint32_t num_mirrors, - struct list *removable_pvs, unsigned remove_log); + struct dm_list *removable_pvs, unsigned remove_log); int add_mirror_images(struct cmd_context *cmd, struct logical_volume *lv, uint32_t mirrors, uint32_t stripes, uint32_t region_size, - struct list *allocatable_pvs, alloc_policy_t alloc, + struct dm_list *allocatable_pvs, alloc_policy_t alloc, uint32_t log_count); struct logical_volume *detach_mirror_log(struct lv_segment *seg); int attach_mirror_log(struct lv_segment *seg, struct logical_volume *lv); int remove_mirror_log(struct cmd_context *cmd, struct logical_volume *lv, - struct list *removable_pvs); + struct dm_list *removable_pvs); int add_mirror_log(struct cmd_context *cmd, struct logical_volume *lv, uint32_t log_count, uint32_t region_size, - struct list *allocatable_pvs, alloc_policy_t alloc); + struct dm_list *allocatable_pvs, alloc_policy_t alloc); int reconfigure_mirror_images(struct lv_segment *mirrored_seg, uint32_t num_mirrors, - struct list *removable_pvs, unsigned remove_log); + struct dm_list *removable_pvs, unsigned remove_log); int collapse_mirrored_lv(struct logical_volume *lv); int shift_mirror_images(struct lv_segment *mirrored_seg, unsigned mimage); @@ -551,7 +551,7 @@ const char *get_pvmove_pvname_from_lv(struct logical_volume *lv); const char *get_pvmove_pvname_from_lv_mirr(struct logical_volume *lv_mirr); float copy_percent(struct logical_volume *lv_mirr); -struct list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg, +struct dm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv); uint32_t find_free_lvnum(struct logical_volume *lv); --- LVM2/lib/metadata/metadata.c 2008/10/03 14:22:18 1.194 +++ LVM2/lib/metadata/metadata.c 2008/11/03 22:14:29 1.195 @@ -39,7 +39,7 @@ static struct physical_volume *_pv_read(struct cmd_context *cmd, const char *pv_name, - struct list *mdas, + struct dm_list *mdas, uint64_t *label_sector, int warnings); @@ -50,11 +50,11 @@ uint32_t existing_extent_count, uint32_t existing_extent_size, int pvmetadatacopies, - uint64_t pvmetadatasize, struct list *mdas); + uint64_t pvmetadatasize, struct dm_list *mdas); static int _pv_write(struct cmd_context *cmd __attribute((unused)), struct physical_volume *pv, - struct list *mdas, int64_t label_sector); + struct dm_list *mdas, int64_t label_sector); static struct physical_volume *_find_pv_by_name(struct cmd_context *cmd, const char *pv_name); @@ -181,7 +181,7 @@ return_0; pvl->pv = pv; - list_add(&vg->pvs, &pvl->list); + dm_list_add(&vg->pvs, &pvl->list); if ((uint64_t) vg->extent_count + pv->pe_count > UINT32_MAX) { log_error("Unable to add %s to %s: new extent count (%" @@ -234,7 +234,7 @@ log_warn("WARNING: Volume group %s is not consistent", vg_name); - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (id_equal(&pvl->pv->id, (const struct id *) pvid)) { if (!_copy_pv(pv, pvl->pv)) return_0; @@ -303,7 +303,7 @@ return 0; } - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (!(pvl->pv->vg_name = dm_pool_strdup(mem, new_name))) { log_error("pv->vg_name allocation failed for '%s'", pv_dev_name(pvl->pv)); @@ -318,11 +318,11 @@ struct volume_group *vg, force_t force) { - struct list *lst; + struct dm_list *lst; struct lv_list *lvl; - while ((lst = list_first(&vg->lvs))) { - lvl = list_item(lst, struct lv_list); + while ((lst = dm_list_first(&vg->lvs))) { + lvl = dm_list_item(lst, struct lv_list); if (!lv_remove_with_dependencies(cmd, lvl->lv, force)) return 0; } @@ -378,7 +378,7 @@ } /* init physical volumes */ - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { pv = pvl->pv; log_verbose("Removing physical volume \"%s\" from " "volume group \"%s\"", pv_dev_name(pv), vg_name); @@ -534,14 +534,14 @@ vg->alloc = alloc; vg->pv_count = 0; - list_init(&vg->pvs); + dm_list_init(&vg->pvs); vg->lv_count = 0; - list_init(&vg->lvs); + dm_list_init(&vg->lvs); vg->snapshot_count = 0; - list_init(&vg->tags); + dm_list_init(&vg->tags); if (!(vg->fid = cmd->fmt->ops->create_instance(cmd->fmt, vg_name, NULL, NULL))) { @@ -619,7 +619,7 @@ return_0; /* foreach PV */ - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { pv = pvl->pv; pv->pe_size = new_size; @@ -632,7 +632,7 @@ return_0; /* foreach free PV Segment */ - list_iterate_items(pvseg, &pv->segments) { + dm_list_iterate_items(pvseg, &pv->segments) { if (pvseg_is_allocated(pvseg)) continue; @@ -648,14 +648,14 @@ } /* foreach LV */ - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { lv = lvl->lv; if (!_recalc_extents(&lv->le_count, lv->name, "", old_size, new_size)) return_0; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (!_recalc_extents(&seg->le, lv->name, " segment start", old_size, new_size)) @@ -721,13 +721,13 @@ struct volume_group *vg_from, struct volume_group *vg_to) { struct metadata_area *mda, *mda2; - struct list *mdas_from, *mdas_to; + struct dm_list *mdas_from, *mdas_to; int common_mda = 0; mdas_from = &vg_from->fid->metadata_areas; mdas_to = &vg_to->fid->metadata_areas; - list_iterate_items_safe(mda, mda2, mdas_from) { + dm_list_iterate_items_safe(mda, mda2, mdas_from) { if (!mda->ops->mda_in_vg) { common_mda = 1; continue; @@ -735,14 +735,14 @@ if (!mda->ops->mda_in_vg(vg_from->fid, vg_from, mda)) { if (is_orphan_vg(vg_to->name)) - list_del(&mda->list); + dm_list_del(&mda->list); else - list_move(mdas_to, &mda->list); + dm_list_move(mdas_to, &mda->list); } } - if (list_empty(mdas_from) || - (!is_orphan_vg(vg_to->name) && list_empty(mdas_to))) + if (dm_list_empty(mdas_from) || + (!is_orphan_vg(vg_to->name) && dm_list_empty(mdas_to))) return common_mda; return 1; @@ -775,7 +775,7 @@ uint32_t existing_extent_count, uint32_t existing_extent_size, int pvmetadatacopies, - uint64_t pvmetadatasize, struct list *mdas) + uint64_t pvmetadatasize, struct dm_list *mdas) { return _pv_create(cmd->fmt, dev, id, size, pe_start, existing_extent_count, @@ -811,8 +811,8 @@ pv->status = ALLOCATABLE_PV; - list_init(&pv->tags); - list_init(&pv->segments); + dm_list_init(&pv->tags); + dm_list_init(&pv->segments); return pv; } @@ -825,7 +825,7 @@ uint32_t existing_extent_count, uint32_t existing_extent_size, int pvmetadatacopies, - uint64_t pvmetadatasize, struct list *mdas) + uint64_t pvmetadatasize, struct dm_list *mdas) { struct dm_pool *mem = fmt->cmd->mem; struct physical_volume *pv = _alloc_pv(mem, dev); @@ -891,19 +891,19 @@ { struct pv_list *pvl; - list_iterate_items(pvl, &vg->pvs) + dm_list_iterate_items(pvl, &vg->pvs) if (pvl->pv->dev == dev_cache_get(pv_name, vg->cmd->filter)) return pvl; return NULL; } -struct pv_list *find_pv_in_pv_list(const struct list *pl, +struct pv_list *find_pv_in_pv_list(const struct dm_list *pl, const struct physical_volume *pv) { struct pv_list *pvl; - list_iterate_items(pvl, pl) + dm_list_iterate_items(pvl, pl) if (pvl->pv == pv) return pvl; @@ -914,7 +914,7 @@ { struct pv_list *pvl; - list_iterate_items(pvl, &vg->pvs) + dm_list_iterate_items(pvl, &vg->pvs) if (pv == pvl->pv) return 1; @@ -945,7 +945,7 @@ { struct pv_list *pvl; - list_iterate_items(pvl, &vg->pvs) + dm_list_iterate_items(pvl, &vg->pvs) if (id_equal(&pvl->pv->id, id)) return pvl->pv; @@ -964,19 +964,19 @@ else ptr = lv_name; - list_iterate_items(lvl, &vg->lvs) + dm_list_iterate_items(lvl, &vg->lvs) if (!strcmp(lvl->lv->name, ptr)) return lvl; return NULL; } -struct lv_list *find_lv_in_lv_list(const struct list *ll, +struct lv_list *find_lv_in_lv_list(const struct dm_list *ll, const struct logical_volume *lv) { struct lv_list *lvl; - list_iterate_items(lvl, ll) + dm_list_iterate_items(lvl, ll) if (lvl->lv == lv) return lvl; @@ -988,7 +988,7 @@ { struct lv_list *lvl; - list_iterate_items(lvl, &vg->lvs) + dm_list_iterate_items(lvl, &vg->lvs) if (!strncmp(lvl->lv->lvid.s, lvid->s, sizeof(*lvid))) return lvl; @@ -1006,7 +1006,7 @@ { struct pv_list *pvl; - list_iterate_items(pvl, &vg->pvs) + dm_list_iterate_items(pvl, &vg->pvs) if (dev == pvl->pv->dev) return pvl->pv; @@ -1054,7 +1054,7 @@ { struct lv_segment *seg; - list_iterate_items(seg, &lv->segments) + dm_list_iterate_items(seg, &lv->segments) if (le >= seg->le && le < seg->le + seg->len) return seg; @@ -1065,7 +1065,7 @@ { struct lv_segment *seg = NULL; - list_iterate_items(seg, &lv->segments) + dm_list_iterate_items(seg, &lv->segments) break; return seg; @@ -1076,7 +1076,7 @@ { struct pv_segment *peg; - list_iterate_items(peg, &pv->segments) + dm_list_iterate_items(peg, &pv->segments) if (pe >= peg->pe && pe < peg->pe + peg->len) return peg; @@ -1089,7 +1089,7 @@ /* FIXME Improve recovery situation? */ /* Remove each copy of the metadata */ - list_iterate_items(mda, &vg->fid->metadata_areas) { + dm_list_iterate_items(mda, &vg->fid->metadata_areas) { if (mda->ops->vg_remove && !mda->ops->vg_remove(vg->fid, vg, mda)) return_0; @@ -1154,10 +1154,10 @@ } /* Check no conflicts with LV names */ - list_iterate_items(lvl1, &vg_to->lvs) { + dm_list_iterate_items(lvl1, &vg_to->lvs) { name1 = lvl1->lv->name; - list_iterate_items(lvl2, &vg_from->lvs) { + dm_list_iterate_items(lvl2, &vg_from->lvs) { name2 = lvl2->lv->name; if (!strcmp(name1, name2)) { @@ -1171,7 +1171,7 @@ } /* Check no PVs are constructed from either VG */ - list_iterate_items(pvl, &vg_to->pvs) { + dm_list_iterate_items(pvl, &vg_to->pvs) { if (pv_uses_vg(pvl->pv, vg_from)) { log_error("Physical volume %s might be constructed " "from same volume group %s.", @@ -1180,7 +1180,7 @@ } } - list_iterate_items(pvl, &vg_from->pvs) { + dm_list_iterate_items(pvl, &vg_from->pvs) { if (pv_uses_vg(pvl->pv, vg_to)) { log_error("Physical volume %s might be constructed " "from same volume group %s.", @@ -1228,7 +1228,7 @@ return_0; } - list_iterate_items(lvseg, &lv->segments) { + dm_list_iterate_items(lvseg, &lv->segments) { if (lvseg->log_lv && !fn(lvseg->log_lv, data)) return_0; for (s = 0; s < lvseg->area_count; ++s) { @@ -1306,7 +1306,7 @@ struct _lv_mark_if_partial_baton baton; struct lv_segment *lvseg; - list_iterate_items(lvseg, &lv->segments) { + dm_list_iterate_items(lvseg, &lv->segments) { for (s = 0; s < lvseg->area_count; ++s) { if (seg_type(lvseg, s) == AREA_PV) { if (seg_pv(lvseg, s)->status & MISSING_PV) @@ -1339,7 +1339,7 @@ struct logical_volume *lv; struct lv_list *lvl; - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { lv = lvl->lv; if (!_lv_mark_if_partial(lv)) return_0; @@ -1357,8 +1357,8 @@ /* FIXME Also check there's no data/metadata overlap */ - list_iterate_items(pvl, &vg->pvs) { - list_iterate_items(pvl2, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl2, &vg->pvs) { if (pvl == pvl2) break; if (id_equal(&pvl->pv->id, @@ -1387,17 +1387,17 @@ r = 0; } - if ((lv_count = (uint32_t) list_size(&vg->lvs)) != + if ((lv_count = (uint32_t) dm_list_size(&vg->lvs)) != vg->lv_count + 2 * vg->snapshot_count) { log_error("Internal error: #internal LVs (%u) != #LVs (%" PRIu32 ") + 2 * #snapshots (%" PRIu32 ") in VG %s", - list_size(&vg->lvs), vg->lv_count, + dm_list_size(&vg->lvs), vg->lv_count, vg->snapshot_count, vg->name); r = 0; } - list_iterate_items(lvl, &vg->lvs) { - list_iterate_items(lvl2, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl2, &vg->lvs) { if (lvl == lvl2) break; if (!strcmp(lvl->lv->name, lvl2->lv->name)) { @@ -1420,7 +1420,7 @@ } } - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { if (!check_lv_segments(lvl->lv, 1)) { log_error("Internal error: LV segments corrupted in %s.", lvl->lv->name); @@ -1444,7 +1444,7 @@ */ int vg_write(struct volume_group *vg) { - struct list *mdah; + struct dm_list *mdah; struct metadata_area *mda; if (!vg_validate(vg)) @@ -1461,7 +1461,7 @@ return 0; } - if (list_empty(&vg->fid->metadata_areas)) { + if (dm_list_empty(&vg->fid->metadata_areas)) { log_error("Aborting vg_write: No metadata areas to write to!"); return 0; } @@ -1474,13 +1474,13 @@ vg->seqno++; /* Write to each copy of the metadata area */ - list_iterate_items(mda, &vg->fid->metadata_areas) { + dm_list_iterate_items(mda, &vg->fid->metadata_areas) { if (!mda->ops->vg_write) { log_error("Format does not support writing volume" "group metadata areas"); /* Revert */ - list_uniterate(mdah, &vg->fid->metadata_areas, &mda->list) { - mda = list_item(mdah, struct metadata_area); + dm_list_uniterate(mdah, &vg->fid->metadata_areas, &mda->list) { + mda = dm_list_item(mdah, struct metadata_area); if (mda->ops->vg_revert && !mda->ops->vg_revert(vg->fid, vg, mda)) { @@ -1492,8 +1492,8 @@ if (!mda->ops->vg_write(vg->fid, vg, mda)) { stack; /* Revert */ - list_uniterate(mdah, &vg->fid->metadata_areas, &mda->list) { - mda = list_item(mdah, struct metadata_area); + dm_list_uniterate(mdah, &vg->fid->metadata_areas, &mda->list) { + mda = dm_list_item(mdah, struct metadata_area); if (mda->ops->vg_revert && !mda->ops->vg_revert(vg->fid, vg, mda)) { @@ -1505,12 +1505,12 @@ } /* Now pre-commit each copy of the new metadata */ - list_iterate_items(mda, &vg->fid->metadata_areas) { + dm_list_iterate_items(mda, &vg->fid->metadata_areas) { if (mda->ops->vg_precommit && !mda->ops->vg_precommit(vg->fid, vg, mda)) { stack; /* Revert */ - list_iterate_items(mda, &vg->fid->metadata_areas) { + dm_list_iterate_items(mda, &vg->fid->metadata_areas) { if (mda->ops->vg_revert && !mda->ops->vg_revert(vg->fid, vg, mda)) { stack; @@ -1537,7 +1537,7 @@ } /* Commit to each copy of the metadata area */ - list_iterate_items(mda, &vg->fid->metadata_areas) { + dm_list_iterate_items(mda, &vg->fid->metadata_areas) { failed = 0; if (mda->ops->vg_commit && !mda->ops->vg_commit(vg->fid, vg, mda)) { @@ -1565,7 +1565,7 @@ { struct metadata_area *mda; - list_iterate_items(mda, &vg->fid->metadata_areas) { + dm_list_iterate_items(mda, &vg->fid->metadata_areas) { if (mda->ops->vg_revert && !mda->ops->vg_revert(vg->fid, vg, mda)) { stack; @@ -1598,9 +1598,9 @@ log_error("vg allocation failed"); return NULL; } - list_init(&vg->pvs); - list_init(&vg->lvs); - list_init(&vg->tags); + dm_list_init(&vg->pvs); + dm_list_init(&vg->lvs); + dm_list_init(&vg->tags); vg->cmd = cmd; if (!(vg->name = dm_pool_strdup(cmd->mem, orphan_vgname))) { log_error("vg name allocation failed"); @@ -1616,7 +1616,7 @@ return NULL; } - list_iterate_items(info, &vginfo->infos) { + dm_list_iterate_items(info, &vginfo->infos) { if (!(pv = _pv_read(cmd, dev_name(info->dev), NULL, NULL, 1))) { continue; } @@ -1625,19 +1625,19 @@ return NULL; } pvl->pv = pv; - list_add(&vg->pvs, &pvl->list); + dm_list_add(&vg->pvs, &pvl->list); vg->pv_count++; } return vg; } -static int _update_pv_list(struct list *all_pvs, struct volume_group *vg) +static int _update_pv_list(struct dm_list *all_pvs, struct volume_group *vg) { struct pv_list *pvl, *pvl2; - list_iterate_items(pvl, &vg->pvs) { - list_iterate_items(pvl2, all_pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl2, all_pvs) { if (pvl->pv->dev == pvl2->pv->dev) goto next_pv; } @@ -1648,7 +1648,7 @@ return 0; } pvl2->pv = pvl->pv; - list_add(all_pvs, &pvl2->list); + dm_list_add(all_pvs, &pvl2->list); next_pv: ; } @@ -1660,7 +1660,7 @@ { int ret = 0; struct pv_list *pvl; - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (pvl->pv->status & MISSING_PV) ++ ret; } @@ -1692,9 +1692,9 @@ int inconsistent_vgid = 0; int inconsistent_pvs = 0; unsigned use_precommitted = precommitted; - struct list *pvids; + struct dm_list *pvids; struct pv_list *pvl, *pvl2; - struct list all_pvs; + struct dm_list all_pvs; char uuid[64] __attribute((aligned(8))); if (is_orphan_vg(vgname)) { @@ -1748,7 +1748,7 @@ return_NULL; /* Ensure contents of all metadata areas match - else do recovery */ - list_iterate_items(mda, &fid->metadata_areas) { + dm_list_iterate_items(mda, &fid->metadata_areas) { if ((use_precommitted && !(vg = mda->ops->vg_read_precommit(fid, vgname, mda))) || (!use_precommitted && @@ -1775,8 +1775,8 @@ * orphans in the cache: update the cache state here. */ if (!inconsistent && - list_size(&correct_vg->pvs) > list_size(pvids)) { - list_iterate_items(pvl, &correct_vg->pvs) { + dm_list_size(&correct_vg->pvs) > dm_list_size(pvids)) { + dm_list_iterate_items(pvl, &correct_vg->pvs) { if (!pvl->pv->dev) { inconsistent_pvs = 1; break; @@ -1791,7 +1791,7 @@ */ if (!(info = info_from_pvid(pvl->pv->dev->pvid, 1)) || !info->vginfo || !is_orphan_vg(info->vginfo->vgname) || - list_size(&info->mdas)) { + dm_list_size(&info->mdas)) { inconsistent_pvs = 1; break; } @@ -1808,7 +1808,7 @@ } } - if (list_size(&correct_vg->pvs) != list_size(pvids) + if (dm_list_size(&correct_vg->pvs) != dm_list_size(pvids) + vg_missing_pv_count(correct_vg)) { log_debug("Cached VG %s had incorrect PV list", vgname); @@ -1817,7 +1817,7 @@ inconsistent = 1; else correct_vg = NULL; - } else list_iterate_items(pvl, &correct_vg->pvs) { + } else dm_list_iterate_items(pvl, &correct_vg->pvs) { if (pvl->pv->status & MISSING_PV) continue; if (!str_list_match_item(pvids, pvl->pv->dev->pvid)) { @@ -1829,7 +1829,7 @@ } } - list_init(&all_pvs); + dm_list_init(&all_pvs); /* Failed to find VG where we expected it - full scan and retry */ if (!correct_vg) { @@ -1851,7 +1851,7 @@ } /* Ensure contents of all metadata areas match - else recover */ - list_iterate_items(mda, &fid->metadata_areas) { + dm_list_iterate_items(mda, &fid->metadata_areas) { if ((use_precommitted && !(vg = mda->ops->vg_read_precommit(fid, vgname, mda))) || @@ -1923,8 +1923,8 @@ return NULL; } - list_iterate_items(pvl, &all_pvs) { - list_iterate_items(pvl2, &correct_vg->pvs) { + dm_list_iterate_items(pvl, &all_pvs) { + dm_list_iterate_items(pvl2, &correct_vg->pvs) { if (pvl->pv->dev == pvl2->pv->dev) goto next_pv; } @@ -1972,7 +1972,7 @@ return NULL; } - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { if (!check_lv_segments(lvl->lv, 1)) { log_error("Internal error: LV segments corrupted in %s.", lvl->lv->name); @@ -1992,7 +1992,7 @@ unsigned precommitted) { const char *vgname; - struct list *vgnames; + struct dm_list *vgnames; struct volume_group *vg; struct lvmcache_vginfo *vginfo; struct str_list *strl; @@ -2027,7 +2027,7 @@ return NULL; } - list_iterate_items(strl, vgnames) { + dm_list_iterate_items(strl, vgnames) { vgname = strl->str; if (!vgname || is_orphan_vg(vgname)) continue; // FIXME Unnecessary? @@ -2093,7 +2093,7 @@ * FIXME - liblvm todo - make into function that returns handle */ struct physical_volume *pv_read(struct cmd_context *cmd, const char *pv_name, - struct list *mdas, uint64_t *label_sector, + struct dm_list *mdas, uint64_t *label_sector, int warnings) { return _pv_read(cmd, pv_name, mdas, label_sector, warnings); @@ -2102,7 +2102,7 @@ /* FIXME Use label functions instead of PV functions */ static struct physical_volume *_pv_read(struct cmd_context *cmd, const char *pv_name, - struct list *mdas, + struct dm_list *mdas, uint64_t *label_sector, int warnings) { @@ -2130,8 +2130,8 @@ return NULL; } - list_init(&pv->tags); - list_init(&pv->segments); + dm_list_init(&pv->tags); + dm_list_init(&pv->segments); /* FIXME Move more common code up here */ if (!(info->fmt->ops->pv_read(info->fmt, pv_name, pv, mdas))) { @@ -2150,23 +2150,23 @@ } /* May return empty list */ -struct list *get_vgs(struct cmd_context *cmd, int full_scan) +struct dm_list *get_vgs(struct cmd_context *cmd, int full_scan) { return lvmcache_get_vgnames(cmd, full_scan); } -struct list *get_vgids(struct cmd_context *cmd, int full_scan) +struct dm_list *get_vgids(struct cmd_context *cmd, int full_scan) { return lvmcache_get_vgids(cmd, full_scan); } -static int _get_pvs(struct cmd_context *cmd, struct list **pvslist) +static int _get_pvs(struct cmd_context *cmd, struct dm_list **pvslist) { struct str_list *strl; - struct list * uninitialized_var(results); + struct dm_list * uninitialized_var(results); const char *vgname, *vgid; - struct list *pvh, *tmp; - struct list *vgids; + struct dm_list *pvh, *tmp; + struct dm_list *vgids; struct volume_group *vg; int consistent = 0; int old_pvmove; @@ -2179,7 +2179,7 @@ return 0; } - list_init(results); + dm_list_init(results); } /* Get list of VGs */ @@ -2192,7 +2192,7 @@ /* Orphan VG is last on list */ old_pvmove = pvmove_mode(); init_pvmove(1); - list_iterate_items(strl, vgids) { + dm_list_iterate_items(strl, vgids) { vgid = strl->str; if (!vgid) continue; /* FIXME Unnecessary? */ @@ -2211,8 +2211,8 @@ /* Move PVs onto results list */ if (pvslist) - list_iterate_safe(pvh, tmp, &vg->pvs) - list_add(results, pvh); + dm_list_iterate_safe(pvh, tmp, &vg->pvs) + dm_list_add(results, pvh); } init_pvmove(old_pvmove); @@ -2224,9 +2224,9 @@ return 1; } -struct list *get_pvs(struct cmd_context *cmd) +struct dm_list *get_pvs(struct cmd_context *cmd) { - struct list *results; + struct dm_list *results; if (!_get_pvs(cmd, &results)) return NULL; @@ -2242,14 +2242,14 @@ /* FIXME: liblvm todo - make into function that takes handle */ int pv_write(struct cmd_context *cmd __attribute((unused)), struct physical_volume *pv, - struct list *mdas, int64_t label_sector) + struct dm_list *mdas, int64_t label_sector) { return _pv_write(cmd, pv, mdas, label_sector); } static int _pv_write(struct cmd_context *cmd __attribute((unused)), struct physical_volume *pv, - struct list *mdas, int64_t label_sector) + struct dm_list *mdas, int64_t label_sector) { if (!pv->fmt->ops->pv_write) { log_error("Format does not support writing physical volumes"); @@ -2354,7 +2354,7 @@ * Next, loop through metadata areas */ info = label->info; - list_iterate_items(mda, &info->mdas) + dm_list_iterate_items(mda, &info->mdas) mda->ops->pv_analyze_mda(info->fmt, mda); return 1; @@ -2525,8 +2525,8 @@ */ pv_t *pv_by_path(struct cmd_context *cmd, const char *pv_name) { - struct list mdas; + struct dm_list mdas; - list_init(&mdas); + dm_list_init(&mdas); return _pv_read(cmd, pv_name, &mdas, NULL, 1); } --- LVM2/lib/metadata/metadata.h 2008/09/25 15:57:02 1.183 +++ LVM2/lib/metadata/metadata.h 2008/11/03 22:14:29 1.184 @@ -141,7 +141,7 @@ }; struct metadata_area { - struct list list; + struct dm_list list; struct metadata_area_ops *ops; void *metadata_locn; }; @@ -152,22 +152,22 @@ #define seg_le(seg, s) (seg)->areas[(s)].u.lv.le struct name_list { - struct list list; + struct dm_list list; char *name; }; struct mda_list { - struct list list; + struct dm_list list; struct device_area mda; }; struct peg_list { - struct list list; + struct dm_list list; struct pv_segment *peg; }; struct seg_list { - struct list list; + struct dm_list list; unsigned count; struct lv_segment *seg; }; @@ -185,7 +185,7 @@ * Return PV with given path. */ int (*pv_read) (const struct format_type * fmt, const char *pv_name, - struct physical_volume * pv, struct list * mdas); + struct physical_volume * pv, struct dm_list * mdas); /* * Tweak an already filled out a pv ready for importing into a @@ -195,7 +195,7 @@ uint64_t pe_start, uint32_t extent_count, uint32_t extent_size, int pvmetadatacopies, - uint64_t pvmetadatasize, struct list * mdas, + uint64_t pvmetadatasize, struct dm_list * mdas, struct physical_volume * pv, struct volume_group * vg); /* @@ -203,7 +203,7 @@ * pv->vg_name must be a valid orphan VG name */ int (*pv_write) (const struct format_type * fmt, - struct physical_volume * pv, struct list * mdas, + struct physical_volume * pv, struct dm_list * mdas, int64_t label_sector); /* @@ -265,7 +265,7 @@ struct lv_list *find_lv_in_vg_by_lvid(struct volume_group *vg, const union lvid *lvid); -struct lv_list *find_lv_in_lv_list(const struct list *ll, +struct lv_list *find_lv_in_lv_list(const struct dm_list *ll, const struct logical_volume *lv); /* Return the VG that contains a given LV (based on path given in lv_name) */ @@ -280,7 +280,7 @@ /* FIXME Merge these functions with ones above */ struct physical_volume *find_pv(struct volume_group *vg, struct device *dev); -struct pv_list *find_pv_in_pv_list(const struct list *pl, +struct pv_list *find_pv_in_pv_list(const struct dm_list *pl, const struct physical_volume *pv); /* Find LV segment containing given LE */ --- LVM2/lib/metadata/mirror.c 2008/10/17 10:50:14 1.78 +++ LVM2/lib/metadata/mirror.c 2008/11/03 22:14:29 1.79 @@ -239,7 +239,7 @@ */ static int _init_mirror_log(struct cmd_context *cmd, struct logical_volume *log_lv, int in_sync, - struct list *tags, int remove_on_failure) + struct dm_list *tags, int remove_on_failure) { struct str_list *sl; struct lvinfo info; @@ -263,7 +263,7 @@ log_lv->status |= VISIBLE_LV; /* Temporary tag mirror log for activation */ - list_iterate_items(sl, tags) + dm_list_iterate_items(sl, tags) if (!str_list_add(cmd->mem, &log_lv->tags, sl->str)) { log_error("Aborting. Unable to tag mirror log."); goto activate_lv; @@ -284,7 +284,7 @@ } /* Remove the temporary tags */ - list_iterate_items(sl, tags) + dm_list_iterate_items(sl, tags) if (!str_list_del(&log_lv->tags, sl->str)) log_error("Failed to remove tag %s from mirror log.", sl->str); @@ -323,7 +323,7 @@ revert_new_lv: log_lv->status = orig_status; - list_iterate_items(sl, tags) + dm_list_iterate_items(sl, tags) if (!str_list_del(&log_lv->tags, sl->str)) log_error("Failed to remove tag %s from mirror log.", sl->str); @@ -355,7 +355,7 @@ /* Inherit tags - maybe needed for activation */ if (!str_list_match_list(&mirror_lv->tags, &lv->tags)) { - list_iterate_items(sl, &mirror_lv->tags) + dm_list_iterate_items(sl, &mirror_lv->tags) if (!str_list_add(cmd->mem, &lv->tags, sl->str)) { log_error("Aborting. Unable to tag."); return 0; @@ -381,9 +381,9 @@ } static int _merge_mirror_images(struct logical_volume *lv, - const struct list *mimages) + const struct dm_list *mimages) { - uint32_t addition = list_size(mimages); + uint32_t addition = dm_list_size(mimages); struct logical_volume **img_lvs; struct lv_list *lvl; int i = 0; @@ -394,7 +394,7 @@ if (!(img_lvs = alloca(sizeof(*img_lvs) * addition))) return_0; - list_iterate_items(lvl, mimages) + dm_list_iterate_items(lvl, mimages) img_lvs[i++] = lvl->lv; return lv_add_mirror_lvs(lv, img_lvs, addition, @@ -420,7 +420,7 @@ /* Check if mirror image LV is removable with regard to given removable_pvs */ static int _is_mirror_image_removable(struct logical_volume *mimage_lv, - struct list *removable_pvs) + struct dm_list *removable_pvs) { struct physical_volume *pv; struct lv_segment *seg; @@ -428,7 +428,7 @@ struct pv_list *pvl; uint32_t s; - list_iterate_items(seg, &mimage_lv->segments) { + dm_list_iterate_items(seg, &mimage_lv->segments) { for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_PV) { /* FIXME Recurse for AREA_LV? */ @@ -440,7 +440,7 @@ pv = seg_pv(seg, s); pv_found = 0; - list_iterate_items(pvl, removable_pvs) { + dm_list_iterate_items(pvl, removable_pvs) { if (pv->dev->dev == pvl->pv->dev->dev) { pv_found = 1; break; @@ -481,7 +481,7 @@ */ static int _remove_mirror_images(struct logical_volume *lv, uint32_t num_removed, - struct list *removable_pvs, + struct dm_list *removable_pvs, unsigned remove_log, unsigned collapse, uint32_t *removed) { @@ -494,7 +494,7 @@ uint32_t old_area_count = mirrored_seg->area_count; uint32_t new_area_count = mirrored_seg->area_count; struct lv_list *lvl; - struct list tmp_orphan_lvs; + struct dm_list tmp_orphan_lvs; if (removed) *removed = 0; @@ -529,7 +529,7 @@ new_area_count = old_area_count - num_removed; /* Remove mimage LVs from the segment */ - list_init(&tmp_orphan_lvs); + dm_list_init(&tmp_orphan_lvs); for (m = new_area_count; m < mirrored_seg->area_count; m++) { seg_lv(mirrored_seg, m)->status &= ~MIRROR_IMAGE; seg_lv(mirrored_seg, m)->status |= VISIBLE_LV; @@ -538,7 +538,7 @@ return 0; } lvl->lv = seg_lv(mirrored_seg, m); - list_add(&tmp_orphan_lvs, &lvl->list); + dm_list_add(&tmp_orphan_lvs, &lvl->list); release_lv_segment_area(mirrored_seg, m, mirrored_seg->area_len); } mirrored_seg->area_count = new_area_count; @@ -615,7 +615,7 @@ /* Save or delete the 'orphan' LVs */ if (!collapse) { - list_iterate_items(lvl, &tmp_orphan_lvs) + dm_list_iterate_items(lvl, &tmp_orphan_lvs) if (!_delete_lv(lv, lvl->lv)) return_0; } @@ -651,7 +651,7 @@ * Remove the number of mirror images from the LV */ int remove_mirror_images(struct logical_volume *lv, uint32_t num_mirrors, - struct list *removable_pvs, unsigned remove_log) + struct dm_list *removable_pvs, unsigned remove_log) { uint32_t num_removed, removed_once, r; uint32_t existing_mirrors = lv_mirror_count(lv); @@ -844,7 +844,7 @@ } int reconfigure_mirror_images(struct lv_segment *mirrored_seg, uint32_t num_mirrors, - struct list *removable_pvs, unsigned remove_log) + struct dm_list *removable_pvs, unsigned remove_log) { int r; int in_sync; @@ -961,7 +961,7 @@ uint32_t s; /* Check the segment params are compatible */ - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (!seg_is_mirrored(seg)) { log_error("Segment is not mirrored: %s:%" PRIu32, lv->name, seg->le); @@ -975,7 +975,7 @@ } /* Convert the segments */ - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (!new_mirrors && seg->extents_copied == seg->area_len) { if (!move_lv_segment_area(seg, 0, seg, 1)) return_0; @@ -998,7 +998,7 @@ { struct lv_segment *seg; - list_iterate_items(seg, &lv_mirr->segments) { + dm_list_iterate_items(seg, &lv_mirr->segments) { if (!seg_is_mirrored(seg)) continue; if (seg_type(seg, 0) != AREA_PV) @@ -1014,7 +1014,7 @@ struct lv_segment *seg; uint32_t s; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_LV) continue; @@ -1034,14 +1034,14 @@ struct lv_segment *seg; /* Loop through all LVs */ - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { lv = lvl->lv; if (!(lv->status & lv_type)) continue; /* Check segment origins point to pvname */ - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (seg_type(seg, 0) != AREA_PV) continue; if (seg_dev(seg, 0) != dev) @@ -1066,10 +1066,10 @@ return find_pvmove_lv(vg, pv->dev, lv_type); } -struct list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg, +struct dm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv) { - struct list *lvs; + struct dm_list *lvs; struct logical_volume *lv1; struct lv_list *lvl, *lvl1; struct lv_segment *seg; @@ -1080,16 +1080,16 @@ return NULL; } - list_init(lvs); + dm_list_init(lvs); /* Loop through all LVs except the one supplied */ - list_iterate_items(lvl1, &vg->lvs) { + dm_list_iterate_items(lvl1, &vg->lvs) { lv1 = lvl1->lv; if (lv1 == lv) continue; /* Find whether any segment points at the supplied LV */ - list_iterate_items(seg, &lv1->segments) { + dm_list_iterate_items(seg, &lv1->segments) { for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_LV || seg_lv(seg, s) != lv) @@ -1099,7 +1099,7 @@ return NULL; } lvl->lv = lv1; - list_add(lvs, &lvl->list); + dm_list_add(lvs, &lvl->list); goto next_lv; } } @@ -1115,7 +1115,7 @@ uint32_t numerator = 0u, denominator = 0u; struct lv_segment *seg; - list_iterate_items(seg, &lv_mirr->segments) { + dm_list_iterate_items(seg, &lv_mirr->segments) { denominator += seg->area_len; if (seg_is_mirrored(seg) && seg->area_count > 1) @@ -1135,8 +1135,8 @@ struct lv_list *lvl; struct lv_segment *seg; - list_iterate_items(lvl, &vg->lvs) { - list_iterate_items(seg, &lvl->lv->segments) { + dm_list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(seg, &lvl->lv->segments) { if (seg->segtype != get_segtype_from_string(vg->cmd, "mirror")) continue; @@ -1154,11 +1154,11 @@ */ int add_mirrors_to_segments(struct cmd_context *cmd, struct logical_volume *lv, uint32_t mirrors, uint32_t region_size, - struct list *allocatable_pvs, alloc_policy_t alloc) + struct dm_list *allocatable_pvs, alloc_policy_t alloc) { struct alloc_handle *ah; const struct segment_type *segtype; - struct list *parallel_areas; + struct dm_list *parallel_areas; uint32_t adjusted_region_size; if (!(parallel_areas = build_parallel_areas_from_lv(cmd, lv))) @@ -1193,14 +1193,14 @@ */ int remove_mirror_log(struct cmd_context *cmd, struct logical_volume *lv, - struct list *removable_pvs) + struct dm_list *removable_pvs) { float sync_percent; struct lvinfo info; struct volume_group *vg = lv->vg; /* Unimplemented features */ - if (list_size(&lv->segments) != 1) { + if (dm_list_size(&lv->segments) != 1) { log_error("Multiple-segment mirror is not supported"); return 0; } @@ -1340,11 +1340,11 @@ int add_mirror_log(struct cmd_context *cmd, struct logical_volume *lv, uint32_t log_count, uint32_t region_size, - struct list *allocatable_pvs, alloc_policy_t alloc) + struct dm_list *allocatable_pvs, alloc_policy_t alloc) { struct alloc_handle *ah; const struct segment_type *segtype; - struct list *parallel_areas; + struct dm_list *parallel_areas; float sync_percent; int in_sync; struct logical_volume *log_lv; @@ -1356,7 +1356,7 @@ return 0; } - if (list_size(&lv->segments) != 1) { + if (dm_list_size(&lv->segments) != 1) { log_error("Multiple-segment mirror is not supported"); return 0; } @@ -1418,12 +1418,12 @@ */ int add_mirror_images(struct cmd_context *cmd, struct logical_volume *lv, uint32_t mirrors, uint32_t stripes, uint32_t region_size, - struct list *allocatable_pvs, alloc_policy_t alloc, + struct dm_list *allocatable_pvs, alloc_policy_t alloc, uint32_t log_count) { struct alloc_handle *ah; const struct segment_type *segtype; - struct list *parallel_areas; + struct dm_list *parallel_areas; struct logical_volume **img_lvs; struct logical_volume *log_lv = NULL; @@ -1465,7 +1465,7 @@ /* * insert a mirror layer */ - if (list_size(&lv->segments) != 1 || + if (dm_list_size(&lv->segments) != 1 || seg_type(first_seg(lv), 0) != AREA_LV) if (!insert_layer_for_lv(cmd, lv, 0, "_mimage_%d")) goto out_remove_log; @@ -1514,7 +1514,7 @@ int lv_add_mirrors(struct cmd_context *cmd, struct logical_volume *lv, uint32_t mirrors, uint32_t stripes, uint32_t region_size, uint32_t log_count, - struct list *pvs, alloc_policy_t alloc, uint32_t flags) + struct dm_list *pvs, alloc_policy_t alloc, uint32_t flags) { if (!mirrors && !log_count) { log_error("No conversion is requested"); @@ -1565,7 +1565,7 @@ */ int lv_remove_mirrors(struct cmd_context *cmd __attribute((unused)), struct logical_volume *lv, - uint32_t mirrors, uint32_t log_count, struct list *pvs, + uint32_t mirrors, uint32_t log_count, struct dm_list *pvs, uint32_t status_mask) { uint32_t new_mirrors; --- LVM2/lib/metadata/pv_alloc.h 2007/08/20 20:55:26 1.6 +++ LVM2/lib/metadata/pv_alloc.h 2008/11/03 22:14:29 1.7 @@ -15,7 +15,7 @@ #ifndef _LVM_PV_ALLOC_H int alloc_pv_segment_whole_pv(struct dm_pool *mem, struct physical_volume *pv); -int peg_dup(struct dm_pool *mem, struct list *peg_new, struct list *peg_old); +int peg_dup(struct dm_pool *mem, struct dm_list *peg_new, struct dm_list *peg_old); struct pv_segment *assign_peg_to_lvseg(struct physical_volume *pv, uint32_t pe, uint32_t area_len, struct lv_segment *seg, --- LVM2/lib/metadata/pv_manip.c 2008/03/26 16:48:10 1.21 +++ LVM2/lib/metadata/pv_manip.c 2008/11/03 22:14:29 1.22 @@ -40,7 +40,7 @@ peg->lvseg = lvseg; peg->lv_area = lv_area; - list_init(&peg->list); + dm_list_init(&peg->list); return peg; } @@ -56,23 +56,23 @@ if (!(peg = _alloc_pv_segment(mem, pv, 0, pv->pe_count, NULL, 0))) return_0; - list_add(&pv->segments, &peg->list); + dm_list_add(&pv->segments, &peg->list); return 1; } -int peg_dup(struct dm_pool *mem, struct list *peg_new, struct list *peg_old) +int peg_dup(struct dm_pool *mem, struct dm_list *peg_new, struct dm_list *peg_old) { struct pv_segment *peg, *pego; - list_init(peg_new); + dm_list_init(peg_new); - list_iterate_items(pego, peg_old) { + dm_list_iterate_items(pego, peg_old) { if (!(peg = _alloc_pv_segment(mem, pego->pv, pego->pe, pego->len, pego->lvseg, pego->lv_area))) return_0; - list_add(peg_new, &peg->list); + dm_list_add(peg_new, &peg->list); } return 1; @@ -94,7 +94,7 @@ peg->len = peg->len - peg_new->len; - list_add_h(&peg->list, &peg_new->list); + dm_list_add_h(&peg->list, &peg_new->list); if (peg->lvseg) { peg->pv->pe_alloc_count -= peg_new->len; @@ -199,7 +199,7 @@ { peg1->len += peg2->len; - list_del(&peg2->list); + dm_list_del(&peg2->list); } /* @@ -223,16 +223,16 @@ /* * Returns: number of free PEs in a struct pv_list */ -uint32_t pv_list_extents_free(const struct list *pvh) +uint32_t pv_list_extents_free(const struct dm_list *pvh) { struct pv_list *pvl; struct pe_range *per; uint32_t extents = 0; struct pv_segment *pvseg; - list_iterate_items(pvl, pvh) { - list_iterate_items(per, pvl->pe_ranges) { - list_iterate_items(pvseg, &pvl->pv->segments) { + dm_list_iterate_items(pvl, pvh) { + dm_list_iterate_items(per, pvl->pe_ranges) { + dm_list_iterate_items(pvseg, &pvl->pv->segments) { if (!pvseg_is_allocated(pvseg)) extents += _overlap_pe(pvseg, per); } @@ -255,14 +255,14 @@ uint32_t pv_count = 0, free_count = 0, extent_count = 0; int ret = 1; - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { pv = pvl->pv; segno = 0; start_pe = 0; alloced = 0; pv_count++; - list_iterate_items(peg, &pv->segments) { + dm_list_iterate_items(peg, &pv->segments) { s = peg->lv_area; /* FIXME Remove this next line eventually */ @@ -347,7 +347,7 @@ } /* Check PEs to be removed are not already allocated */ - list_iterate_items(peg, &pv->segments) { + dm_list_iterate_items(peg, &pv->segments) { if (peg->pe + peg->len <= new_pe_count) continue; @@ -362,9 +362,9 @@ if (!pv_split_segment(pv, new_pe_count)) return_0; - list_iterate_items_safe(peg, pegt, &pv->segments) { + dm_list_iterate_items_safe(peg, pegt, &pv->segments) { if (peg->pe + peg->len > new_pe_count) - list_del(&peg->list); + dm_list_del(&peg->list); } pv->pe_count = new_pe_count; @@ -392,7 +392,7 @@ old_pe_count, new_pe_count - old_pe_count, NULL, 0); - list_add(&pv->segments, &peg->list); + dm_list_add(&pv->segments, &peg->list); pv->pe_count = new_pe_count; --- LVM2/lib/metadata/pv_map.c 2008/01/30 14:00:00 1.31 +++ LVM2/lib/metadata/pv_map.c 2008/11/03 22:14:29 1.32 @@ -22,16 +22,16 @@ * * FIXME Cope with overlap. */ -static void _insert_area(struct list *head, struct pv_area *a) +static void _insert_area(struct dm_list *head, struct pv_area *a) { struct pv_area *pva; - list_iterate_items(pva, head) { + dm_list_iterate_items(pva, head) { if (a->count > pva->count) break; } - list_add(&pva->list, &a->list); + dm_list_add(&pva->list, &a->list); a->map->pe_count += a->count; } @@ -67,7 +67,7 @@ pe = start; /* Walk through complete ordered list of device segments */ - list_iterate_items(peg, &pvm->pv->segments) { + dm_list_iterate_items(peg, &pvm->pv->segments) { /* pe holds the next extent we want to check */ /* Beyond the range we're interested in? */ @@ -97,7 +97,7 @@ } static int _create_all_areas_for_pv(struct dm_pool *mem, struct pv_map *pvm, - struct list *pe_ranges) + struct dm_list *pe_ranges) { struct pe_range *aa; @@ -110,7 +110,7 @@ return 1; } - list_iterate_items(aa, pe_ranges) { + dm_list_iterate_items(aa, pe_ranges) { if (!_create_alloc_areas_for_pv(mem, pvm, aa->start, aa->count)) return_0; @@ -119,18 +119,18 @@ return 1; } -static int _create_maps(struct dm_pool *mem, struct list *pvs, struct list *pvms) +static int _create_maps(struct dm_pool *mem, struct dm_list *pvs, struct dm_list *pvms) { struct pv_map *pvm, *pvm2; struct pv_list *pvl; - list_iterate_items(pvl, pvs) { + dm_list_iterate_items(pvl, pvs) { if (!(pvl->pv->status & ALLOCATABLE_PV)) continue; pvm = NULL; - list_iterate_items(pvm2, pvms) + dm_list_iterate_items(pvm2, pvms) if (pvm2->pv->dev == pvl->pv->dev) { pvm = pvm2; break; @@ -141,8 +141,8 @@ return_0; pvm->pv = pvl->pv; - list_init(&pvm->areas); - list_add(pvms, &pvm->list); + dm_list_init(&pvm->areas); + dm_list_add(pvms, &pvm->list); } if (!_create_all_areas_for_pv(mem, pvm, pvl->pe_ranges)) @@ -155,17 +155,17 @@ /* * Create list of PV areas available for this particular allocation */ -struct list *create_pv_maps(struct dm_pool *mem, struct volume_group *vg, - struct list *allocatable_pvs) +struct dm_list *create_pv_maps(struct dm_pool *mem, struct volume_group *vg, + struct dm_list *allocatable_pvs) { - struct list *pvms; + struct dm_list *pvms; if (!(pvms = dm_pool_zalloc(mem, sizeof(*pvms)))) { log_error("create_pv_maps alloc failed"); return NULL; } - list_init(pvms); + dm_list_init(pvms); if (!_create_maps(mem, allocatable_pvs, pvms)) { log_error("Couldn't create physical volume maps in %s", @@ -179,7 +179,7 @@ void consume_pv_area(struct pv_area *pva, uint32_t to_go) { - list_del(&pva->list); + dm_list_del(&pva->list); pva->map->pe_count -= pva->count; assert(to_go <= pva->count); @@ -192,12 +192,12 @@ } } -uint32_t pv_maps_size(struct list *pvms) +uint32_t pv_maps_size(struct dm_list *pvms) { struct pv_map *pvm; uint32_t pe_count = 0; - list_iterate_items(pvm, pvms) + dm_list_iterate_items(pvm, pvms) pe_count += pvm->pe_count; return pe_count; --- LVM2/lib/metadata/pv_map.h 2007/08/20 20:55:26 1.9 +++ LVM2/lib/metadata/pv_map.h 2008/11/03 22:14:29 1.10 @@ -31,25 +31,25 @@ uint32_t start; uint32_t count; - struct list list; /* pv_map.areas */ + struct dm_list list; /* pv_map.areas */ }; struct pv_map { struct physical_volume *pv; - struct list areas; /* struct pv_areas */ + struct dm_list areas; /* struct pv_areas */ uint32_t pe_count; /* Total number of PEs */ - struct list list; + struct dm_list list; }; /* * Find intersection between available_pvs and free space in VG */ -struct list *create_pv_maps(struct dm_pool *mem, struct volume_group *vg, - struct list *allocatable_pvs); +struct dm_list *create_pv_maps(struct dm_pool *mem, struct volume_group *vg, + struct dm_list *allocatable_pvs); void consume_pv_area(struct pv_area *area, uint32_t to_go); -uint32_t pv_maps_size(struct list *pvms); +uint32_t pv_maps_size(struct dm_list *pvms); #endif --- LVM2/lib/metadata/segtype.c 2008/01/30 14:00:00 1.3 +++ LVM2/lib/metadata/segtype.c 2008/11/03 22:14:29 1.4 @@ -22,7 +22,7 @@ { struct segment_type *segtype; - list_iterate_items(segtype, &cmd->segtypes) { + dm_list_iterate_items(segtype, &cmd->segtypes) { if (!strcmp(segtype->name, str)) return segtype; } --- LVM2/lib/metadata/segtype.h 2008/07/15 00:25:51 1.21 +++ LVM2/lib/metadata/segtype.h 2008/11/03 22:14:29 1.22 @@ -47,7 +47,7 @@ #define segtype_is_virtual(segtype) ((segtype)->flags & SEG_VIRTUAL ? 1 : 0) struct segment_type { - struct list list; + struct dm_list list; struct cmd_context *cmd; uint32_t flags; struct segtype_handler *ops; @@ -82,7 +82,7 @@ unsigned *attributes); int (*modules_needed) (struct dm_pool *mem, const struct lv_segment *seg, - struct list *modules); + struct dm_list *modules); void (*destroy) (const struct segment_type * segtype); int (*target_monitored) (struct lv_segment *seg, int *pending); int (*target_monitor_events) (struct lv_segment *seg, int events); --- LVM2/lib/metadata/snapshot_manip.c 2008/01/30 14:00:00 1.31 +++ LVM2/lib/metadata/snapshot_manip.c 2008/11/03 22:14:29 1.32 @@ -90,14 +90,14 @@ cow->status &= ~VISIBLE_LV; - list_add(&origin->snapshot_segs, &seg->origin_list); + dm_list_add(&origin->snapshot_segs, &seg->origin_list); return 1; } int vg_remove_snapshot(struct logical_volume *cow) { - list_del(&cow->snapshot->origin_list); + dm_list_del(&cow->snapshot->origin_list); cow->snapshot->origin->origin_count--; if (!lv_remove(cow->snapshot->lv)) { --- LVM2/lib/mirror/Makefile.in 2007/09/21 10:16:44 1.4 +++ LVM2/lib/mirror/Makefile.in 2008/11/03 22:14:29 1.5 @@ -19,6 +19,7 @@ SOURCES = mirrored.c LIB_SHARED = liblvm2mirror.so +LIB_VERSION = $(LIB_VERSION_LVM) include $(top_srcdir)/make.tmpl --- LVM2/lib/mirror/mirrored.c 2008/10/31 22:41:51 1.58 +++ LVM2/lib/mirror/mirrored.c 2008/11/03 22:14:29 1.59 @@ -512,7 +512,7 @@ static int _mirrored_modules_needed(struct dm_pool *mem, const struct lv_segment *seg, - struct list *modules) + struct dm_list *modules) { if (seg->log_lv && !list_segment_modules(mem, first_seg(seg->log_lv), modules)) --- LVM2/lib/report/report.c 2008/09/19 06:41:59 1.88 +++ LVM2/lib/report/report.c 2008/11/03 22:14:29 1.89 @@ -173,7 +173,7 @@ struct dm_report_field *field, const void *data, void *private __attribute((unused))) { - const struct list *tags = (const struct list *) data; + const struct dm_list *tags = (const struct dm_list *) data; struct str_list *sl; if (!dm_pool_begin_object(mem, 256)) { @@ -181,7 +181,7 @@ return 0; } - list_iterate_items(sl, tags) { + dm_list_iterate_items(sl, tags) { if (!dm_pool_grow_object(mem, sl->str, strlen(sl->str)) || (sl->list.n != tags && !dm_pool_grow_object(mem, ",", 1))) { log_error("dm_pool_grow_object failed"); @@ -204,7 +204,7 @@ const void *data, void *private) { const struct logical_volume *lv = (const struct logical_volume *) data; - struct list *modules; + struct dm_list *modules; if (!(modules = str_list_create(mem))) { log_error("modules str_list allocation failed"); @@ -492,7 +492,7 @@ const struct logical_volume *lv = (const struct logical_volume *) data; struct lv_segment *seg; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (!seg_is_mirrored(seg) || !seg->log_lv) continue; return dm_report_field_string(rh, field, @@ -545,7 +545,7 @@ const char *name; struct lv_segment *seg; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (!(seg->status & PVMOVE)) continue; name = dev_name(seg_dev(seg, 0)); @@ -842,7 +842,7 @@ const char *pvid = (const char *)(&((struct id *) data)->uuid); info = info_from_pvid(pvid, 0); - count = info ? list_size(&info->mdas) : 0; + count = info ? dm_list_size(&info->mdas) : 0; return _uint32_disp(rh, mem, field, &count, private); } @@ -854,7 +854,7 @@ const struct volume_group *vg = (const struct volume_group *) data; uint32_t count; - count = list_size(&vg->fid->metadata_areas); + count = dm_list_size(&vg->fid->metadata_areas); return _uint32_disp(rh, mem, field, &count, private); } @@ -870,7 +870,7 @@ info = info_from_pvid(pvid, 0); - list_iterate_items(mda, &info->mdas) { + dm_list_iterate_items(mda, &info->mdas) { if (!mda->ops->mda_free_sectors) continue; mda_free = mda->ops->mda_free_sectors(mda); @@ -892,7 +892,7 @@ uint64_t freespace = UINT64_MAX, mda_free; struct metadata_area *mda; - list_iterate_items(mda, &vg->fid->metadata_areas) { + dm_list_iterate_items(mda, &vg->fid->metadata_areas) { if (!mda->ops->mda_free_sectors) continue; mda_free = mda->ops->mda_free_sectors(mda); @@ -914,7 +914,7 @@ struct lv_list *lvl; uint32_t count = 0; - list_iterate_items(lvl, &vg->lvs) + dm_list_iterate_items(lvl, &vg->lvs) if (lv_is_visible(lvl->lv) && !(lvl->lv->status & SNAPSHOT)) count++; @@ -928,7 +928,7 @@ const struct logical_volume *lv = (const struct logical_volume *) data; uint32_t count; - count = list_size(&lv->segments); + count = dm_list_size(&lv->segments); return _uint32_disp(rh, mem, field, &count, private); } --- LVM2/lib/snapshot/Makefile.in 2007/09/21 10:16:44 1.4 +++ LVM2/lib/snapshot/Makefile.in 2008/11/03 22:14:29 1.5 @@ -19,6 +19,7 @@ SOURCES = snapshot.c LIB_SHARED = liblvm2snapshot.so +LIB_VERSION = $(LIB_VERSION_LVM) include $(top_srcdir)/make.tmpl --- LVM2/lib/snapshot/snapshot.c 2008/10/31 22:41:51 1.32 +++ LVM2/lib/snapshot/snapshot.c 2008/11/03 22:14:29 1.33 @@ -254,7 +254,7 @@ static int _snap_modules_needed(struct dm_pool *mem, const struct lv_segment *seg __attribute((unused)), - struct list *modules) + struct dm_list *modules) { if (!str_list_add(mem, modules, "snapshot")) { log_error("snapshot string list allocation failed"); --- LVM2/lib/zero/zero.c 2008/04/07 10:23:47 1.17 +++ LVM2/lib/zero/zero.c 2008/11/03 22:14:29 1.18 @@ -67,7 +67,7 @@ static int _zero_modules_needed(struct dm_pool *mem, const struct lv_segment *seg __attribute((unused)), - struct list *modules) + struct dm_list *modules) { if (!str_list_add(mem, modules, "zero")) { log_error("zero module string list allocation failed"); --- LVM2/libdm/Makefile.in 2008/11/03 18:59:59 1.40 +++ LVM2/libdm/Makefile.in 2008/11/03 22:14:29 1.41 @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -interface = @interface@ SOURCES =\ datastruct/bitset.c \ @@ -42,7 +41,8 @@ else LIB_SHARED = $(interface)/libdevmapper.so endif -VERSIONED_SHLIB = libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) +VERSIONED_SHLIB = libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION_DM) +LIB_VERSION = $(LIB_VERSION_DM) DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \ -DDM_DEVICE_MODE=@DM_DEVICE_MODE@ @@ -72,15 +72,15 @@ $(includedir)/libdevmapper.h install_dynamic: install_@interface@ - $(LN_S) -f libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) \ + $(LN_S) -f libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION_DM) \ $(libdir)/libdevmapper.$(LIB_SUFFIX) install_static: install_@interface@_static - $(LN_S) -f libdevmapper.a.$(LIB_VERSION) $(libdir)/libdevmapper.a + $(LN_S) -f libdevmapper.a.$(LIB_VERSION_DM) $(libdir)/libdevmapper.a install_ioctl: ioctl/libdevmapper.$(LIB_SUFFIX) $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ - $(libdir)/libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) + $(libdir)/libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION_DM) install_pkgconfig: $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper.pc \ @@ -88,11 +88,13 @@ install_ioctl_static: ioctl/libdevmapper.a $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ - $(libdir)/libdevmapper.a.$(LIB_VERSION) + $(libdir)/libdevmapper.a.$(LIB_VERSION_DM) -$(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION): $(interface)/%.$(LIB_SUFFIX) +$(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION_DM): $(interface)/%.$(LIB_SUFFIX) rm -f $@ $(LN_S) $< $@ + rm -f libdevmapper.so + $(LN_S) $< libdevmapper.so .PHONY: distclean_lib distclean --- LVM2/libdm/libdm-common.c 2008/11/03 18:59:59 1.61 +++ LVM2/libdm/libdm-common.c 2008/11/03 22:14:29 1.62 @@ -506,10 +506,10 @@ return 1; } -static LIST_INIT(_node_ops); +static DM_LIST_INIT(_node_ops); struct node_op_parms { - struct list list; + struct dm_list list; node_op_t type; char *dev_name; uint32_t major; @@ -536,7 +536,7 @@ uint32_t read_ahead_flags) { struct node_op_parms *nop; - struct list *noph, *nopht; + struct dm_list *noph, *nopht; size_t len = strlen(dev_name) + strlen(old_name) + 2; char *pos; @@ -544,10 +544,10 @@ * Ignore any outstanding operations on the node if deleting it */ if (type == NODE_DEL) { - list_iterate_safe(noph, nopht, &_node_ops) { - nop = list_item(noph, struct node_op_parms); + dm_list_iterate_safe(noph, nopht, &_node_ops) { + nop = dm_list_item(noph, struct node_op_parms); if (!strcmp(dev_name, nop->dev_name)) { - list_del(&nop->list); + dm_list_del(&nop->list); dm_free(nop); } } @@ -571,22 +571,22 @@ _store_str(&pos, &nop->dev_name, dev_name); _store_str(&pos, &nop->old_name, old_name); - list_add(&_node_ops, &nop->list); + dm_list_add(&_node_ops, &nop->list); return 1; } static void _pop_node_ops(void) { - struct list *noph, *nopht; + struct dm_list *noph, *nopht; struct node_op_parms *nop; - list_iterate_safe(noph, nopht, &_node_ops) { - nop = list_item(noph, struct node_op_parms); + dm_list_iterate_safe(noph, nopht, &_node_ops) { + nop = dm_list_item(noph, struct node_op_parms); _do_node_op(nop->type, nop->dev_name, nop->major, nop->minor, nop->uid, nop->gid, nop->mode, nop->old_name, nop->read_ahead, nop->read_ahead_flags); - list_del(&nop->list); + dm_list_del(&nop->list); dm_free(nop); } } --- LVM2/libdm/libdm-deptree.c 2008/11/03 18:59:59 1.45 +++ LVM2/libdm/libdm-deptree.c 2008/11/03 22:14:29 1.46 @@ -55,7 +55,7 @@ /* Some segment types have a list of areas of other devices attached */ struct seg_area { - struct list list; + struct dm_list list; struct dm_tree_node *dev_node; @@ -64,14 +64,14 @@ /* Per-segment properties */ struct load_segment { - struct list list; + struct dm_list list; unsigned type; uint64_t size; unsigned area_count; /* Linear + Striped + Mirrored */ - struct list areas; /* Linear + Striped + Mirrored */ + struct dm_list areas; /* Linear + Striped + Mirrored */ uint32_t stripe_size; /* Striped */ @@ -99,14 +99,14 @@ unsigned segment_count; unsigned size_changed; - struct list segs; + struct dm_list segs; const char *new_name; }; /* Two of these used to join two nodes with uses and used_by. */ struct dm_tree_link { - struct list list; + struct dm_list list; struct dm_tree_node *node; }; @@ -117,8 +117,8 @@ const char *uuid; struct dm_info info; - struct list uses; /* Nodes this node uses */ - struct list used_by; /* Nodes that use this node */ + struct dm_list uses; /* Nodes this node uses */ + struct dm_list used_by; /* Nodes that use this node */ int activation_priority; /* 0 gets activated first */ @@ -163,8 +163,8 @@ memset(dtree, 0, sizeof(*dtree)); dtree->root.dtree = dtree; - list_init(&dtree->root.uses); - list_init(&dtree->root.used_by); + dm_list_init(&dtree->root.uses); + dm_list_init(&dtree->root.used_by); dtree->skip_lockfs = 0; dtree->no_flush = 0; @@ -208,14 +208,14 @@ { struct dm_tree_link *dlink; - list_iterate_items(dlink, &parent->uses) + dm_list_iterate_items(dlink, &parent->uses) if (dlink->node == child) return 1; return 0; } -static int _link(struct list *list, struct dm_tree_node *node) +static int _link(struct dm_list *list, struct dm_tree_node *node) { struct dm_tree_link *dlink; @@ -225,7 +225,7 @@ } dlink->node = node; - list_add(list, &dlink->list); + dm_list_add(list, &dlink->list); return 1; } @@ -245,13 +245,13 @@ return 1; } -static void _unlink(struct list *list, struct dm_tree_node *node) +static void _unlink(struct dm_list *list, struct dm_tree_node *node) { struct dm_tree_link *dlink; - list_iterate_items(dlink, list) + dm_list_iterate_items(dlink, list) if (dlink->node == node) { - list_del(&dlink->list); + dm_list_del(&dlink->list); break; } } @@ -326,9 +326,9 @@ node->context = context; node->activation_priority = 0; - list_init(&node->uses); - list_init(&node->used_by); - list_init(&node->props.segs); + dm_list_init(&node->uses); + dm_list_init(&node->used_by); + dm_list_init(&node->props.segs); dev = MKDEV(info->major, info->minor); @@ -662,13 +662,13 @@ if (inverted) { if (_nodes_are_linked(&node->dtree->root, node)) return 0; - return list_size(&node->used_by); + return dm_list_size(&node->used_by); } if (_nodes_are_linked(node, &node->dtree->root)) return 0; - return list_size(&node->uses); + return dm_list_size(&node->uses); } /* @@ -706,7 +706,7 @@ const char *uuid_prefix, size_t uuid_prefix_len) { - struct list *list; + struct dm_list *list; struct dm_tree_link *dlink; const struct dm_info *dinfo; const char *uuid; @@ -721,7 +721,7 @@ list = &node->uses; } - list_iterate_items(dlink, list) { + dm_list_iterate_items(dlink, list) { if (!(uuid = dm_tree_node_get_uuid(dlink->node))) { stack; continue; @@ -776,8 +776,8 @@ struct dm_tree_node *parent, uint32_t inverted) { - struct list **dlink = (struct list **) handle; - struct list *use_list; + struct dm_list **dlink = (struct dm_list **) handle; + struct dm_list *use_list; if (inverted) use_list = &parent->used_by; @@ -785,11 +785,11 @@ use_list = &parent->uses; if (!*dlink) - *dlink = list_first(use_list); + *dlink = dm_list_first(use_list); else - *dlink = list_next(use_list, *dlink); + *dlink = dm_list_next(use_list, *dlink); - return (*dlink) ? list_item(*dlink, struct dm_tree_link)->node : NULL; + return (*dlink) ? dm_list_item(*dlink, struct dm_tree_link)->node : NULL; } /* @@ -1248,7 +1248,7 @@ int tw; const char *prefix = ""; - list_iterate_items(area, &seg->areas) { + dm_list_iterate_items(area, &seg->areas) { if (!_build_dev_string(devbuf, sizeof(devbuf), area->dev_node)) return_0; @@ -1483,7 +1483,7 @@ if (!dm_task_no_open_count(dmt)) log_error("Failed to disable open_count"); - list_iterate_items(seg, &dnode->props.segs) + dm_list_iterate_items(seg, &dnode->props.segs) if (!_emit_segment(dmt, seg, &seg_start)) goto_out; @@ -1616,14 +1616,14 @@ seg->type = type; seg->size = size; seg->area_count = 0; - list_init(&seg->areas); + dm_list_init(&seg->areas); seg->stripe_size = 0; seg->persistent = 0; seg->chunk_size = 0; seg->cow = NULL; seg->origin = NULL; - list_add(&dnode->props.segs, &seg->list); + dm_list_add(&dnode->props.segs, &seg->list); dnode->props.segment_count++; return seg; @@ -1747,7 +1747,7 @@ return 0; } - seg = list_item(list_last(&node->props.segs), struct load_segment); + seg = dm_list_item(dm_list_last(&node->props.segs), struct load_segment); if (log_uuid) { if (!(seg->uuid = dm_pool_strdup(node->dtree->mem, log_uuid))) { @@ -1797,7 +1797,7 @@ area->dev_node = dev_node; area->offset = offset; - list_add(&seg->areas, &area->list); + dm_list_add(&seg->areas, &area->list); seg->area_count++; return 1; @@ -1845,7 +1845,7 @@ return 0; } - seg = list_item(list_last(&node->props.segs), struct load_segment); + seg = dm_list_item(dm_list_last(&node->props.segs), struct load_segment); if (!_add_area(node, seg, dev_node, offset)) return_0; --- LVM2/libdm/libdm-report.c 2008/11/03 18:59:59 1.25 +++ LVM2/libdm/libdm-report.c 2008/11/03 22:14:29 1.26 @@ -35,10 +35,10 @@ uint32_t keys_count; /* Ordered list of fields needed for this report */ - struct list field_props; + struct dm_list field_props; /* Rows of report data */ - struct list rows; + struct dm_list rows; /* Array of field definitions */ const struct dm_report_field_type *fields; @@ -57,7 +57,7 @@ #define FLD_DESCENDING 0x00000800 struct field_properties { - struct list list; + struct dm_list list; uint32_t field_num; uint32_t sort_posn; int32_t width; @@ -69,7 +69,7 @@ * Report data field */ struct dm_report_field { - struct list list; + struct dm_list list; struct field_properties *props; const char *report_string; /* Formatted ready for display */ @@ -77,9 +77,9 @@ }; struct row { - struct list list; + struct dm_list list; struct dm_report *rh; - struct list fields; /* Fields in display order */ + struct dm_list fields; /* Fields in display order */ struct dm_report_field *(*sort_fields)[]; /* Fields in sort order */ }; @@ -317,13 +317,13 @@ fp->flags |= flags; /* - * Place hidden fields at the front so list_end() will + * Place hidden fields at the front so dm_list_end() will * tell us when we've reached the last visible field. */ if (fp->flags & FLD_HIDDEN) - list_add_h(&rh->field_props, &fp->list); + dm_list_add_h(&rh->field_props, &fp->list); else - list_add(&rh->field_props, &fp->list); + dm_list_add(&rh->field_props, &fp->list); return fp; } @@ -372,7 +372,7 @@ { struct field_properties *fp, *found = NULL; - list_iterate_items(fp, &rh->field_props) { + dm_list_iterate_items(fp, &rh->field_props) { if (fp->field_num == field_num) { found = fp; break; @@ -521,8 +521,8 @@ if (output_flags & DM_REPORT_OUTPUT_BUFFERED) rh->flags |= RH_SORT_REQUIRED; - list_init(&rh->field_props); - list_init(&rh->rows); + dm_list_init(&rh->field_props); + dm_list_init(&rh->rows); if ((type = _find_type(rh, rh->report_types)) && type->prefix) rh->field_prefix = type->prefix; @@ -621,11 +621,11 @@ return 0; } - list_init(&row->fields); - list_add(&rh->rows, &row->list); + dm_list_init(&row->fields); + dm_list_add(&rh->rows, &row->list); /* For each field to be displayed, call its report_fn */ - list_iterate_items(fp, &rh->field_props) { + dm_list_iterate_items(fp, &rh->field_props) { if (!(field = dm_pool_zalloc(rh->mem, sizeof(*field)))) { log_error("dm_report_object: " "struct dm_report_field allocation failed"); @@ -653,7 +653,7 @@ (field->props->flags & FLD_SORT_KEY)) { (*row->sort_fields)[field->props->sort_posn] = field; } - list_add(&row->fields, &field->list); + dm_list_add(&row->fields, &field->list); } if (!(rh->flags & DM_REPORT_OUTPUT_BUFFERED)) @@ -686,7 +686,7 @@ } /* First heading line */ - list_iterate_items(fp, &rh->field_props) { + dm_list_iterate_items(fp, &rh->field_props) { if (fp->flags & FLD_HIDDEN) continue; @@ -706,7 +706,7 @@ goto bad; } - if (!list_end(&rh->field_props, &fp->list)) + if (!dm_list_end(&rh->field_props, &fp->list)) if (!dm_pool_grow_object(rh->mem, rh->separator, 0)) { log_error("dm_report: Failed to generate report headings for printing"); goto bad; @@ -778,19 +778,19 @@ struct row *row; if (!(rows = dm_pool_alloc(rh->mem, sizeof(**rows) * - list_size(&rh->rows)))) { + dm_list_size(&rh->rows)))) { log_error("dm_report: sort array allocation failed"); return 0; } - list_iterate_items(row, &rh->rows) + dm_list_iterate_items(row, &rh->rows) (*rows)[count++] = row; qsort(rows, count, sizeof(**rows), _row_compare); - list_init(&rh->rows); + dm_list_init(&rh->rows); while (count--) - list_add_h(&rh->rows, &(*rows)[count]->list); + dm_list_add_h(&rh->rows, &(*rows)[count]->list); return 1; } @@ -891,11 +891,11 @@ return 0; } - list_iterate_items(fp, &rh->field_props) { + dm_list_iterate_items(fp, &rh->field_props) { if (fp->flags & FLD_HIDDEN) { - list_iterate_items(row, &rh->rows) { - field = list_item(list_first(&row->fields), struct dm_report_field); - list_del(&field->list); + dm_list_iterate_items(row, &rh->rows) { + field = dm_list_item(dm_list_first(&row->fields), struct dm_report_field); + dm_list_del(&field->list); } continue; } @@ -911,14 +911,14 @@ } } - list_iterate_items(row, &rh->rows) { - if ((field = list_item(list_first(&row->fields), struct dm_report_field))) { + dm_list_iterate_items(row, &rh->rows) { + if ((field = dm_list_item(dm_list_first(&row->fields), struct dm_report_field))) { if (!_output_field(rh, field)) goto bad; - list_del(&field->list); + dm_list_del(&field->list); } - if (!list_end(&rh->rows, &row->list)) + if (!dm_list_end(&rh->rows, &row->list)) if (!dm_pool_grow_object(rh->mem, rh->separator, 0)) { log_error("dm_report: Unable to extend output line"); goto bad; @@ -941,7 +941,7 @@ static int _output_as_columns(struct dm_report *rh) { - struct list *fh, *rowh, *ftmp, *rtmp; + struct dm_list *fh, *rowh, *ftmp, *rtmp; struct row *row = NULL; struct dm_report_field *field; @@ -950,34 +950,34 @@ _report_headings(rh); /* Print and clear buffer */ - list_iterate_safe(rowh, rtmp, &rh->rows) { + dm_list_iterate_safe(rowh, rtmp, &rh->rows) { if (!dm_pool_begin_object(rh->mem, 512)) { log_error("dm_report: Unable to allocate output line"); return 0; } - row = list_item(rowh, struct row); - list_iterate_safe(fh, ftmp, &row->fields) { - field = list_item(fh, struct dm_report_field); + row = dm_list_item(rowh, struct row); + dm_list_iterate_safe(fh, ftmp, &row->fields) { + field = dm_list_item(fh, struct dm_report_field); if (field->props->flags & FLD_HIDDEN) continue; if (!_output_field(rh, field)) goto bad; - if (!list_end(&row->fields, fh)) + if (!dm_list_end(&row->fields, fh)) if (!dm_pool_grow_object(rh->mem, rh->separator, 0)) { log_error("dm_report: Unable to extend output line"); goto bad; } - list_del(&field->list); + dm_list_del(&field->list); } if (!dm_pool_grow_object(rh->mem, "\0", 1)) { log_error("dm_report: Unable to terminate output line"); goto bad; } log_print("%s", (char *) dm_pool_end_object(rh->mem)); - list_del(&row->list); + dm_list_del(&row->list); } if (row) @@ -992,7 +992,7 @@ int dm_report_output(struct dm_report *rh) { - if (list_empty(&rh->rows)) + if (dm_list_empty(&rh->rows)) return 1; if ((rh->flags & RH_SORT_REQUIRED)) --- LVM2/libdm/datastruct/list.c 2008/04/10 19:14:26 1.4 +++ LVM2/libdm/datastruct/list.c 2008/11/03 22:14:30 1.5 @@ -19,7 +19,7 @@ * Initialise a list before use. * The list head's next and previous pointers point back to itself. */ -void list_init(struct list *head) +void dm_list_init(struct dm_list *head) { head->n = head->p = head; } @@ -28,7 +28,7 @@ * Insert an element before 'head'. * If 'head' is the list head, this adds an element to the end of the list. */ -void list_add(struct list *head, struct list *elem) +void dm_list_add(struct dm_list *head, struct dm_list *elem) { assert(head->n); @@ -43,7 +43,7 @@ * Insert an element after 'head'. * If 'head' is the list head, this adds an element to the front of the list. */ -void list_add_h(struct list *head, struct list *elem) +void dm_list_add_h(struct dm_list *head, struct dm_list *elem) { assert(head->n); @@ -59,7 +59,7 @@ * Note that this doesn't change the element itself - it may still be safe * to follow its pointers. */ -void list_del(struct list *elem) +void dm_list_del(struct dm_list *elem) { elem->n->p = elem->p; elem->p->n = elem->n; @@ -68,16 +68,16 @@ /* * Remove an element from existing list and insert before 'head'. */ -void list_move(struct list *head, struct list *elem) +void dm_list_move(struct dm_list *head, struct dm_list *elem) { - list_del(elem); - list_add(head, elem); + dm_list_del(elem); + dm_list_add(head, elem); } /* * Is the list empty? */ -int list_empty(const struct list *head) +int dm_list_empty(const struct dm_list *head) { return head->n == head; } @@ -85,7 +85,7 @@ /* * Is this the first element of the list? */ -int list_start(const struct list *head, const struct list *elem) +int dm_list_start(const struct dm_list *head, const struct dm_list *elem) { return elem->p == head; } @@ -93,7 +93,7 @@ /* * Is this the last element of the list? */ -int list_end(const struct list *head, const struct list *elem) +int dm_list_end(const struct dm_list *head, const struct dm_list *elem) { return elem->n == head; } @@ -101,44 +101,44 @@ /* * Return first element of the list or NULL if empty */ -struct list *list_first(const struct list *head) +struct dm_list *dm_list_first(const struct dm_list *head) { - return (list_empty(head) ? NULL : head->n); + return (dm_list_empty(head) ? NULL : head->n); } /* * Return last element of the list or NULL if empty */ -struct list *list_last(const struct list *head) +struct dm_list *dm_list_last(const struct dm_list *head) { - return (list_empty(head) ? NULL : head->p); + return (dm_list_empty(head) ? NULL : head->p); } /* * Return the previous element of the list, or NULL if we've reached the start. */ -struct list *list_prev(const struct list *head, const struct list *elem) +struct dm_list *dm_list_prev(const struct dm_list *head, const struct dm_list *elem) { - return (list_start(head, elem) ? NULL : elem->p); + return (dm_list_start(head, elem) ? NULL : elem->p); } /* * Return the next element of the list, or NULL if we've reached the end. */ -struct list *list_next(const struct list *head, const struct list *elem) +struct dm_list *dm_list_next(const struct dm_list *head, const struct dm_list *elem) { - return (list_end(head, elem) ? NULL : elem->n); + return (dm_list_end(head, elem) ? NULL : elem->n); } /* * Return the number of elements in a list by walking it. */ -unsigned int list_size(const struct list *head) +unsigned int dm_list_size(const struct dm_list *head) { unsigned int s = 0; - const struct list *v; + const struct dm_list *v; - list_iterate(v, head) + dm_list_iterate(v, head) s++; return s; --- LVM2/libdm/datastruct/list.h 2008/04/10 19:14:26 1.27 +++ LVM2/libdm/datastruct/list.h 2008/11/03 22:14:30 1.28 @@ -24,106 +24,106 @@ * The list head's pointers point to the first and the last element. */ -struct list { - struct list *n, *p; +struct dm_list { + struct dm_list *n, *p; }; /* * Initialise a list before use. * The list head's next and previous pointers point back to itself. */ -#define LIST_INIT(name) struct list name = { &(name), &(name) } -void list_init(struct list *head); +#define DM_LIST_INIT(name) struct dm_list name = { &(name), &(name) } +void dm_list_init(struct dm_list *head); /* * Insert an element before 'head'. * If 'head' is the list head, this adds an element to the end of the list. */ -void list_add(struct list *head, struct list *elem); +void dm_list_add(struct dm_list *head, struct dm_list *elem); /* * Insert an element after 'head'. * If 'head' is the list head, this adds an element to the front of the list. */ -void list_add_h(struct list *head, struct list *elem); +void dm_list_add_h(struct dm_list *head, struct dm_list *elem); /* * Delete an element from its list. * Note that this doesn't change the element itself - it may still be safe * to follow its pointers. */ -void list_del(struct list *elem); +void dm_list_del(struct dm_list *elem); /* * Remove an element from existing list and insert before 'head'. */ -void list_move(struct list *head, struct list *elem); +void dm_list_move(struct dm_list *head, struct dm_list *elem); /* * Is the list empty? */ -int list_empty(const struct list *head); +int dm_list_empty(const struct dm_list *head); /* * Is this the first element of the list? */ -int list_start(const struct list *head, const struct list *elem); +int dm_list_start(const struct dm_list *head, const struct dm_list *elem); /* * Is this the last element of the list? */ -int list_end(const struct list *head, const struct list *elem); +int dm_list_end(const struct dm_list *head, const struct dm_list *elem); /* * Return first element of the list or NULL if empty */ -struct list *list_first(const struct list *head); +struct dm_list *dm_list_first(const struct dm_list *head); /* * Return last element of the list or NULL if empty */ -struct list *list_last(const struct list *head); +struct dm_list *dm_list_last(const struct dm_list *head); /* * Return the previous element of the list, or NULL if we've reached the start. */ -struct list *list_prev(const struct list *head, const struct list *elem); +struct dm_list *dm_list_prev(const struct dm_list *head, const struct dm_list *elem); /* * Return the next element of the list, or NULL if we've reached the end. */ -struct list *list_next(const struct list *head, const struct list *elem); +struct dm_list *dm_list_next(const struct dm_list *head, const struct dm_list *elem); /* - * Given the address v of an instance of 'struct list' called 'head' + * Given the address v of an instance of 'struct dm_list' called 'head' * contained in a structure of type t, return the containing structure. */ -#define list_struct_base(v, t, head) \ +#define dm_list_struct_base(v, t, head) \ ((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->head)) /* - * Given the address v of an instance of 'struct list list' contained in + * Given the address v of an instance of 'struct dm_list list' contained in * a structure of type t, return the containing structure. */ -#define list_item(v, t) list_struct_base((v), t, list) +#define dm_list_item(v, t) dm_list_struct_base((v), t, list) /* * Given the address v of one known element e in a known structure of type t, * return another element f. */ -#define struct_field(v, t, e, f) \ +#define dm_struct_field(v, t, e, f) \ (((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->e))->f) /* * Given the address v of a known element e in a known structure of type t, * return the list head 'list' */ -#define list_head(v, t, e) struct_field(v, t, e, list) +#define dm_list_head(v, t, e) dm_struct_field(v, t, e, list) /* * Set v to each element of a list in turn. */ -#define list_iterate(v, head) \ +#define dm_list_iterate(v, head) \ for (v = (head)->n; v != head; v = v->n) /* @@ -133,7 +133,7 @@ * already-processed elements. * If 'start' is 'head' it walks the list backwards. */ -#define list_uniterate(v, head, start) \ +#define dm_list_uniterate(v, head, start) \ for (v = (start)->p; v != head; v = v->p) /* @@ -141,68 +141,68 @@ * the way. * t must be defined as a temporary variable of the same type as v. */ -#define list_iterate_safe(v, t, head) \ +#define dm_list_iterate_safe(v, t, head) \ for (v = (head)->n, t = v->n; v != head; v = t, t = v->n) /* * Walk a list, setting 'v' in turn to the containing structure of each item. * The containing structure should be the same type as 'v'. - * The 'struct list' variable within the containing structure is 'field'. + * The 'struct dm_list' variable within the containing structure is 'field'. */ -#define list_iterate_items_gen(v, head, field) \ - for (v = list_struct_base((head)->n, typeof(*v), field); \ +#define dm_list_iterate_items_gen(v, head, field) \ + for (v = dm_list_struct_base((head)->n, typeof(*v), field); \ &v->field != (head); \ - v = list_struct_base(v->field.n, typeof(*v), field)) + v = dm_list_struct_base(v->field.n, typeof(*v), field)) /* * Walk a list, setting 'v' in turn to the containing structure of each item. * The containing structure should be the same type as 'v'. - * The list should be 'struct list list' within the containing structure. + * The list should be 'struct dm_list list' within the containing structure. */ -#define list_iterate_items(v, head) list_iterate_items_gen(v, (head), list) +#define dm_list_iterate_items(v, head) dm_list_iterate_items_gen(v, (head), list) /* * Walk a list, setting 'v' in turn to the containing structure of each item. * The containing structure should be the same type as 'v'. - * The 'struct list' variable within the containing structure is 'field'. + * The 'struct dm_list' variable within the containing structure is 'field'. * t must be defined as a temporary variable of the same type as v. */ -#define list_iterate_items_gen_safe(v, t, head, field) \ - for (v = list_struct_base((head)->n, typeof(*v), field), \ - t = list_struct_base(v->field.n, typeof(*v), field); \ +#define dm_list_iterate_items_gen_safe(v, t, head, field) \ + for (v = dm_list_struct_base((head)->n, typeof(*v), field), \ + t = dm_list_struct_base(v->field.n, typeof(*v), field); \ &v->field != (head); \ - v = t, t = list_struct_base(v->field.n, typeof(*v), field)) + v = t, t = dm_list_struct_base(v->field.n, typeof(*v), field)) /* * Walk a list, setting 'v' in turn to the containing structure of each item. * The containing structure should be the same type as 'v'. - * The list should be 'struct list list' within the containing structure. + * The list should be 'struct dm_list list' within the containing structure. * t must be defined as a temporary variable of the same type as v. */ -#define list_iterate_items_safe(v, t, head) \ - list_iterate_items_gen_safe(v, t, (head), list) +#define dm_list_iterate_items_safe(v, t, head) \ + dm_list_iterate_items_gen_safe(v, t, (head), list) /* * Walk a list backwards, setting 'v' in turn to the containing structure * of each item. * The containing structure should be the same type as 'v'. - * The 'struct list' variable within the containing structure is 'field'. + * The 'struct dm_list' variable within the containing structure is 'field'. */ -#define list_iterate_back_items_gen(v, head, field) \ - for (v = list_struct_base((head)->p, typeof(*v), field); \ +#define dm_list_iterate_back_items_gen(v, head, field) \ + for (v = dm_list_struct_base((head)->p, typeof(*v), field); \ &v->field != (head); \ - v = list_struct_base(v->field.p, typeof(*v), field)) + v = dm_list_struct_base(v->field.p, typeof(*v), field)) /* * Walk a list backwards, setting 'v' in turn to the containing structure * of each item. * The containing structure should be the same type as 'v'. - * The list should be 'struct list list' within the containing structure. + * The list should be 'struct dm_list list' within the containing structure. */ -#define list_iterate_back_items(v, head) list_iterate_back_items_gen(v, (head), list) +#define dm_list_iterate_back_items(v, head) dm_list_iterate_back_items_gen(v, (head), list) /* * Return the number of elements in a list by walking it. */ -unsigned int list_size(const struct list *head); +unsigned int dm_list_size(const struct dm_list *head); #endif --- LVM2/tools/Makefile.in 2008/11/01 02:19:19 1.86 +++ LVM2/tools/Makefile.in 2008/11/03 22:14:30 1.87 @@ -80,7 +80,7 @@ CLEAN_TARGETS = liblvm2cmd.so liblvm2cmd.a liblvm2cmd-static.a lvm lvm.o \ lvm2cmd.o lvm2cmd-static.o lvm2cmdlib.o lvm.static \ lvm.cflow lvm.xref lvm.tree lvm.rxref lvm.rtree \ - lvmcmdlib.o lvm-static.o + lvmcmdlib.o lvm-static.o dmsetup.o ifeq ("@CMDLIB@", "yes") TARGETS += liblvm2cmd.so @@ -99,9 +99,9 @@ device-mapper: dmsetup -dmsetup: dmsetup.o $(interfacedir)/libdevmapper.$(LIB_SUFFIX) +dmsetup: dmsetup.o $(top_srcdir)/libdm/libdevmapper.$(LIB_SUFFIX) $(CC) -o $@ dmsetup.o $(CFLAGS) $(LDFLAGS) \ - -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS) + -L$(top_srcdir)/libdm -L$(DESTDIR)/lib -ldevmapper $(LIBS) dmsetup.static: dmsetup.o $(interfacedir)/libdevmapper.a $(CC) -o $@ dmsetup.o $(CFLAGS) $(LDFLAGS) -static \ --- LVM2/tools/lvconvert.c 2008/06/26 23:05:11 1.66 +++ LVM2/tools/lvconvert.c 2008/11/03 22:14:30 1.67 @@ -39,7 +39,7 @@ int pv_count; char **pvs; - struct list *pvh; + struct dm_list *pvh; }; static int _lvconvert_name_params(struct lvconvert_params *lp, @@ -257,7 +257,7 @@ static int _update_lvconvert_mirror(struct cmd_context *cmd __attribute((unused)), struct volume_group *vg __attribute((unused)), struct logical_volume *lv __attribute((unused)), - struct list *lvs_changed __attribute((unused)), + struct dm_list *lvs_changed __attribute((unused)), unsigned flags __attribute((unused))) { /* lvconvert mirror doesn't require periodical metadata update */ @@ -267,7 +267,7 @@ static int _finish_lvconvert_mirror(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv, - struct list *lvs_changed __attribute((unused))) + struct dm_list *lvs_changed __attribute((unused))) { if (!collapse_mirrored_lv(lv)) { log_error("Failed to remove temporary sync layer."); @@ -477,7 +477,7 @@ /* FIXME Share code with lvcreate */ /* FIXME Why is this restriction here? Fix it! */ - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (seg_is_striped(seg) && seg->area_count > 1) { log_error("Mirrors of striped volumes are not yet supported."); return 0; @@ -501,7 +501,7 @@ * Converting from mirror to mirror with different leg count, * or different log type. */ - if (list_size(&lv->segments) != 1) { + if (dm_list_size(&lv->segments) != 1) { log_error("Logical volume %s has multiple " "mirror segments.", lv->name); return 0; --- LVM2/tools/lvcreate.c 2008/09/24 16:32:51 1.177 +++ LVM2/tools/lvcreate.c 2008/11/03 22:14:30 1.178 @@ -518,7 +518,7 @@ uint32_t status = 0; uint64_t tmp_size; struct logical_volume *lv, *org = NULL; - struct list *pvh; + struct dm_list *pvh; const char *tag = NULL; int origin_active = 0; char lv_name_buf[128]; @@ -690,10 +690,10 @@ return 0; } - if (lp->stripes > list_size(pvh) && lp->alloc != ALLOC_ANYWHERE) { + if (lp->stripes > dm_list_size(pvh) && lp->alloc != ALLOC_ANYWHERE) { log_error("Number of stripes (%u) must not exceed " "number of physical volumes (%d)", lp->stripes, - list_size(pvh)); + dm_list_size(pvh)); return 0; } --- LVM2/tools/lvmcmdline.c 2008/09/19 07:11:54 1.71 +++ LVM2/tools/lvmcmdline.c 2008/11/03 22:14:30 1.72 @@ -120,7 +120,7 @@ format = a->value; - list_iterate_items(fmt, &cmd->formats) { + dm_list_iterate_items(fmt, &cmd->formats) { if (!strcasecmp(fmt->name, format) || !strcasecmp(fmt->name + 3, format) || (fmt->alias && !strcasecmp(fmt->alias, format))) { --- LVM2/tools/lvresize.c 2008/09/18 18:51:58 1.98 +++ LVM2/tools/lvresize.c 2008/11/03 22:14:30 1.99 @@ -267,7 +267,7 @@ struct lv_segment *seg; uint32_t seg_extents; uint32_t sz, str; - struct list *pvh = NULL; + struct dm_list *pvh = NULL; char size_buf[SIZE_BUF]; char lv_path[PATH_MAX]; @@ -381,7 +381,7 @@ seg_size = lp->extents - lv->le_count; /* Use segment type of last segment */ - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { lp->segtype = seg->segtype; } @@ -394,7 +394,7 @@ /* If extending, find stripes, stripesize & size of last segment */ if ((lp->extents > lv->le_count) && !(lp->stripes == 1 || (lp->stripes > 1 && lp->stripe_size))) { - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { if (!seg_is_striped(seg)) continue; @@ -434,7 +434,7 @@ /* If extending, find mirrors of last segment */ if ((lp->extents > lv->le_count)) { - list_iterate_back_items(seg, &lv->segments) { + dm_list_iterate_back_items(seg, &lv->segments) { if (seg_is_mirrored(seg)) seg_mirrors = lv_mirror_count(seg->lv); else @@ -461,7 +461,7 @@ log_error("Ignoring stripes, stripesize and mirrors " "arguments when reducing"); - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { seg_extents = seg->len; if (seg_is_striped(seg)) { --- LVM2/tools/lvscan.c 2008/01/30 14:00:02 1.35 +++ LVM2/tools/lvscan.c 2008/11/03 22:14:30 1.36 @@ -32,7 +32,7 @@ inkernel = lv_info(cmd, lv, &info, 1, 0) && info.exists; if (lv_is_origin(lv)) { - list_iterate_items_gen(snap_seg, &lv->snapshot_segs, + dm_list_iterate_items_gen(snap_seg, &lv->snapshot_segs, origin_list) { if (inkernel && (snap_active = lv_snapshot_percent(snap_seg->cow, --- LVM2/tools/polldaemon.c 2008/01/30 14:00:02 1.10 +++ LVM2/tools/polldaemon.c 2008/11/03 22:14:30 1.11 @@ -68,7 +68,7 @@ const char *name, struct daemon_parms *parms, int *finished) { - struct list *lvs_changed; + struct dm_list *lvs_changed; float segment_percent = 0.0, overall_percent = 0.0; uint32_t event_nr = 0; @@ -196,7 +196,7 @@ if (!vg_check_status(vg, EXPORTED_VG)) return ECMD_FAILED; - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { lv_mirr = lvl->lv; if (!(lv_mirr->status & parms->lv_type)) continue; --- LVM2/tools/polldaemon.h 2008/04/09 12:56:34 1.6 +++ LVM2/tools/polldaemon.h 2008/11/03 22:14:30 1.7 @@ -29,11 +29,11 @@ int (*update_metadata) (struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv_mirr, - struct list *lvs_changed, unsigned flags); + struct dm_list *lvs_changed, unsigned flags); int (*finish_copy) (struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv_mirr, - struct list *lvs_changed); + struct dm_list *lvs_changed); }; struct daemon_parms { --- LVM2/tools/pvchange.c 2008/07/31 12:40:52 1.62 +++ LVM2/tools/pvchange.c 2008/11/03 22:14:30 1.63 @@ -226,8 +226,8 @@ char *pv_name; struct pv_list *pvl; - struct list *pvslist; - struct list mdas; + struct dm_list *pvslist; + struct dm_list mdas; if (arg_count(cmd, allocatable_ARG) + arg_count(cmd, addtag_ARG) + arg_count(cmd, deltag_ARG) + arg_count(cmd, uuid_ARG) != 1) { @@ -250,7 +250,7 @@ log_verbose("Using physical volume(s) on command line"); for (; opt < argc; opt++) { pv_name = argv[opt]; - list_init(&mdas); + dm_list_init(&mdas); if (!(pv = pv_read(cmd, pv_name, &mdas, NULL, 1))) { log_error("Failed to read physical volume %s", pv_name); @@ -263,7 +263,7 @@ * means checking every VG by scanning every * PV on the system. */ - if (is_orphan(pv) && !list_size(&mdas)) { + if (is_orphan(pv) && !dm_list_size(&mdas)) { if (!scan_vgs_for_pvs(cmd)) { log_error("Rescan for PVs without " "metadata areas failed."); @@ -287,7 +287,7 @@ return ECMD_FAILED; } - list_iterate_items(pvl, pvslist) { + dm_list_iterate_items(pvl, pvslist) { total++; done += _pvchange_single(cmd, pvl->pv, NULL); } --- LVM2/tools/pvcreate.c 2008/09/19 06:42:00 1.75 +++ LVM2/tools/pvcreate.c 2008/11/03 22:14:30 1.76 @@ -148,7 +148,7 @@ struct pvcreate_params *pp = (struct pvcreate_params *) handle; void *pv; struct device *dev; - struct list mdas; + struct dm_list mdas; if (pp->idp) { if ((dev = device_from_pvid(cmd, pp->idp)) && @@ -176,7 +176,7 @@ goto error; } - list_init(&mdas); + dm_list_init(&mdas); if (!(pv = pv_create(cmd, dev, pp->idp, pp->size, pp->pe_start, pp->extent_count, pp->extent_size, pp->pvmetadatacopies, --- LVM2/tools/pvmove.c 2008/04/10 17:09:32 1.53 +++ LVM2/tools/pvmove.c 2008/11/03 22:14:30 1.54 @@ -102,12 +102,12 @@ } /* Create list of PVs for allocation of replacement extents */ -static struct list *_get_allocatable_pvs(struct cmd_context *cmd, int argc, +static struct dm_list *_get_allocatable_pvs(struct cmd_context *cmd, int argc, char **argv, struct volume_group *vg, struct physical_volume *pv, alloc_policy_t alloc) { - struct list *allocatable_pvs, *pvht, *pvh; + struct dm_list *allocatable_pvs, *pvht, *pvh; struct pv_list *pvl; if (argc) @@ -118,21 +118,21 @@ if (!allocatable_pvs) return_NULL; - list_iterate_safe(pvh, pvht, allocatable_pvs) { - pvl = list_item(pvh, struct pv_list); + dm_list_iterate_safe(pvh, pvht, allocatable_pvs) { + pvl = dm_list_item(pvh, struct pv_list); /* Don't allocate onto the PV we're clearing! */ if ((alloc != ALLOC_ANYWHERE) && (pvl->pv->dev == pv_dev(pv))) { - list_del(&pvl->list); + dm_list_del(&pvl->list); continue; } /* Remove PV if full */ if ((pvl->pv->pe_count == pvl->pv->pe_alloc_count)) - list_del(&pvl->list); + dm_list_del(&pvl->list); } - if (list_empty(allocatable_pvs)) { + if (dm_list_empty(allocatable_pvs)) { log_error("No extents available for allocation"); return NULL; } @@ -146,16 +146,16 @@ */ static int _insert_pvmove_mirrors(struct cmd_context *cmd, struct logical_volume *lv_mirr, - struct list *source_pvl, + struct dm_list *source_pvl, struct logical_volume *lv, - struct list *lvs_changed) + struct dm_list *lvs_changed) { struct pv_list *pvl; uint32_t prev_le_count; /* Only 1 PV may feature in source_pvl */ - pvl = list_item(source_pvl->n, struct pv_list); + pvl = dm_list_item(source_pvl->n, struct pv_list); prev_le_count = lv_mirr->le_count; if (!insert_layer_for_segments_on_pv(cmd, lv, lv_mirr, PVMOVE, @@ -177,11 +177,11 @@ /* Create new LV with mirror segments for the required copies */ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd, struct volume_group *vg, - struct list *source_pvl, + struct dm_list *source_pvl, const char *lv_name, - struct list *allocatable_pvs, + struct dm_list *allocatable_pvs, alloc_policy_t alloc, - struct list **lvs_changed) + struct dm_list **lvs_changed) { struct logical_volume *lv_mirr, *lv; struct lv_list *lvl; @@ -203,10 +203,10 @@ return NULL; } - list_init(*lvs_changed); + dm_list_init(*lvs_changed); /* Find segments to be moved and set up mirrors */ - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { lv = lvl->lv; if ((lv == lv_mirr)) continue; @@ -276,7 +276,7 @@ static int _update_metadata(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv_mirr, - struct list *lvs_changed, unsigned flags) + struct dm_list *lvs_changed, unsigned flags) { unsigned exclusive = _pvmove_is_exclusive(cmd, vg); unsigned first_time = (flags & PVMOVE_FIRST_TIME) ? 1 : 0; @@ -347,10 +347,10 @@ const char *lv_name = NULL; char *pv_name_arg; struct volume_group *vg; - struct list *source_pvl; - struct list *allocatable_pvs; + struct dm_list *source_pvl; + struct dm_list *allocatable_pvs; alloc_policy_t alloc; - struct list *lvs_changed; + struct dm_list *lvs_changed; struct physical_volume *pv; struct logical_volume *lv_mirr; unsigned first_time = 1; @@ -474,14 +474,14 @@ static int _finish_pvmove(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv_mirr, - struct list *lvs_changed) + struct dm_list *lvs_changed) { int r = 1; - struct list lvs_completed; + struct dm_list lvs_completed; struct lv_list *lvl; /* Update metadata to remove mirror segments and break dependencies */ - list_init(&lvs_completed); + dm_list_init(&lvs_completed); if (!lv_remove_mirrors(cmd, lv_mirr, 1, 0, NULL, PVMOVE) || !remove_layers_for_segments_all(cmd, lv_mirr, PVMOVE, &lvs_completed)) { @@ -489,7 +489,7 @@ return 0; } - list_iterate_items(lvl, &lvs_completed) + dm_list_iterate_items(lvl, &lvs_completed) /* FIXME Assumes only one pvmove at a time! */ lvl->lv->status &= ~LOCKED; --- LVM2/tools/pvremove.c 2008/07/31 12:38:31 1.24 +++ LVM2/tools/pvremove.c 2008/11/03 22:14:30 1.25 @@ -25,9 +25,9 @@ static int pvremove_check(struct cmd_context *cmd, const char *name) { struct physical_volume *pv; - struct list mdas; + struct dm_list mdas; - list_init(&mdas); + dm_list_init(&mdas); /* FIXME Check partition type is LVM unless --force is given */ @@ -47,7 +47,7 @@ * means checking every VG by scanning every * PV on the system. */ - if (is_orphan(pv) && !list_size(&mdas)) { + if (is_orphan(pv) && !dm_list_size(&mdas)) { if (!scan_vgs_for_pvs(cmd)) { log_error("Rescan for PVs without metadata areas " "failed."); --- LVM2/tools/pvresize.c 2008/09/12 15:26:45 1.22 +++ LVM2/tools/pvresize.c 2008/11/03 22:14:30 1.23 @@ -32,13 +32,13 @@ int consistent = 1; uint64_t size = 0; uint32_t new_pe_count = 0; - struct list mdas; + struct dm_list mdas; const char *pv_name = pv_dev_name(pv); const char *vg_name; struct lvmcache_info *info; int mda_count = 0; - list_init(&mdas); + dm_list_init(&mdas); if (is_orphan_vg(pv_vg_name(pv))) { vg_name = VG_ORPHANS; @@ -53,7 +53,7 @@ return 0; } - mda_count = list_size(&mdas); + mda_count = dm_list_size(&mdas); } else { vg_name = pv_vg_name(pv); @@ -90,7 +90,7 @@ return 0; } - mda_count = list_size(&info->mdas); + mda_count = dm_list_size(&info->mdas); if (!archive(vg)) return 0; --- LVM2/tools/pvscan.c 2008/04/08 12:49:21 1.46 +++ LVM2/tools/pvscan.c 2008/11/03 22:14:30 1.47 @@ -103,7 +103,7 @@ int new_pvs_found = 0; int pvs_found = 0; - struct list *pvslist; + struct dm_list *pvslist; struct pv_list *pvl; struct physical_volume *pv; @@ -139,13 +139,13 @@ } /* eliminate exported/new if required */ - list_iterate_items(pvl, pvslist) { + dm_list_iterate_items(pvl, pvslist) { pv = pvl->pv; if ((arg_count(cmd, exported_ARG) && !(pv_status(pv) & EXPORTED_VG)) || (arg_count(cmd, novolumegroup_ARG) && (!is_orphan(pv)))) { - list_del(&pvl->list); + dm_list_del(&pvl->list); continue; } @@ -171,7 +171,7 @@ /* find maximum pv name length */ pv_max_name_len = vg_max_name_len = 0; - list_iterate_items(pvl, pvslist) { + dm_list_iterate_items(pvl, pvslist) { pv = pvl->pv; len = strlen(pv_dev_name(pv)); if (pv_max_name_len < len) @@ -183,7 +183,7 @@ pv_max_name_len += 2; vg_max_name_len += 2; - list_iterate_items(pvl, pvslist) + dm_list_iterate_items(pvl, pvslist) _pvscan_display_single(cmd, pvl->pv, NULL); if (!pvs_found) { --- LVM2/tools/reporter.c 2008/06/25 16:52:27 1.40 +++ LVM2/tools/reporter.c 2008/11/03 22:14:30 1.41 @@ -88,9 +88,9 @@ _free_lv_segment.segtype = get_segtype_from_string(cmd, "free"); _free_lv_segment.len = pvseg->len; - list_init(&_free_logical_volume.tags); - list_init(&_free_logical_volume.segments); - list_init(&_free_logical_volume.segs_using_this_lv); + dm_list_init(&_free_logical_volume.tags); + dm_list_init(&_free_logical_volume.segments); + dm_list_init(&_free_logical_volume.segs_using_this_lv); if (!report_object(handle, vg, seg ? seg->lv : &_free_logical_volume, pvseg->pv, seg ? : &_free_lv_segment, pvseg)) --- LVM2/tools/toollib.c 2008/06/11 15:02:52 1.136 +++ LVM2/tools/toollib.c 2008/11/03 22:14:30 1.137 @@ -140,8 +140,8 @@ */ int process_each_lv_in_vg(struct cmd_context *cmd, const struct volume_group *vg, - const struct list *arg_lvnames, - const struct list *tags, + const struct dm_list *arg_lvnames, + const struct dm_list *tags, void *handle, process_single_lv_fn_t process_single) { @@ -158,10 +158,10 @@ if (!vg_check_status(vg, EXPORTED_VG)) return ECMD_FAILED; - if (tags && !list_empty(tags)) + if (tags && !dm_list_empty(tags)) tags_supplied = 1; - if (arg_lvnames && !list_empty(arg_lvnames)) + if (arg_lvnames && !dm_list_empty(arg_lvnames)) lvargs_supplied = 1; /* Process all LVs in this VG if no restrictions given */ @@ -174,7 +174,7 @@ process_all = 1; } - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { if (lvl->lv->status & SNAPSHOT) continue; @@ -207,7 +207,7 @@ return ret_max; } - if (lvargs_supplied && lvargs_matched != list_size(arg_lvnames)) { + if (lvargs_supplied && lvargs_matched != dm_list_size(arg_lvnames)) { log_error("One or more specified logical volume(s) not found."); if (ret_max < ECMD_FAILED) ret_max = ECMD_FAILED; @@ -227,25 +227,25 @@ int ret = 0; int consistent; - struct list *tags_arg; - struct list *vgnames; /* VGs to process */ + struct dm_list *tags_arg; + struct dm_list *vgnames; /* VGs to process */ struct str_list *sll, *strl; struct volume_group *vg; - struct list tags, lvnames; - struct list arg_lvnames; /* Cmdline vgname or vgname/lvname */ + struct dm_list tags, lvnames; + struct dm_list arg_lvnames; /* Cmdline vgname or vgname/lvname */ char *vglv; size_t vglv_sz; const char *vgname; - list_init(&tags); - list_init(&arg_lvnames); + dm_list_init(&tags); + dm_list_init(&arg_lvnames); if (argc) { - struct list arg_vgnames; + struct dm_list arg_vgnames; log_verbose("Using logical volume(s) on command line"); - list_init(&arg_vgnames); + dm_list_init(&arg_vgnames); for (; opt < argc; opt++) { const char *lv_name = argv[opt]; @@ -327,15 +327,15 @@ vgnames = &arg_vgnames; } - if (!argc || !list_empty(&tags)) { + if (!argc || !dm_list_empty(&tags)) { log_verbose("Finding all logical volumes"); - if (!(vgnames = get_vgs(cmd, 0)) || list_empty(vgnames)) { + if (!(vgnames = get_vgs(cmd, 0)) || dm_list_empty(vgnames)) { log_error("No volume groups found"); return ret_max; } } - list_iterate_items(strl, vgnames) { + dm_list_iterate_items(strl, vgnames) { vgname = strl->str; if (is_orphan_vg(vgname)) continue; /* FIXME Unnecessary? */ @@ -377,15 +377,15 @@ } tags_arg = &tags; - list_init(&lvnames); /* LVs to be processed in this VG */ - list_iterate_items(sll, &arg_lvnames) { + dm_list_init(&lvnames); /* LVs to be processed in this VG */ + dm_list_iterate_items(sll, &arg_lvnames) { const char *vg_name = sll->str; const char *lv_name = strchr(vg_name, '/'); if ((!lv_name && !strcmp(vg_name, vgname))) { /* Process all LVs in this VG */ tags_arg = NULL; - list_init(&lvnames); + dm_list_init(&lvnames); break; } else if (!strncmp(vg_name, vgname, strlen(vgname)) && strlen(vgname) == (size_t) (lv_name - vg_name)) { @@ -434,7 +434,7 @@ } } - list_iterate_items(pvseg, &pv->segments) { + dm_list_iterate_items(pvseg, &pv->segments) { ret = process_single(cmd, vg, pvseg, handle); if (ret > ret_max) ret_max = ret; @@ -459,7 +459,7 @@ int ret_max = ECMD_PROCESSED; int ret; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { ret = process_single(cmd, seg, handle); if (ret > ret_max) ret_max = ret; @@ -472,7 +472,7 @@ static int _process_one_vg(struct cmd_context *cmd, const char *vg_name, const char *vgid, - struct list *tags, struct list *arg_vgnames, + struct dm_list *tags, struct dm_list *arg_vgnames, uint32_t lock_type, int consistent, void *handle, int ret_max, int (*process_single) (struct cmd_context * cmd, @@ -500,7 +500,7 @@ return ECMD_FAILED; } - if (!list_empty(tags)) { + if (!dm_list_empty(tags)) { /* Only process if a tag matches or it's on arg_vgnames */ if (!str_list_match_item(arg_vgnames, vg_name) && !str_list_match_list(tags, &vg->tags)) { @@ -530,13 +530,13 @@ int ret_max = ECMD_PROCESSED; struct str_list *sl; - struct list *vgnames, *vgids; - struct list arg_vgnames, tags; + struct dm_list *vgnames, *vgids; + struct dm_list arg_vgnames, tags; const char *vg_name, *vgid; - list_init(&tags); - list_init(&arg_vgnames); + dm_list_init(&tags); + dm_list_init(&arg_vgnames); if (argc) { log_verbose("Using volume group(s) on command line"); @@ -574,13 +574,13 @@ vgnames = &arg_vgnames; } - if (!argc || !list_empty(&tags)) { + if (!argc || !dm_list_empty(&tags)) { log_verbose("Finding all volume groups"); - if (!(vgids = get_vgids(cmd, 0)) || list_empty(vgids)) { + if (!(vgids = get_vgids(cmd, 0)) || dm_list_empty(vgids)) { log_error("No volume groups found"); return ret_max; } - list_iterate_items(sl, vgids) { + dm_list_iterate_items(sl, vgids) { vgid = sl->str; if (!vgid || !(vg_name = vgname_from_vgid(cmd->mem, vgid)) || is_orphan_vg(vg_name)) @@ -593,7 +593,7 @@ return ret_max; } } else { - list_iterate_items(sl, vgnames) { + dm_list_iterate_items(sl, vgnames) { vg_name = sl->str; if (is_orphan_vg(vg_name)) continue; /* FIXME Unnecessary? */ @@ -610,15 +610,15 @@ } int process_each_pv_in_vg(struct cmd_context *cmd, struct volume_group *vg, - const struct list *tags, void *handle, + const struct dm_list *tags, void *handle, process_single_pv_fn_t process_single) { int ret_max = ECMD_PROCESSED; int ret = 0; struct pv_list *pvl; - list_iterate_items(pvl, &vg->pvs) { - if (tags && !list_empty(tags) && + dm_list_iterate_items(pvl, &vg->pvs) { + if (tags && !dm_list_empty(tags) && !str_list_match_list(tags, &pvl->pv->tags)) { continue; } @@ -658,8 +658,8 @@ while ((dev = dev_iter_get(iter))) { if (!(pv = pv_read(cmd, dev_name(dev), NULL, NULL, 0))) { memset(&pv_dummy, 0, sizeof(pv_dummy)); - list_init(&pv_dummy.tags); - list_init(&pv_dummy.segments); + dm_list_init(&pv_dummy.tags); + dm_list_init(&pv_dummy.segments); pv_dummy.dev = dev; pv_dummy.fmt = NULL; pv = &pv_dummy; @@ -689,14 +689,14 @@ struct pv_list *pvl; struct physical_volume *pv; - struct list *pvslist, *vgnames; - struct list tags; + struct dm_list *pvslist, *vgnames; + struct dm_list tags; struct str_list *sll; char *tagname; int consistent = 1; int scanned = 0; - list_init(&tags); + dm_list_init(&tags); if (argc) { log_verbose("Using physical volume(s) on command line"); @@ -769,9 +769,9 @@ if (sigint_caught()) return ret_max; } - if (!list_empty(&tags) && (vgnames = get_vgs(cmd, 0)) && - !list_empty(vgnames)) { - list_iterate_items(sll, vgnames) { + if (!dm_list_empty(&tags) && (vgnames = get_vgs(cmd, 0)) && + !dm_list_empty(vgnames)) { + dm_list_iterate_items(sll, vgnames) { if (!lock_vol(cmd, sll->str, lock_type)) { log_error("Can't lock %s: skipping", sll->str); continue; @@ -825,7 +825,7 @@ if (!(pvslist = get_pvs(cmd))) return ECMD_FAILED; - list_iterate_items(pvl, pvslist) { + dm_list_iterate_items(pvl, pvslist) { ret = process_single(cmd, NULL, pvl->pv, handle); if (ret > ret_max) @@ -927,7 +927,7 @@ * Process physical extent range specifiers */ static int _add_pe_range(struct dm_pool *mem, const char *pvname, - struct list *pe_ranges, uint32_t start, uint32_t count) + struct dm_list *pe_ranges, uint32_t start, uint32_t count) { struct pe_range *per; @@ -935,7 +935,7 @@ " on %s", start, count, pvname); /* Ensure no overlap with existing areas */ - list_iterate_items(per, pe_ranges) { + dm_list_iterate_items(per, pe_ranges) { if (((start < per->start) && (start + count - 1 >= per->start)) || ((start >= per->start) && (per->start + per->count - 1) >= start)) { @@ -955,7 +955,7 @@ per->start = start; per->count = count; - list_add(pe_ranges, &per->list); + dm_list_add(pe_ranges, &per->list); return 1; } @@ -972,7 +972,7 @@ return 0; } -static int _parse_pes(struct dm_pool *mem, char *c, struct list *pe_ranges, +static int _parse_pes(struct dm_pool *mem, char *c, struct dm_list *pe_ranges, const char *pvname, uint32_t size) { char *endptr; @@ -1039,11 +1039,11 @@ } static int _create_pv_entry(struct dm_pool *mem, struct pv_list *pvl, - char *colon, int allocatable_only, struct list *r) + char *colon, int allocatable_only, struct dm_list *r) { const char *pvname; struct pv_list *new_pvl = NULL, *pvl2; - struct list *pe_ranges; + struct dm_list *pe_ranges; pvname = pv_dev_name(pvl->pv); if (allocatable_only && !(pvl->pv->status & ALLOCATABLE_PV)) { @@ -1057,7 +1057,7 @@ return 1; } - list_iterate_items(pvl2, r) + dm_list_iterate_items(pvl2, r) if (pvl->pv->dev == pvl2->pv->dev) { new_pvl = pvl2; break; @@ -1075,9 +1075,9 @@ log_error("Allocation of pe_ranges list failed"); return 0; } - list_init(pe_ranges); + dm_list_init(pe_ranges); new_pvl->pe_ranges = pe_ranges; - list_add(r, &new_pvl->list); + dm_list_add(r, &new_pvl->list); } /* Determine selected physical extents */ @@ -1088,12 +1088,12 @@ return 1; } -struct list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int argc, +struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int argc, char **argv, int allocatable_only) { - struct list *r; + struct dm_list *r; struct pv_list *pvl; - struct list tags, arg_pvnames; + struct dm_list tags, arg_pvnames; const char *pvname = NULL; char *colon, *tagname; int i; @@ -1103,10 +1103,10 @@ log_error("Allocation of list failed"); return NULL; } - list_init(r); + dm_list_init(r); - list_init(&tags); - list_init(&arg_pvnames); + dm_list_init(&tags); + dm_list_init(&arg_pvnames); for (i = 0; i < argc; i++) { if (*argv[i] == '@') { @@ -1115,7 +1115,7 @@ log_error("Skipping invalid tag %s", tagname); continue; } - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (str_list_match_item(&pvl->pv->tags, tagname)) { if (!_create_pv_entry(mem, pvl, NULL, @@ -1147,15 +1147,15 @@ return_NULL; } - if (list_empty(r)) + if (dm_list_empty(r)) log_error("No specified PVs have space available"); - return list_empty(r) ? NULL : r; + return dm_list_empty(r) ? NULL : r; } -struct list *clone_pv_list(struct dm_pool *mem, struct list *pvsl) +struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvsl) { - struct list *r; + struct dm_list *r; struct pv_list *pvl, *new_pvl; /* Build up list of PVs */ @@ -1163,16 +1163,16 @@ log_error("Allocation of list failed"); return NULL; } - list_init(r); + dm_list_init(r); - list_iterate_items(pvl, pvsl) { + dm_list_iterate_items(pvl, pvsl) { if (!(new_pvl = dm_pool_zalloc(mem, sizeof(*new_pvl)))) { log_error("Unable to allocate physical volume list."); return NULL; } memcpy(new_pvl, pvl, sizeof(*new_pvl)); - list_add(r, &new_pvl->list); + dm_list_add(r, &new_pvl->list); } return r; --- LVM2/tools/toollib.h 2008/03/25 15:24:59 1.57 +++ LVM2/tools/toollib.h 2008/11/03 22:14:30 1.58 @@ -66,7 +66,7 @@ void *handle); int process_each_pv_in_vg(struct cmd_context *cmd, struct volume_group *vg, - const struct list *tags, void *handle, + const struct dm_list *tags, void *handle, process_single_pv_fn_t process_single); typedef int (*process_single_lv_fn_t) (struct cmd_context *cmd, @@ -75,8 +75,8 @@ int process_each_lv_in_vg(struct cmd_context *cmd, const struct volume_group *vg, - const struct list *arg_lvnames, - const struct list *tags, + const struct dm_list *arg_lvnames, + const struct dm_list *tags, void *handle, process_single_lv_fn_t process_single); @@ -89,10 +89,10 @@ * Builds a list of pv's from the names in argv. Used in * lvcreate/extend. */ -struct list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int argc, +struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int argc, char **argv, int allocatable_only); -struct list *clone_pv_list(struct dm_pool *mem, struct list *pvs); +struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvs); int apply_lvname_restrictions(const char *name); int is_reserved_lvname(const char *name); --- LVM2/tools/vgchange.c 2008/06/12 11:49:46 1.65 +++ LVM2/tools/vgchange.c 2008/11/03 22:14:30 1.66 @@ -24,7 +24,7 @@ int lv_active; int count = 0; - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { lv = lvl->lv; if (!lv_info(cmd, lv, &info, 0, 0)) @@ -59,7 +59,7 @@ const char *pvname; int count = 0; - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { lv = lvl->lv; /* Only request activation of snapshot origin devices */ @@ -260,7 +260,7 @@ } if (clustered) { - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { if (lv_is_origin(lvl->lv) || lv_is_cow(lvl->lv)) { log_error("Volume group %s contains snapshots " "that are not yet supported.", @@ -496,7 +496,7 @@ return ECMD_FAILED; } - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { memcpy(&lvl->lv->lvid, &vg->id, sizeof(vg->id)); } --- LVM2/tools/vgconvert.c 2008/08/29 13:41:21 1.30 +++ LVM2/tools/vgconvert.c 2008/11/03 22:14:30 1.31 @@ -23,7 +23,7 @@ struct logical_volume *lv; struct lv_list *lvl; uint64_t size = 0; - struct list mdas; + struct dm_list mdas; int pvmetadatacopies = 0; uint64_t pvmetadatasize = 0; uint64_t pe_end = 0, pe_start = 0; @@ -93,7 +93,7 @@ /* If converting to restricted lvid, check if lvid is compatible */ if (!(vg->fid->fmt->features & FMT_RESTRICTED_LVIDS) && cmd->fmt->features & FMT_RESTRICTED_LVIDS) - list_iterate_items(lvl, &vg->lvs) + dm_list_iterate_items(lvl, &vg->lvs) if (!lvid_in_restricted_range(&lvl->lv->lvid)) { log_error("Logical volume %s lvid format is" " incompatible with requested" @@ -103,7 +103,7 @@ /* Attempt to change any LVIDs that are too big */ if (cmd->fmt->features & FMT_RESTRICTED_LVIDS) { - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { lv = lvl->lv; if (lv->status & SNAPSHOT) continue; @@ -124,14 +124,14 @@ if (active) return ECMD_FAILED; - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { existing_pv = pvl->pv; pe_start = pv_pe_start(existing_pv); pe_end = pv_pe_count(existing_pv) * pv_pe_size(existing_pv) + pe_start - 1; - list_init(&mdas); + dm_list_init(&mdas); if (!(pv = pv_create(cmd, pv_dev(existing_pv), &existing_pv->id, size, pe_start, pv_pe_count(existing_pv), --- LVM2/tools/vgexport.c 2008/01/30 14:00:02 1.18 +++ LVM2/tools/vgexport.c 2008/11/03 22:14:30 1.19 @@ -48,7 +48,7 @@ vg->status |= EXPORTED_VG; - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { pv = pvl->pv; pv->status |= EXPORTED_VG; } --- LVM2/tools/vgimport.c 2008/01/30 14:00:02 1.17 +++ LVM2/tools/vgimport.c 2008/11/03 22:14:30 1.18 @@ -44,7 +44,7 @@ vg->status &= ~EXPORTED_VG; - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { pv = pvl->pv; pv->status &= ~EXPORTED_VG; } --- LVM2/tools/vgmerge.c 2008/06/06 19:32:35 1.49 +++ LVM2/tools/vgmerge.c 2008/11/03 22:14:30 1.50 @@ -52,23 +52,23 @@ drop_cached_metadata(vg_from); /* Merge volume groups */ - while (!list_empty(&vg_from->pvs)) { - struct list *pvh = vg_from->pvs.n; + while (!dm_list_empty(&vg_from->pvs)) { + struct dm_list *pvh = vg_from->pvs.n; struct physical_volume *pv; - list_move(&vg_to->pvs, pvh); + dm_list_move(&vg_to->pvs, pvh); - pv = list_item(pvh, struct pv_list)->pv; + pv = dm_list_item(pvh, struct pv_list)->pv; pv->vg_name = dm_pool_strdup(cmd->mem, vg_to->name); } vg_to->pv_count += vg_from->pv_count; /* Fix up LVIDs */ - list_iterate_items(lvl1, &vg_to->lvs) { + dm_list_iterate_items(lvl1, &vg_to->lvs) { union lvid *lvid1 = &lvl1->lv->lvid; char uuid[64] __attribute((aligned(8))); - list_iterate_items(lvl2, &vg_from->lvs) { + dm_list_iterate_items(lvl2, &vg_from->lvs) { union lvid *lvid2 = &lvl2->lv->lvid; if (id_equal(&lvid1->id[1], &lvid2->id[1])) { @@ -88,16 +88,16 @@ } } - while (!list_empty(&vg_from->lvs)) { - struct list *lvh = vg_from->lvs.n; + while (!dm_list_empty(&vg_from->lvs)) { + struct dm_list *lvh = vg_from->lvs.n; - list_move(&vg_to->lvs, lvh); + dm_list_move(&vg_to->lvs, lvh); } - while (!list_empty(&vg_from->fid->metadata_areas)) { - struct list *mdah = vg_from->fid->metadata_areas.n; + while (!dm_list_empty(&vg_from->fid->metadata_areas)) { + struct dm_list *mdah = vg_from->fid->metadata_areas.n; - list_move(&vg_to->fid->metadata_areas, mdah); + dm_list_move(&vg_to->fid->metadata_areas, mdah); } vg_to->lv_count += vg_from->lv_count; --- LVM2/tools/vgreduce.c 2008/09/19 15:44:03 1.84 +++ LVM2/tools/vgreduce.c 2008/11/03 22:14:30 1.85 @@ -41,16 +41,16 @@ vg->extent_count -= pvl->pv->pe_count; vg->pv_count--; - list_del(&pvl->list); + dm_list_del(&pvl->list); return 1; } static int _remove_lv(struct cmd_context *cmd, struct logical_volume *lv, - int *list_unsafe, struct list *lvs_changed) + int *list_unsafe, struct dm_list *lvs_changed) { struct lv_segment *snap_seg; - struct list *snh, *snht; + struct dm_list *snh, *snht; struct logical_volume *cow; struct lv_list *lvl; struct lvinfo info; @@ -77,8 +77,8 @@ } /* Remove snapshot dependencies */ - list_iterate_safe(snh, snht, &lv->snapshot_segs) { - snap_seg = list_struct_base(snh, struct lv_segment, + dm_list_iterate_safe(snh, snht, &lv->snapshot_segs) { + snap_seg = dm_list_struct_base(snh, struct lv_segment, origin_list); cow = snap_seg->cow; @@ -120,7 +120,7 @@ return 0; } lvl->lv = lv; - list_add(lvs_changed, &lvl->list); + dm_list_add(lvs_changed, &lvl->list); } else { /* Remove LV immediately. */ log_verbose("Removing LV %s from VG %s", lv->name, lv->vg->name); @@ -137,7 +137,7 @@ struct lv_list *lvl; int r = 1; - list_iterate_items(lvl, &vg->lvs) + dm_list_iterate_items(lvl, &vg->lvs) if (lvl->lv->status & PARTIAL_LV) { log_warn("WARNING: Partial LV %s needs to be repaired " "or removed. ", lvl->lv->name); @@ -151,7 +151,7 @@ log_warn("Proceeding to remove empty missing PVs."); } - list_iterate_items(pvl, &vg->pvs) { + dm_list_iterate_items(pvl, &vg->pvs) { if (pvl->pv->dev && !(pvl->pv->status & MISSING_PV)) continue; if (r && !_remove_pv(vg, pvl, 0)) @@ -163,8 +163,8 @@ static int _make_vg_consistent(struct cmd_context *cmd, struct volume_group *vg) { - struct list *pvh, *pvht; - struct list *lvh, *lvht; + struct dm_list *pvh, *pvht; + struct dm_list *lvh, *lvht; struct pv_list *pvl; struct lv_list *lvl, *lvl2, *lvlt; struct logical_volume *lv; @@ -173,18 +173,18 @@ unsigned s; uint32_t mimages, remove_log; int list_unsafe, only_mirror_images_found; - LIST_INIT(lvs_changed); + DM_LIST_INIT(lvs_changed); only_mirror_images_found = 1; /* Deactivate & remove necessary LVs */ restart_loop: list_unsafe = 0; /* Set if we delete a different list-member */ - list_iterate_safe(lvh, lvht, &vg->lvs) { - lv = list_item(lvh, struct lv_list)->lv; + dm_list_iterate_safe(lvh, lvht, &vg->lvs) { + lv = dm_list_item(lvh, struct lv_list)->lv; /* Are any segments of this LV on missing PVs? */ - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_PV) continue; @@ -222,8 +222,8 @@ * up *after* the PVs are removed. All this should be gradually * superseded by lvconvert --repair. */ - list_iterate_safe(pvh, pvht, &vg->pvs) { - pvl = list_item(pvh, struct pv_list); + dm_list_iterate_safe(pvh, pvht, &vg->pvs) { + pvl = dm_list_item(pvh, struct pv_list); if (pvl->pv->dev) continue; if (!_remove_pv(vg, pvl, 0)) @@ -232,7 +232,7 @@ /* FIXME Recovery. For now people must clean up by hand. */ - if (!list_empty(&lvs_changed)) { + if (!dm_list_empty(&lvs_changed)) { if (!vg_write(vg)) { log_error("Failed to write out a consistent VG for %s", vg->name); @@ -264,7 +264,7 @@ lvs_changed_altered: /* Remove lost mirror images from mirrors */ - list_iterate_items(lvl, &vg->lvs) { + dm_list_iterate_items(lvl, &vg->lvs) { mirrored_seg_altered: mirrored_seg = first_seg(lvl->lv); if (!seg_is_mirrored(mirrored_seg)) @@ -274,11 +274,11 @@ remove_log = 0; for (s = 0; s < mirrored_seg->area_count; s++) { - list_iterate_items_safe(lvl2, lvlt, &lvs_changed) { + dm_list_iterate_items_safe(lvl2, lvlt, &lvs_changed) { if (seg_type(mirrored_seg, s) != AREA_LV || lvl2->lv != seg_lv(mirrored_seg, s)) continue; - list_del(&lvl2->list); + dm_list_del(&lvl2->list); if (!shift_mirror_images(mirrored_seg, s)) return_0; mimages--; /* FIXME Assumes uniqueness */ @@ -286,7 +286,7 @@ } if (mirrored_seg->log_lv) { - list_iterate_items(seg, &mirrored_seg->log_lv->segments) { + dm_list_iterate_items(seg, &mirrored_seg->log_lv->segments) { /* FIXME: The second test shouldn't be required */ if ((seg->segtype == get_segtype_from_string(vg->cmd, "error"))) { @@ -343,7 +343,7 @@ /* Deactivate error LVs */ if (!test_mode()) { - list_iterate_items_safe(lvl, lvlt, &lvs_changed) { + dm_list_iterate_items_safe(lvl, lvlt, &lvs_changed) { log_verbose("Deactivating (if active) logical volume %s", lvl->lv->name); @@ -356,13 +356,13 @@ * Don't try to lv_remove it. * Continue work on others. */ - list_del(&lvl->list); + dm_list_del(&lvl->list); } } } /* Remove remaining LVs */ - list_iterate_items(lvl, &lvs_changed) { + dm_list_iterate_items(lvl, &lvs_changed) { log_verbose("Removing LV %s from VG %s", lvl->lv->name, lvl->lv->vg->name); /* Skip LVs already removed by mirror code */ @@ -411,7 +411,7 @@ log_verbose("Removing \"%s\" from volume group \"%s\"", name, vg->name); if (pvl) - list_del(&pvl->list); + dm_list_del(&pvl->list); pv->vg_name = vg->fid->fmt->orphan_vg_name; pv->status = ALLOCATABLE_PV; --- LVM2/tools/vgrename.c 2008/06/06 16:13:35 1.54 +++ LVM2/tools/vgrename.c 2008/11/03 22:14:30 1.55 @@ -23,7 +23,7 @@ int consistent = 1; int match = 0; int found_id = 0; - struct list *vgids; + struct dm_list *vgids; struct str_list *sl; char *vg_name_new; const char *vgid = NULL, *vg_name, *vg_name_old; @@ -41,12 +41,12 @@ log_verbose("Checking for existing volume group \"%s\"", vg_name_old); /* Avoid duplicates */ - if (!(vgids = get_vgids(cmd, 0)) || list_empty(vgids)) { + if (!(vgids = get_vgids(cmd, 0)) || dm_list_empty(vgids)) { log_error("No complete volume groups found"); return 0; } - list_iterate_items(sl, vgids) { + dm_list_iterate_items(sl, vgids) { vgid = sl->str; if (!vgid || !(vg_name = vgname_from_vgid(NULL, vgid)) || is_orphan_vg(vg_name)) --- LVM2/tools/vgsplit.c 2008/04/23 14:33:06 1.67 +++ LVM2/tools/vgsplit.c 2008/11/03 22:14:30 1.68 @@ -28,7 +28,7 @@ return 0; } - list_move(&vg_to->pvs, &pvl->list); + dm_list_move(&vg_to->pvs, &pvl->list); vg_from->pv_count--; vg_to->pv_count++; @@ -60,7 +60,7 @@ return 0; } - list_iterate_items(lvseg, &lvl->lv->segments) { + dm_list_iterate_items(lvseg, &lvl->lv->segments) { if (lvseg->log_lv) if (!_move_pvs_used_by_lv(vg_from, vg_to, lvseg->log_lv->name)) @@ -86,7 +86,7 @@ { struct lv_list *lvl; - list_iterate_items(lvl, &vg->lvs) + dm_list_iterate_items(lvl, &vg->lvs) if (lv == lvl->lv) return 1; @@ -95,11 +95,11 @@ static int _move_one_lv(struct volume_group *vg_from, struct volume_group *vg_to, - struct list *lvh) + struct dm_list *lvh) { - struct logical_volume *lv = list_item(lvh, struct lv_list)->lv; + struct logical_volume *lv = dm_list_item(lvh, struct lv_list)->lv; - list_move(&vg_to->lvs, lvh); + dm_list_move(&vg_to->lvs, lvh); if (lv_is_active(lv)) { log_error("Logical volume \"%s\" must be inactive", lv->name); @@ -118,15 +118,15 @@ static int _move_lvs(struct volume_group *vg_from, struct volume_group *vg_to) { - struct list *lvh, *lvht; + struct dm_list *lvh, *lvht; struct logical_volume *lv; struct lv_segment *seg; struct physical_volume *pv; struct volume_group *vg_with; unsigned s; - list_iterate_safe(lvh, lvht, &vg_from->lvs) { - lv = list_item(lvh, struct lv_list)->lv; + dm_list_iterate_safe(lvh, lvht, &vg_from->lvs) { + lv = dm_list_item(lvh, struct lv_list)->lv; if ((lv->status & SNAPSHOT)) continue; @@ -137,7 +137,7 @@ /* Ensure all the PVs used by this LV remain in the same */ /* VG as each other */ vg_with = NULL; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { for (s = 0; s < seg->area_count; s++) { /* FIXME Check AREA_LV too */ if (seg_type(seg, s) != AREA_PV) @@ -189,19 +189,19 @@ static int _move_snapshots(struct volume_group *vg_from, struct volume_group *vg_to) { - struct list *lvh, *lvht; + struct dm_list *lvh, *lvht; struct logical_volume *lv; struct lv_segment *seg; int cow_from = 0; int origin_from = 0; - list_iterate_safe(lvh, lvht, &vg_from->lvs) { - lv = list_item(lvh, struct lv_list)->lv; + dm_list_iterate_safe(lvh, lvht, &vg_from->lvs) { + lv = dm_list_item(lvh, struct lv_list)->lv; if (!(lv->status & SNAPSHOT)) continue; - list_iterate_items(seg, &lv->segments) { + dm_list_iterate_items(seg, &lv->segments) { cow_from = _lv_is_in_vg(vg_from, seg->cow); origin_from = _lv_is_in_vg(vg_from, seg->origin); @@ -233,13 +233,13 @@ static int _move_mirrors(struct volume_group *vg_from, struct volume_group *vg_to) { - struct list *lvh, *lvht; + struct dm_list *lvh, *lvht; struct logical_volume *lv; struct lv_segment *seg; unsigned s, seg_in, log_in; - list_iterate_safe(lvh, lvht, &vg_from->lvs) { - lv = list_item(lvh, struct lv_list)->lv; + dm_list_iterate_safe(lvh, lvht, &vg_from->lvs) { + lv = dm_list_item(lvh, struct lv_list)->lv; if (!(lv->status & MIRRORED)) continue; From agk@sourceware.org Mon Nov 3 23:01:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 03 Nov 2008 23:01:00 -0000 Subject: LVM2 ./Makefile.in daemons/Makefile.in daemons ... Message-ID: <20081103230122.17509.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-03 23:01:21 Modified files: . : Makefile.in daemons : Makefile.in daemons/dmeventd: Makefile.in dmeventd.c libdevmapper-event.c Log message: more tweaks for dmeventd - not finished yet Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.26&r2=1.27 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/Makefile.in.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/Makefile.in.diff?cvsroot=lvm2&r1=1.20&r2=1.21 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/dmeventd.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/libdevmapper-event.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27 --- LVM2/Makefile.in 2008/11/03 22:14:26 1.26 +++ LVM2/Makefile.in 2008/11/03 23:01:21 1.27 @@ -47,8 +47,9 @@ po: tools daemons libdm.device-mapper: include.device-mapper +daemons.device-mapper: libdm.device-mapper tools.device-mapper: libdm.device-mapper -device-mapper: tools.device-mapper +device-mapper: tools.device-mapper daemons.device-mapper ifeq ("@INTL@", "yes") lib.pofile: include.pofile --- LVM2/daemons/Makefile.in 2008/10/31 22:29:44 1.4 +++ LVM2/daemons/Makefile.in 2008/11/03 23:01:21 1.5 @@ -20,8 +20,10 @@ endif ifeq ("@DMEVENTD@", "yes") - SUBDIRS += dmeventd/plugins + SUBDIRS += dmeventd endif +device-mapper: dmeventd + include $(top_srcdir)/make.tmpl --- LVM2/daemons/dmeventd/Makefile.in 2008/06/27 15:36:51 1.20 +++ LVM2/daemons/dmeventd/Makefile.in 2008/11/03 23:01:21 1.21 @@ -18,6 +18,7 @@ SOURCES = libdevmapper-event.c LIB_STATIC = libdevmapper-event.a +LIB_VERSION = $(LIB_VERSION_DM) ifeq ("@LIB_SUFFIX@","dylib") LIB_SHARED = libdevmapper-event.dylib @@ -29,7 +30,13 @@ TARGETS = dmeventd CLEAN_TARGETS = dmeventd.o -include ../make.tmpl +ifneq ($(MAKECMDGOALS),device-mapper) + SUBDIRS+=plugins +endif + +include $(top_srcdir)/make.tmpl + +all: dmeventd LDFLAGS += -ldl -ldevmapper -lpthread CLDFLAGS += -ldl -ldevmapper -lpthread --- LVM2/daemons/dmeventd/dmeventd.c 2008/11/03 22:14:26 1.52 +++ LVM2/daemons/dmeventd/dmeventd.c 2008/11/03 23:01:21 1.53 @@ -25,7 +25,7 @@ #include "list.h" #include "dmeventd.h" //#include "libmultilog.h" -#include "log.h" +#include "dm-logging.h" #include #include --- LVM2/daemons/dmeventd/libdevmapper-event.c 2007/11/27 12:26:06 1.26 +++ LVM2/daemons/dmeventd/libdevmapper-event.c 2008/11/03 23:01:21 1.27 @@ -12,7 +12,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "lib.h" +#include "dmlib.h" #include "libdevmapper-event.h" //#include "libmultilog.h" #include "dmeventd.h" From mornfall@sourceware.org Tue Nov 4 14:37:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Tue, 04 Nov 2008 14:37:00 -0000 Subject: LVM2/test Makefile.in Message-ID: <20081104143711.3589.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-04 14:37:11 Modified files: test : Makefile.in Log message: Use $(abs_top_builddir) instead of @DMDIR@ and update paths appropriately. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/Makefile.in.diff?cvsroot=lvm2&r1=1.12&r2=1.13 --- LVM2/test/Makefile.in 2008/09/29 16:07:02 1.12 +++ LVM2/test/Makefile.in 2008/11/04 14:37:10 1.13 @@ -57,14 +57,13 @@ for i in lvm $$(cat $(top_srcdir)/tools/.commands); do \ ln -s ../lvm-wrapper bin/$$i; \ done - test -n "@DMDIR@" && ln -s "@DMDIR@/dmsetup/dmsetup" bin/dmsetup + ln -s "$(abs_top_builddir)/tools/dmsetup" bin/dmsetup touch $@ lvm-wrapper: Makefile rm -f $@-t $@ echo '#!/bin/sh' > $@-t - test -n "@DMDIR@" \ - && echo 'export LD_LIBRARY_PATH="@DMDIR@/lib:@DMDIR@/dmeventd"' >> $@-t + echo 'export LD_LIBRARY_PATH="$(abs_top_builddir)/libdm:$(abs_top_builddir)/dmeventd"' >> $@-t echo 'cmd=$$(echo ./$$0|sed "s,.*/,,")' >> $@-t echo 'test "$$cmd" = lvm &&' >> $@-t echo 'exec "$(abs_top_builddir)/tools/lvm" "$$@"' >> $@-t From mornfall@sourceware.org Tue Nov 4 14:37:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Tue, 04 Nov 2008 14:37:00 -0000 Subject: LVM2/test harness.sh Message-ID: <20081104143753.7394.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-04 14:37:52 Modified files: test : harness.sh Log message: Also report the tests that have been skipped, at the end of harness.sh. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/harness.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5 --- LVM2/test/harness.sh 2008/10/06 16:55:29 1.4 +++ LVM2/test/harness.sh 2008/11/04 14:37:51 1.5 @@ -10,6 +10,7 @@ if test $ret = 0; then echo " passed." elif test $ret = 200; then + skipped="$skipped $t" echo " skipped." else echo " FAILED!" @@ -25,6 +26,10 @@ done if test -n "$failed"; then + echo "Tests skipped:" + for t in $skipped; do + printf "\t%s\n" $t + done echo "TESTS FAILED:" for t in $failed; do printf "\t%s\n" $t From mornfall@sourceware.org Tue Nov 4 14:38:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Tue, 04 Nov 2008 14:38:00 -0000 Subject: LVM2/test test-utils.sh Message-ID: <20081104143853.11918.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-04 14:38:53 Modified files: test : test-utils.sh Log message: Fix typo. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/test-utils.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5 --- LVM2/test/test-utils.sh 2008/10/14 19:48:01 1.4 +++ LVM2/test/test-utils.sh 2008/11/04 14:38:53 1.5 @@ -83,9 +83,10 @@ LOOP=$dev done done - test -n "LOOP" # confirm or fail + test -n "$LOOP" # confirm or fail + return 0 fi - exit 1 # should not be accesible + exit 1 # should not happen } prepare_devs() { From agk@sourceware.org Tue Nov 4 14:57:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 04 Nov 2008 14:57:00 -0000 Subject: LVM2 ./make.tmpl.in include/.symlinks lib/data ... Message-ID: <20081104145708.8778.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-04 14:57:07 Modified files: . : make.tmpl.in include : .symlinks lib/datastruct : lvm-types.h libdm : libdevmapper.h tools : tools.h Log message: more missing bits Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/make.tmpl.in.diff?cvsroot=lvm2&r1=1.60&r2=1.61 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/include/.symlinks.diff?cvsroot=lvm2&r1=1.53&r2=1.54 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/lvm-types.h.diff?cvsroot=lvm2&r1=1.15&r2=1.16 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.84&r2=1.85 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/tools.h.diff?cvsroot=lvm2&r1=1.62&r2=1.63 --- LVM2/make.tmpl.in 2008/11/03 22:14:26 1.60 +++ LVM2/make.tmpl.in 2008/11/04 14:57:05 1.61 @@ -86,6 +86,14 @@ LDFLAGS += -L$(top_srcdir)/libdm -L$(top_srcdir)/lib CLDFLAGS += -L$(top_srcdir)/libdm -L$(top_srcdir)/lib +ifeq ("@DM_COMPAT@", "yes") + DEFS += -DDM_COMPAT +endif + +ifeq ("@DM_IOCTLS@", "yes") + DEFS += -DDM_IOCTLS +endif + #DEFS += -DDEBUG_POOL #DEFS += -DBOUNDS_CHECK @@ -103,7 +111,7 @@ LIB_VERSION_DM := $(shell cat $(top_srcdir)/VERSION_DM | \ awk -F '.' '{printf "%s.%s",$$1,$$2}') -INCLUDES += -I$(top_srcdir)/include +INCLUDES += -I. -I$(top_srcdir)/include ifdef DESTDIR INCLUDES += -I$(DESTDIR)/usr/include --- LVM2/include/.symlinks 2008/11/03 18:59:58 1.53 +++ LVM2/include/.symlinks 2008/11/04 14:57:06 1.54 @@ -51,7 +51,6 @@ ../lib/report/report.h ../lib/uuid/uuid.h ../libdm/libdevmapper.h -../libdm/datastruct/list.h ../libdm/misc/dm-ioctl.h ../libdm/misc/dm-logging.h ../libdm/misc/dmlib.h --- LVM2/lib/datastruct/lvm-types.h 2008/11/03 22:14:27 1.15 +++ LVM2/lib/datastruct/lvm-types.h 2008/11/04 14:57:06 1.16 @@ -16,8 +16,6 @@ #ifndef _LVM_TYPES_H #define _LVM_TYPES_H -#include "list.h" - #include #include --- LVM2/libdm/libdevmapper.h 2008/09/02 12:16:07 1.84 +++ LVM2/libdm/libdevmapper.h 2008/11/04 14:57:06 1.85 @@ -615,6 +615,197 @@ for (v = dm_hash_get_first(h); v; \ v = dm_hash_get_next(h, v)) +/**************** + * list functions + ****************/ + +/* + * A list consists of a list head plus elements. + * Each element has 'next' and 'previous' pointers. + * The list head's pointers point to the first and the last element. + */ + +struct dm_list { + struct dm_list *n, *p; +}; + +/* + * Initialise a list before use. + * The list head's next and previous pointers point back to itself. + */ +#define DM_LIST_INIT(name) struct dm_list name = { &(name), &(name) } +void dm_list_init(struct dm_list *head); + +/* + * Insert an element before 'head'. + * If 'head' is the list head, this adds an element to the end of the list. + */ +void dm_list_add(struct dm_list *head, struct dm_list *elem); + +/* + * Insert an element after 'head'. + * If 'head' is the list head, this adds an element to the front of the list. + */ +void dm_list_add_h(struct dm_list *head, struct dm_list *elem); + +/* + * Delete an element from its list. + * Note that this doesn't change the element itself - it may still be safe + * to follow its pointers. + */ +void dm_list_del(struct dm_list *elem); + +/* + * Remove an element from existing list and insert before 'head'. + */ +void dm_list_move(struct dm_list *head, struct dm_list *elem); + +/* + * Is the list empty? + */ +int dm_list_empty(const struct dm_list *head); + +/* + * Is this the first element of the list? + */ +int dm_list_start(const struct dm_list *head, const struct dm_list *elem); + +/* + * Is this the last element of the list? + */ +int dm_list_end(const struct dm_list *head, const struct dm_list *elem); + +/* + * Return first element of the list or NULL if empty + */ +struct dm_list *dm_list_first(const struct dm_list *head); + +/* + * Return last element of the list or NULL if empty + */ +struct dm_list *dm_list_last(const struct dm_list *head); + +/* + * Return the previous element of the list, or NULL if we've reached the start. + */ +struct dm_list *dm_list_prev(const struct dm_list *head, const struct dm_list *elem); + +/* + * Return the next element of the list, or NULL if we've reached the end. + */ +struct dm_list *dm_list_next(const struct dm_list *head, const struct dm_list *elem); + +/* + * Given the address v of an instance of 'struct dm_list' called 'head' + * contained in a structure of type t, return the containing structure. + */ +#define dm_list_struct_base(v, t, head) \ + ((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->head)) + +/* + * Given the address v of an instance of 'struct dm_list list' contained in + * a structure of type t, return the containing structure. + */ +#define dm_list_item(v, t) dm_list_struct_base((v), t, list) + +/* + * Given the address v of one known element e in a known structure of type t, + * return another element f. + */ +#define dm_struct_field(v, t, e, f) \ + (((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->e))->f) + +/* + * Given the address v of a known element e in a known structure of type t, + * return the list head 'list' + */ +#define dm_list_head(v, t, e) dm_struct_field(v, t, e, list) + +/* + * Set v to each element of a list in turn. + */ +#define dm_list_iterate(v, head) \ + for (v = (head)->n; v != head; v = v->n) + +/* + * Set v to each element in a list in turn, starting from the element + * in front of 'start'. + * You can use this to 'unwind' a list_iterate and back out actions on + * already-processed elements. + * If 'start' is 'head' it walks the list backwards. + */ +#define dm_list_uniterate(v, head, start) \ + for (v = (start)->p; v != head; v = v->p) + +/* + * A safe way to walk a list and delete and free some elements along + * the way. + * t must be defined as a temporary variable of the same type as v. + */ +#define dm_list_iterate_safe(v, t, head) \ + for (v = (head)->n, t = v->n; v != head; v = t, t = v->n) + +/* + * Walk a list, setting 'v' in turn to the containing structure of each item. + * The containing structure should be the same type as 'v'. + * The 'struct dm_list' variable within the containing structure is 'field'. + */ +#define dm_list_iterate_items_gen(v, head, field) \ + for (v = dm_list_struct_base((head)->n, typeof(*v), field); \ + &v->field != (head); \ + v = dm_list_struct_base(v->field.n, typeof(*v), field)) + +/* + * Walk a list, setting 'v' in turn to the containing structure of each item. + * The containing structure should be the same type as 'v'. + * The list should be 'struct dm_list list' within the containing structure. + */ +#define dm_list_iterate_items(v, head) dm_list_iterate_items_gen(v, (head), list) + +/* + * Walk a list, setting 'v' in turn to the containing structure of each item. + * The containing structure should be the same type as 'v'. + * The 'struct dm_list' variable within the containing structure is 'field'. + * t must be defined as a temporary variable of the same type as v. + */ +#define dm_list_iterate_items_gen_safe(v, t, head, field) \ + for (v = dm_list_struct_base((head)->n, typeof(*v), field), \ + t = dm_list_struct_base(v->field.n, typeof(*v), field); \ + &v->field != (head); \ + v = t, t = dm_list_struct_base(v->field.n, typeof(*v), field)) +/* + * Walk a list, setting 'v' in turn to the containing structure of each item. + * The containing structure should be the same type as 'v'. + * The list should be 'struct dm_list list' within the containing structure. + * t must be defined as a temporary variable of the same type as v. + */ +#define dm_list_iterate_items_safe(v, t, head) \ + dm_list_iterate_items_gen_safe(v, t, (head), list) + +/* + * Walk a list backwards, setting 'v' in turn to the containing structure + * of each item. + * The containing structure should be the same type as 'v'. + * The 'struct dm_list' variable within the containing structure is 'field'. + */ +#define dm_list_iterate_back_items_gen(v, head, field) \ + for (v = dm_list_struct_base((head)->p, typeof(*v), field); \ + &v->field != (head); \ + v = dm_list_struct_base(v->field.p, typeof(*v), field)) + +/* + * Walk a list backwards, setting 'v' in turn to the containing structure + * of each item. + * The containing structure should be the same type as 'v'. + * The list should be 'struct dm_list list' within the containing structure. + */ +#define dm_list_iterate_back_items(v, head) list_iterate_back_items_gen(v, (head), list) + +/* + * Return the number of elements in a list by walking it. + */ +unsigned int dm_list_size(const struct dm_list *head); + /********* * selinux *********/ --- LVM2/tools/tools.h 2008/10/30 17:27:25 1.62 +++ LVM2/tools/tools.h 2008/11/04 14:57:06 1.63 @@ -39,7 +39,6 @@ #include "filter-persistent.h" #include "filter-regex.h" #include "metadata-exported.h" -#include "list.h" #include "locking.h" #include "lvm-exec.h" #include "lvm-file.h" From agk@sourceware.org Tue Nov 4 15:07:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 04 Nov 2008 15:07:00 -0000 Subject: LVM2 daemons/clvmd/clvmd-command.c daemons/clv ... Message-ID: <20081104150748.7570.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-04 15:07:45 Modified files: daemons/clvmd : clvmd-command.c clvmd-gulm.c clvmd-openais.c clvmd.c lvm-functions.c daemons/dmeventd: dmeventd.c lib/format_pool: disk_rep.c lib/locking : cluster_locking.c locking.c lib/metadata : pv_map.c lib/uuid : uuid.c libdm : libdevmapper.h libdm-common.c libdm-deptree.c libdm/datastruct: list.c Log message: more fixes Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-gulm.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-openais.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/dmeventd.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/uuid/uuid.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.85&r2=1.86 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/datastruct/list.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6 --- LVM2/daemons/clvmd/clvmd-command.c 2008/05/09 19:26:58 1.24 +++ LVM2/daemons/clvmd/clvmd-command.c 2008/11/04 15:07:44 1.25 @@ -67,7 +67,6 @@ #include #include -#include "list.h" #include "locking.h" #include "log.h" #include "lvm-functions.h" --- LVM2/daemons/clvmd/clvmd-gulm.c 2008/06/20 10:58:28 1.23 +++ LVM2/daemons/clvmd/clvmd-gulm.c 2008/11/04 15:07:44 1.24 @@ -44,7 +44,6 @@ #include #include -#include "list.h" #include "locking.h" #include "log.h" #include "clvm.h" --- LVM2/daemons/clvmd/clvmd-openais.c 2008/06/20 12:46:21 1.7 +++ LVM2/daemons/clvmd/clvmd-openais.c 2008/11/04 15:07:44 1.8 @@ -39,7 +39,6 @@ #include #include -#include "list.h" #include "locking.h" #include "log.h" #include "clvm.h" --- LVM2/daemons/clvmd/clvmd.c 2008/11/03 22:14:26 1.49 +++ LVM2/daemons/clvmd/clvmd.c 2008/11/04 15:07:44 1.50 @@ -46,7 +46,6 @@ #include "version.h" #include "clvmd.h" #include "refresh_clvmd.h" -#include "list.h" #include "log.h" #ifndef TRUE --- LVM2/daemons/clvmd/lvm-functions.c 2008/09/19 15:44:03 1.46 +++ LVM2/daemons/clvmd/lvm-functions.c 2008/11/04 15:07:44 1.47 @@ -33,7 +33,6 @@ #include #include -#include "list.h" #include "lvm-types.h" #include "clvm.h" #include "clvmd-comms.h" --- LVM2/daemons/dmeventd/dmeventd.c 2008/11/03 23:01:21 1.53 +++ LVM2/daemons/dmeventd/dmeventd.c 2008/11/04 15:07:44 1.54 @@ -22,7 +22,6 @@ #include "configure.h" #include "libdevmapper.h" #include "libdevmapper-event.h" -#include "list.h" #include "dmeventd.h" //#include "libmultilog.h" #include "dm-logging.h" --- LVM2/lib/format_pool/disk_rep.c 2008/11/03 22:14:28 1.14 +++ LVM2/lib/format_pool/disk_rep.c 2008/11/04 15:07:44 1.15 @@ -19,9 +19,10 @@ #include "lvmcache.h" #include "filter.h" #include "xlate.h" - #include "disk_rep.h" +#include + /* FIXME: memcpy might not be portable */ #define CPIN_8(x, y, z) {memcpy((x), (y), (z));} #define CPOUT_8(x, y, z) {memcpy((y), (x), (z));} --- LVM2/lib/locking/cluster_locking.c 2008/09/19 06:41:58 1.30 +++ LVM2/lib/locking/cluster_locking.c 2008/11/04 15:07:44 1.31 @@ -25,6 +25,7 @@ #include "locking.h" #include "locking_types.h" +#include #include #include #include --- LVM2/lib/locking/locking.c 2008/11/03 22:14:29 1.52 +++ LVM2/lib/locking/locking.c 2008/11/04 15:07:44 1.53 @@ -23,6 +23,7 @@ #include "defaults.h" #include "lvmcache.h" +#include #include #include #include --- LVM2/lib/metadata/pv_map.c 2008/11/03 22:14:29 1.32 +++ LVM2/lib/metadata/pv_map.c 2008/11/04 15:07:44 1.33 @@ -17,6 +17,8 @@ #include "pv_map.h" #include "pv_alloc.h" +#include + /* * Areas are maintained in size order, largest first. * --- LVM2/lib/uuid/uuid.c 2008/08/29 00:49:46 1.27 +++ LVM2/lib/uuid/uuid.c 2008/11/04 15:07:45 1.28 @@ -16,6 +16,7 @@ #include "lib.h" #include "uuid.h" +#include #include #include #include --- LVM2/libdm/libdevmapper.h 2008/11/04 14:57:06 1.85 +++ LVM2/libdm/libdevmapper.h 2008/11/04 15:07:45 1.86 @@ -799,7 +799,7 @@ * The containing structure should be the same type as 'v'. * The list should be 'struct dm_list list' within the containing structure. */ -#define dm_list_iterate_back_items(v, head) list_iterate_back_items_gen(v, (head), list) +#define dm_list_iterate_back_items(v, head) dm_list_iterate_back_items_gen(v, (head), list) /* * Return the number of elements in a list by walking it. --- LVM2/libdm/libdm-common.c 2008/11/03 22:14:29 1.62 +++ LVM2/libdm/libdm-common.c 2008/11/04 15:07:45 1.63 @@ -16,7 +16,6 @@ #include "dmlib.h" #include "libdm-targets.h" #include "libdm-common.h" -#include "list.h" #include "kdev_t.h" #include "dm-ioctl.h" --- LVM2/libdm/libdm-deptree.c 2008/11/03 22:14:29 1.46 +++ LVM2/libdm/libdm-deptree.c 2008/11/04 15:07:45 1.47 @@ -15,7 +15,6 @@ #include "dmlib.h" #include "libdm-targets.h" #include "libdm-common.h" -#include "list.h" #include "kdev_t.h" #include "dm-ioctl.h" --- LVM2/libdm/datastruct/list.c 2008/11/03 22:14:30 1.5 +++ LVM2/libdm/datastruct/list.c 2008/11/04 15:07:45 1.6 @@ -14,6 +14,7 @@ */ #include "lib.h" +#include /* * Initialise a list before use. From agk@sourceware.org Tue Nov 4 15:55:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 04 Nov 2008 15:55:00 -0000 Subject: LVM2 ./Makefile.in ./make.tmpl.in daemons/Make ... Message-ID: <20081104155530.4789.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-04 15:55:28 Modified files: . : Makefile.in make.tmpl.in daemons : Makefile.in daemons/dmeventd: Makefile.in Removed files: dmeventd : Makefile.in dmeventd/mirror: .exported_symbols Makefile.in dmeventd_mirror.c dmeventd/snapshot: .exported_symbols Makefile.in dmeventd_snapshot.c Log message: dmeventd Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.27&r2=1.28 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/make.tmpl.in.diff?cvsroot=lvm2&r1=1.61&r2=1.62 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/Makefile.in.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/Makefile.in.diff?cvsroot=lvm2&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/dmeventd/Makefile.in.diff?cvsroot=lvm2&r1=1.3&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/dmeventd/mirror/.exported_symbols.diff?cvsroot=lvm2&r1=1.1&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/dmeventd/mirror/Makefile.in.diff?cvsroot=lvm2&r1=1.7&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/dmeventd/mirror/dmeventd_mirror.c.diff?cvsroot=lvm2&r1=1.20&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/dmeventd/snapshot/.exported_symbols.diff?cvsroot=lvm2&r1=1.1&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/dmeventd/snapshot/Makefile.in.diff?cvsroot=lvm2&r1=1.3&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/dmeventd/snapshot/dmeventd_snapshot.c.diff?cvsroot=lvm2&r1=1.3&r2=NONE --- LVM2/Makefile.in 2008/11/03 23:01:21 1.27 +++ LVM2/Makefile.in 2008/11/04 15:55:26 1.28 @@ -43,13 +43,13 @@ libdm: include lib: libdm daemons: lib -tools: lib +tools: lib device-mapper po: tools daemons libdm.device-mapper: include.device-mapper daemons.device-mapper: libdm.device-mapper tools.device-mapper: libdm.device-mapper -device-mapper: tools.device-mapper daemons.device-mapper +device-mapper: tools.device-mapper daemons.device-mapper man.device-mapper ifeq ("@INTL@", "yes") lib.pofile: include.pofile --- LVM2/make.tmpl.in 2008/11/04 14:57:05 1.61 +++ LVM2/make.tmpl.in 2008/11/04 15:55:26 1.62 @@ -86,6 +86,11 @@ LDFLAGS += -L$(top_srcdir)/libdm -L$(top_srcdir)/lib CLDFLAGS += -L$(top_srcdir)/libdm -L$(top_srcdir)/lib +ifeq ("@DMEVENTD@", "yes") + LDFLAGS += -L$(top_srcdir)/daemons/dmeventd + CLDFLAGS += -L$(top_srcdir)/daemons/dmeventd +endif + ifeq ("@DM_COMPAT@", "yes") DEFS += -DDM_COMPAT endif --- LVM2/daemons/Makefile.in 2008/11/03 23:01:21 1.5 +++ LVM2/daemons/Makefile.in 2008/11/04 15:55:26 1.6 @@ -15,6 +15,8 @@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ +.PHONY: dmeventd clvmd + ifneq ("@CLVMD@", "none") SUBDIRS = clvmd endif @@ -23,7 +25,6 @@ SUBDIRS += dmeventd endif -device-mapper: dmeventd - include $(top_srcdir)/make.tmpl +device-mapper: dmeventd.device-mapper --- LVM2/daemons/dmeventd/Makefile.in 2008/11/03 23:01:21 1.21 +++ LVM2/daemons/dmeventd/Makefile.in 2008/11/04 15:55:27 1.22 @@ -37,6 +37,7 @@ include $(top_srcdir)/make.tmpl all: dmeventd +device-mapper: dmeventd LDFLAGS += -ldl -ldevmapper -lpthread CLDFLAGS += -ldl -ldevmapper -lpthread From agk@sourceware.org Tue Nov 4 16:41:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 04 Nov 2008 16:41:00 -0000 Subject: LVM2/daemons Makefile.in clvmd/clvmd-cman.c cl ... Message-ID: <20081104164150.17372.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-04 16:41:48 Modified files: daemons : Makefile.in daemons/clvmd : clvmd-cman.c clvmd-command.c clvmd-gulm.c clvmd-openais.c clvmd.c lvm-functions.c refresh_clvmd.c tcp-comms.c Log message: clvmd Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/Makefile.in.diff?cvsroot=lvm2&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-cman.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-gulm.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-openais.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.50&r2=1.51 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/refresh_clvmd.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/tcp-comms.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19 --- LVM2/daemons/Makefile.in 2008/11/04 15:55:26 1.6 +++ LVM2/daemons/Makefile.in 2008/11/04 16:41:47 1.7 @@ -27,4 +27,6 @@ include $(top_srcdir)/make.tmpl +ifeq ("@DMEVENTD@", "yes") device-mapper: dmeventd.device-mapper +endif --- LVM2/daemons/clvmd/clvmd-cman.c 2008/05/09 07:20:04 1.23 +++ LVM2/daemons/clvmd/clvmd-cman.c 2008/11/04 16:41:47 1.24 @@ -17,6 +17,10 @@ * CMAN communication layer for clvmd. */ +#define _GNU_SOURCE +#define _FILE_OFFSET_BITS 64 + +#include #include #include #include @@ -41,7 +45,7 @@ #include "clvmd-comms.h" #include "clvm.h" -#include "log.h" +#include "lvm-logging.h" #include "clvmd.h" #include "lvm-functions.h" --- LVM2/daemons/clvmd/clvmd-command.c 2008/11/04 15:07:44 1.25 +++ LVM2/daemons/clvmd/clvmd-command.c 2008/11/04 16:41:47 1.26 @@ -50,6 +50,10 @@ */ +#define _GNU_SOURCE +#define _FILE_OFFSET_BITS 64 + +#include #include #include #include @@ -68,7 +72,7 @@ #include #include "locking.h" -#include "log.h" +#include "lvm-logging.h" #include "lvm-functions.h" #include "clvmd-comms.h" #include "clvm.h" --- LVM2/daemons/clvmd/clvmd-gulm.c 2008/11/04 15:07:44 1.24 +++ LVM2/daemons/clvmd/clvmd-gulm.c 2008/11/04 16:41:47 1.25 @@ -45,7 +45,7 @@ #include #include "locking.h" -#include "log.h" +#include "lvm-logging.h" #include "clvm.h" #include "clvmd-comms.h" #include "lvm-functions.h" --- LVM2/daemons/clvmd/clvmd-openais.c 2008/11/04 15:07:44 1.8 +++ LVM2/daemons/clvmd/clvmd-openais.c 2008/11/04 16:41:47 1.9 @@ -11,6 +11,10 @@ * */ +#define _GNU_SOURCE +#define _FILE_OFFSET_BITS 64 + +#include #include #include #include @@ -40,7 +44,7 @@ #include #include "locking.h" -#include "log.h" +#include "lvm-logging.h" #include "clvm.h" #include "clvmd-comms.h" #include "lvm-functions.h" --- LVM2/daemons/clvmd/clvmd.c 2008/11/04 15:07:44 1.50 +++ LVM2/daemons/clvmd/clvmd.c 2008/11/04 16:41:47 1.51 @@ -17,6 +17,12 @@ * CLVMD: Cluster LVM daemon */ +#define _GNU_SOURCE +#define _FILE_OFFSET_BITS 64 + +#include +#include + #include #include #include @@ -46,7 +52,7 @@ #include "version.h" #include "clvmd.h" #include "refresh_clvmd.h" -#include "log.h" +#include "lvm-logging.h" #ifndef TRUE #define TRUE 1 --- LVM2/daemons/clvmd/lvm-functions.c 2008/11/04 15:07:44 1.47 +++ LVM2/daemons/clvmd/lvm-functions.c 2008/11/04 16:41:47 1.48 @@ -13,6 +13,10 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define _GNU_SOURCE +#define _FILE_OFFSET_BITS 64 + +#include #include #include #include @@ -42,7 +46,8 @@ /* LVM2 headers */ #include "toolcontext.h" #include "lvmcache.h" -#include "log.h" +#include "lvm-logging.h" +#include "lvm-globals.h" #include "activate.h" #include "locking.h" #include "archiver.h" --- LVM2/daemons/clvmd/refresh_clvmd.c 2008/03/06 08:41:05 1.5 +++ LVM2/daemons/clvmd/refresh_clvmd.c 2008/11/04 16:41:47 1.6 @@ -18,6 +18,10 @@ * */ +#define _GNU_SOURCE +#define _FILE_OFFSET_BITS 64 + +#include #include #include #include --- LVM2/daemons/clvmd/tcp-comms.c 2007/07/24 15:35:11 1.18 +++ LVM2/daemons/clvmd/tcp-comms.c 2008/11/04 16:41:47 1.19 @@ -13,7 +13,10 @@ It can also make outgoing connnections to the other clvmd nodes. */ +#define _GNU_SOURCE +#define _FILE_OFFSET_BITS 64 +#include #include #include #include From agk@sourceware.org Tue Nov 4 17:25:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 04 Nov 2008 17:25:00 -0000 Subject: LVM2 ./make.tmpl.in daemons/dmeventd/Makefile. ... Message-ID: <20081104172534.19712.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-04 17:25:33 Modified files: . : make.tmpl.in daemons/dmeventd: Makefile.in include : Makefile.in libdm : Makefile.in man : Makefile.in tools : Makefile.in Log message: make install_device-mapper Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/make.tmpl.in.diff?cvsroot=lvm2&r1=1.62&r2=1.63 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/Makefile.in.diff?cvsroot=lvm2&r1=1.22&r2=1.23 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/include/Makefile.in.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/Makefile.in.diff?cvsroot=lvm2&r1=1.41&r2=1.42 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/Makefile.in.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/Makefile.in.diff?cvsroot=lvm2&r1=1.87&r2=1.88 --- LVM2/make.tmpl.in 2008/11/04 15:55:26 1.62 +++ LVM2/make.tmpl.in 2008/11/04 17:25:32 1.63 @@ -129,7 +129,8 @@ OBJECTS = $(SOURCES:%.c=%.o) POTFILES = $(SOURCES:%.c=%.pot) -.PHONY: all install install_cluster pofile distclean clean cflow device-mapper +.PHONY: all install install_cluster pofile distclean clean cflow device-mapper +.PHONY: install_device-mapper .PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean) .PHONY: $(SUBDIRS.pofile) $(SUBDIRS.install_cluster) $(SUBDIRS.cflow) .PHONY: $(SUBDIRS.device-mapper) $(SUBDIRS.install-device-mapper) @@ -163,7 +164,7 @@ $(SUBDIRS.install_cluster): $(SUBDIRS) $(MAKE) -C $(@:.install_cluster=) install_cluster -$(SUBDIRS.install_device-mapper): $(SUBDIRS) +$(SUBDIRS.install_device-mapper): device-mapper $(MAKE) -C $(@:.install_device-mapper=) install_device-mapper $(SUBDIRS.clean): --- LVM2/daemons/dmeventd/Makefile.in 2008/11/04 15:55:27 1.22 +++ LVM2/daemons/dmeventd/Makefile.in 2008/11/04 17:25:32 1.23 @@ -61,6 +61,8 @@ install: $(INSTALL_TYPE) install_include install_dmeventd +install_device-mapper: install + install_include: $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper-event.h \ $(includedir)/libdevmapper-event.h --- LVM2/include/Makefile.in 2008/11/01 02:19:17 1.9 +++ LVM2/include/Makefile.in 2008/11/04 17:25:32 1.10 @@ -20,7 +20,7 @@ LN_S = @LN_S@ -.PHONY: clean distclean all install pofile install_cluster +.PHONY: clean distclean all install pofile install_cluster install_device-mapper all: .symlinks_created @@ -43,5 +43,7 @@ install_cluster: +install_device-mapper: + cflow: --- LVM2/libdm/Makefile.in 2008/11/03 22:14:29 1.41 +++ LVM2/libdm/Makefile.in 2008/11/04 17:25:32 1.42 @@ -67,6 +67,8 @@ install: $(INSTALL_TYPE) install_include +install_device-mapper: install + install_include: $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper.h \ $(includedir)/libdevmapper.h --- LVM2/man/Makefile.in 2008/11/01 02:19:18 1.24 +++ LVM2/man/Makefile.in 2008/11/04 17:25:32 1.25 @@ -32,10 +32,11 @@ vgimport.8 vgmerge.8 vgmknodes.8 vgreduce.8 vgremove.8 vgrename.8 \ vgs.8 vgscan.8 vgsplit.8 $(FSADMMAN) MAN8CLUSTER=clvmd.8 +MAN8DM=dmsetup.8 MAN5DIR=${mandir}/man5 MAN8DIR=${mandir}/man8 -CLEAN_TARGETS=$(MAN5) $(MAN8) $(MAN8CLUSTER) $(FSADMMAN) dmsetup.8 +CLEAN_TARGETS=$(MAN5) $(MAN8) $(MAN8CLUSTER) $(FSADMMAN) $(MAN8DM) include $(top_srcdir)/make.tmpl @@ -47,7 +48,7 @@ .PHONY: man -device-mapper: dmsetup.8 +device-mapper: $(MAN8DM) man: $(MAN5) $(MAN8) $(MAN8CLUSTER) @@ -56,7 +57,7 @@ %: %.in $(SED) -e "s/#VERSION#/$(LVM_VERSION)/" $< > $@ -install: +install: install_device-mapper @echo "Installing $(MAN8) in $(MAN8DIR)" @for f in $(MAN8); \ do \ @@ -78,3 +79,11 @@ $(RM) $(MAN8DIR)/$$f; \ @INSTALL@ -D $(OWNER) $(GROUP) -m 444 $$f $(MAN8DIR)/$$f; \ done + +install_device-mapper: + @echo "Installing $(MAN8DM) in $(MAN8DIR)" + @for f in $(MAN8DM); \ + do \ + $(RM) $(MAN8DIR)/$$f; \ + @INSTALL@ -D $(OWNER) $(GROUP) -m 444 $$f $(MAN8DIR)/$$f; \ + done --- LVM2/tools/Makefile.in 2008/11/03 22:14:30 1.87 +++ LVM2/tools/Makefile.in 2008/11/04 17:25:32 1.88 @@ -66,12 +66,14 @@ .commands \ lvm -INSTALL_TARGETS = install_tools_dynamic +INSTALL_LVM_TARGETS = install_tools_dynamic +INSTALL_DMSETUP_TARGETS = install_dmsetup_dynamic INSTALL_CMDLIB_TARGETS = install_cmdlib_dynamic ifeq ("@STATIC_LINK@", "yes") TARGETS += lvm.static - INSTALL_TARGETS += install_tools_static + INSTALL_LVM_TARGETS += install_tools_static + INSTALL_DMSETUP_TARGETS += install_dmsetup_static INSTALL_CMDLIB_TARGETS += install_cmdlib_static endif @@ -84,7 +86,7 @@ ifeq ("@CMDLIB@", "yes") TARGETS += liblvm2cmd.so - INSTALL_TARGETS += $(INSTALL_CMDLIB_TARGETS) + INSTALL_LVM_TARGETS += $(INSTALL_CMDLIB_TARGETS) endif ifeq ("@DMEVENTD@", "yes") @@ -182,4 +184,12 @@ $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) lvm.static \ $(staticdir)/lvm.static -install: $(INSTALL_TARGETS) +install_dmsetup_dynamic: dmsetup + $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$< + +install_dmsetup_static: dmsetup.static + $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$< + +install_device-mapper: $(INSTALL_DMSETUP_TARGETS) + +install: $(INSTALL_LVM_TARGETS) install_device-mapper From agk@sourceware.org Tue Nov 4 17:49:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 04 Nov 2008 17:49:00 -0000 Subject: LVM2 INSTALL README CONTRIBUTORS Message-ID: <20081104174922.20892.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-04 17:49:22 Modified files: . : INSTALL README Removed files: . : CONTRIBUTORS Log message: quick review of docs Note that we'll continue to use WHATS_NEW_DM for device-mapper changes until we can switch to unified version numbering. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/INSTALL.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/README.diff?cvsroot=lvm2&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/CONTRIBUTORS.diff?cvsroot=lvm2&r1=1.1&r2=NONE --- LVM2/INSTALL 2002/11/18 13:52:12 1.3 +++ LVM2/INSTALL 2008/11/04 17:49:22 1.4 @@ -1,44 +1,30 @@ -LVM2 installation -================= +Installation +============ -1) Install device-mapper - - Ensure the device-mapper has been installed on the machine. - - The device-mapper should be in the kernel (look for 'device-mapper' - messages in the kernel logs) and /usr/include/libdevmapper.h - and libdevmapper.so should be present. - - The device-mapper is available from: - ftp://ftp.sistina.com/pub/LVM2/device-mapper/ - - -2) Generate custom makefiles. +1) Generate custom makefiles. Run the 'configure' script from the top directory. - If you wish to use the built-in LVM2 shell and have GNU readline - installed (http://www.gnu.org/directory/readline.html) use: - ./configure --enable-readline - If you don't want to include the LVM1 backwards-compatibility code use: ./configure --with-lvm1=none To separate the LVM1 support into a shared library loaded by lvm.conf use: ./configure --with-lvm1=shared + Use ./configure --help to see other options. -3) Build and install LVM2. +2) Build and install. - Run 'make install' from the top directory. + Run 'make' from the top directory to build everything you configured. + Run 'make install' to build and install everything you configured. + If you only want the device-mapper libraries and tools use + 'make device-mapper' or 'make install_device-mapper'. -4) Create a configuration file +3) If using LVM2, create a configuration file. The tools will work fine without a configuration file being present, but you ought to review the example file in doc/example.conf. - For example, specifying the devices that LVM2 is to use can - make the tools run more efficiently - and avoid scanning /dev/cdrom! Please also refer to the WHATS_NEW file and the manual pages for the individual commands. --- LVM2/README 2004/07/03 18:20:25 1.7 +++ LVM2/README 2008/11/04 17:49:22 1.8 @@ -1,23 +1,27 @@ -This directory contains LVM2, the new version of the userland LVM -tools designed for the new device-mapper for the Linux kernel. +This tree contains the LVM2 and device-mapper tools and libraries. -The device-mapper needs to be installed before compiling these LVM2 tools. - -For more information about LVM2 read the WHATS_NEW file. +For more information about LVM2 read the changelog in the WHATS_NEW file. Installation instructions are in INSTALL. There is no warranty - see COPYING and COPYING.LIB. Tarballs are available from: ftp://sources.redhat.com/pub/lvm2/ - ftp://sources.redhat.com/pub/dm/ To access the CVS tree use: cvs -d :pserver:cvs@sources.redhat.com:/cvs/lvm2 login CVS password: cvs cvs -d :pserver:cvs@sources.redhat.com:/cvs/lvm2 co LVM2 -Mailing list for discussion/bug reports etc. +Mailing list for general discussion related to LVM2: linux-lvm@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm +Mailing list for LVM2 development, patches and commits: + lvm-devel@redhat.com + Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm + +Mailing list for device-mapper development, including kernel patches +and multipath-tools: + dm-devel@redhat.com + Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel From mornfall@sourceware.org Fri Nov 7 01:30:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Fri, 07 Nov 2008 01:30:00 -0000 Subject: LVM2/test Makefile.in Message-ID: <20081107013004.9516.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-07 01:30:04 Modified files: test : Makefile.in Log message: Set LD_LIBRARY_PATH in init.sh, as it is required to run dmsetup now as well, which otherwise picks up the system version of libdevmapper, which is a pretty bad idea. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/Makefile.in.diff?cvsroot=lvm2&r1=1.13&r2=1.14 --- LVM2/test/Makefile.in 2008/11/04 14:37:10 1.13 +++ LVM2/test/Makefile.in 2008/11/07 01:30:03 1.14 @@ -34,6 +34,7 @@ echo 'abs_top_builddir=$(abs_top_builddir)' >> $@-t echo 'abs_top_srcdir=$(abs_top_builddir)' >> $@-t echo 'PATH=$(abs_top_builddir)/test/bin:$$PATH' >> $@-t + echo 'export LD_LIBRARY_PATH="$(abs_top_builddir)/libdm:$(abs_top_builddir)/dmeventd"' >> $@-t echo 'abs_srcdir=$(abs_srcdir)' >> $@-t echo 'abs_builddir=$(abs_builddir)' >> $@-t echo 'export PATH' >> $@-t @@ -63,7 +64,6 @@ lvm-wrapper: Makefile rm -f $@-t $@ echo '#!/bin/sh' > $@-t - echo 'export LD_LIBRARY_PATH="$(abs_top_builddir)/libdm:$(abs_top_builddir)/dmeventd"' >> $@-t echo 'cmd=$$(echo ./$$0|sed "s,.*/,,")' >> $@-t echo 'test "$$cmd" = lvm &&' >> $@-t echo 'exec "$(abs_top_builddir)/tools/lvm" "$$@"' >> $@-t From wysochanski@sourceware.org Fri Nov 7 19:02:00 2008 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Fri, 07 Nov 2008 19:02:00 -0000 Subject: LVM2 ./WHATS_NEW tools/vgdisplay.c Message-ID: <20081107190247.11990.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2008-11-07 19:02:47 Modified files: . : WHATS_NEW tools : vgdisplay.c Log message: Fix vgdisplay return code and exit status. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.990&r2=1.991 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgdisplay.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22 --- LVM2/WHATS_NEW 2008/11/03 18:59:58 1.990 +++ LVM2/WHATS_NEW 2008/11/07 19:02:47 1.991 @@ -1,5 +1,6 @@ Version 2.02.43 - =================================== + Fix vgdisplay return code and exit status. Move list.c into libdevmapper and rename functions. Rename a couple of variables that matched function names. Use simplified x.y.z version number in libdevmapper.pc. --- LVM2/tools/vgdisplay.c 2008/06/10 20:07:04 1.21 +++ LVM2/tools/vgdisplay.c 2008/11/07 19:02:47 1.22 @@ -98,8 +98,8 @@ } **********/ - process_each_vg(cmd, argc, argv, LCK_VG_READ, 0, NULL, - vgdisplay_single); + return process_each_vg(cmd, argc, argv, LCK_VG_READ, 0, NULL, + vgdisplay_single); /******** FIXME Need to count number processed Add this to process_each_vg if arg_count(cmd,activevolumegroups_ARG) ? @@ -112,6 +112,4 @@ return LVM_E_NO_VG; } ************/ - - return ECMD_PROCESSED; } From wysochanski@sourceware.org Fri Nov 7 19:23:00 2008 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Fri, 07 Nov 2008 19:23:00 -0000 Subject: LVM2 ./WHATS_NEW man/lvchange.8.in man/lvcreat ... Message-ID: <20081107192353.29450.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2008-11-07 19:23:52 Modified files: . : WHATS_NEW man : lvchange.8.in lvcreate.8.in Log message: Fix lvhange and lvcreate man pages to properly describe permissions option. James Youngman Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.991&r2=1.992 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvchange.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvcreate.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/WHATS_NEW 2008/11/07 19:02:47 1.991 +++ LVM2/WHATS_NEW 2008/11/07 19:23:52 1.992 @@ -1,5 +1,6 @@ Version 2.02.43 - =================================== + Fix lvchange and lvcreate man pages permissions option. Fix vgdisplay return code and exit status. Move list.c into libdevmapper and rename functions. Rename a couple of variables that matched function names. --- LVM2/man/lvchange.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvchange.8.in 2008/11/07 19:23:52 1.2 @@ -14,7 +14,7 @@ [\-\-monitor {y|n}] [\-M/\-\-persistent y/n] [\-\-minor minor] [\-P/\-\-partial] -[\-p/\-\-permission r/w] [\-r/\-\-readahead ReadAheadSectors|auto|none] +[\-p/\-\-permission r|rw] [\-r/\-\-readahead ReadAheadSectors|auto|none] [\-\-refresh] [\-t/\-\-test] [\-v/\-\-verbose] LogicalVolumePath [LogicalVolumePath...] @@ -69,7 +69,7 @@ .I \-M, \-\-persistent y/n Set to y to make the minor number specified persistent. .TP -.I \-p, \-\-permission r/w +.I \-p, \-\-permission r|rw Change access permission to read-only or read/write. .TP .I \-r, \-\-readahead ReadAheadSectors|auto|none --- LVM2/man/lvcreate.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvcreate.8.in 2008/11/07 19:23:52 1.2 @@ -14,7 +14,7 @@ [\-m/\-\-mirrors Mirrors [\-\-nosync] [\-\-mirrorlog {disk|core}] [\-\-corelog] [\-R/\-\-regionsize MirrorLogRegionSize]] [\-n/\-\-name LogicalVolumeName] -[\-p/\-\-permission r/rw] [\-r/\-\-readahead ReadAheadSectors|auto|none] +[\-p/\-\-permission r|rw] [\-r/\-\-readahead ReadAheadSectors|auto|none] [\-t/\-\-test] [\-v/\-\-verbose] [\-Z/\-\-zero y/n] VolumeGroupName [PhysicalVolumePath...] @@ -113,7 +113,7 @@ Without this option a default names of "lvol#" will be generated where # is the LVM internal number of the logical volume. .TP -.I \-p, \-\-permission r/w +.I \-p, \-\-permission r|rw Set access permissions to read only or read and write. .br Default is read and write. From mornfall@sourceware.org Mon Nov 10 12:32:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Mon, 10 Nov 2008 12:32:00 -0000 Subject: LVM2/test t-mirror-basic.sh t-mirror-lvconvert ... Message-ID: <20081110123201.26266.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-10 12:32:00 Modified files: test : t-mirror-basic.sh t-mirror-lvconvert.sh t-mirror-names.sh t-mirror-vgreduce-removemissing.sh t-pvmove-basic.sh Log message: Explicitly check after lvremove -ff vg that it did its job. By jstava. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-basic.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-lvconvert.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-names.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-vgreduce-removemissing.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvmove-basic.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3 --- LVM2/test/t-mirror-basic.sh 2008/10/14 19:41:12 1.4 +++ LVM2/test/t-mirror-basic.sh 2008/11/10 12:32:00 1.5 @@ -121,6 +121,10 @@ prepare_lvs_() { lvremove -ff $vg; + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi : } @@ -128,6 +132,10 @@ { lvs -a -o+devices $vg lvremove -ff $vg + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi } #COMM "check environment setup/cleanup" --- LVM2/test/t-mirror-lvconvert.sh 2008/09/30 17:47:34 1.5 +++ LVM2/test/t-mirror-lvconvert.sh 2008/11/10 12:32:00 1.6 @@ -111,12 +111,21 @@ prepare_lvs_() { lvremove -ff $vg + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi + : } check_and_cleanup_lvs_() { lvs -a -o+devices $vg lvremove -ff $vg + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi } prepare_lvs_ --- LVM2/test/t-mirror-names.sh 2008/10/06 16:47:07 1.2 +++ LVM2/test/t-mirror-names.sh 2008/11/10 12:32:00 1.3 @@ -57,13 +57,21 @@ # Common environment setup/cleanup for each sub testcases prepare_lvs_() { - lvremove -ff $vg; + lvremove -ff $vg + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi : } check_and_cleanup_lvs_() { lvs -a -o+devices $vg lvremove -ff $vg + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi } prepare_lvs_ --- LVM2/test/t-mirror-vgreduce-removemissing.sh 2008/10/14 19:41:12 1.4 +++ LVM2/test/t-mirror-vgreduce-removemissing.sh 2008/11/10 12:32:00 1.5 @@ -94,6 +94,10 @@ prepare_lvs_() { lvremove -ff $vg; + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi : } @@ -101,6 +105,10 @@ { lvs -a -o+devices $vg lvremove -ff $vg + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi } recover_vg_() --- LVM2/test/t-pvmove-basic.sh 2008/10/06 16:47:07 1.2 +++ LVM2/test/t-pvmove-basic.sh 2008/11/10 12:32:00 1.3 @@ -84,6 +84,11 @@ check_dev_sum_ $(lvdev_ $vg $lv3) lvs -a -o name $vg > out && ! grep ^pvmove out lvremove -ff $vg + if ! dmsetup table|not grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" && + return 1 + fi + : } #COMM "check environment setup/cleanup" From mornfall@sourceware.org Mon Nov 10 12:36:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Mon, 10 Nov 2008 12:36:00 -0000 Subject: LVM2/test test-utils.sh Message-ID: <20081110123623.28004.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-10 12:36:23 Modified files: test : test-utils.sh Log message: Use separate locking directory for each of the tests, as they never share a volume group, or physical devices for that matter. Hopefully fixes occasional test errors due to locking failures. Patch by jstava. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/test-utils.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6 --- LVM2/test/test-utils.sh 2008/11/04 14:38:53 1.5 +++ LVM2/test/test-utils.sh 2008/11/10 12:36:23 1.6 @@ -170,6 +170,7 @@ } global { library_dir = "$G_root_/lib" + locking_dir = "$G_root_/var/lock/lvm" } EOF } From mornfall@sourceware.org Mon Nov 10 12:37:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Mon, 10 Nov 2008 12:37:00 -0000 Subject: LVM2/test t-mirror-basic.sh Message-ID: <20081110123753.5404.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-10 12:37:53 Modified files: test : t-mirror-basic.sh Log message: bz429342 lvcreate --nosync bz192865 lvconvert logtype of an inactive mirror lv (both by jstava) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-basic.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6 --- LVM2/test/t-mirror-basic.sh 2008/11/10 12:32:00 1.5 +++ LVM2/test/t-mirror-basic.sh 2008/11/10 12:37:53 1.6 @@ -168,6 +168,13 @@ mirrorlog_is_on_ $vg/$lv1 $dev3 check_and_cleanup_lvs_ +#COMM "lvcreate --nosync is in 100% sync after creation (bz429342)" +prepare_lvs_ +lvcreate -l2 -m1 --nosync -n $lv1 $vg $dev1 $dev2 $dev3:0-1 2>out +grep "New mirror won't be synchronised." out +lvs -o copy_percent --noheadings $vg/$lv1 |grep 100.00 +check_and_cleanup_lvs_ + # --- # convert @@ -186,20 +193,25 @@ mimages_are_redundant_ $vg $lv1 check_and_cleanup_lvs_ +for status in active inactive; do +# bz192865 lvconvert log of an inactive mirror lv #COMM "convert from disklog to corelog" prepare_lvs_ lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1 -lvconvert --mirrorlog core $vg/$lv1 + test $status = "inactive" && lvchange -an $vg/$lv1 + yes | lvconvert --mirrorlog core $vg/$lv1 mimages_are_redundant_ $vg $lv1 check_and_cleanup_lvs_ #COMM "convert from corelog to disklog" prepare_lvs_ lvcreate -l2 -m1 --mirrorlog core -n $lv1 $vg $dev1 $dev2 + test $status = "inactive" && lvchange -an $vg/$lv1 lvconvert --mirrorlog disk $vg/$lv1 $dev3:0-1 mimages_are_redundant_ $vg $lv1 mirrorlog_is_on_ $vg/$lv1 $dev3 check_and_cleanup_lvs_ +done # --- # resize From mornfall@sourceware.org Mon Nov 10 12:37:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Mon, 10 Nov 2008 12:37:00 -0000 Subject: LVM2/test t-lvcreate-usage.sh Message-ID: <20081110123704.486.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-10 12:37:03 Modified files: test : t-lvcreate-usage.sh Log message: Add bz186013 check -- lvcreate rejects an invalid regionsize (jstava). Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvcreate-usage.sh.diff?cvsroot=lvm2&r1=1.8&r2=1.9 --- LVM2/test/t-lvcreate-usage.sh 2008/09/30 17:50:56 1.8 +++ LVM2/test/t-lvcreate-usage.sh 2008/11/10 12:37:03 1.9 @@ -13,9 +13,11 @@ . ./test-utils.sh -aux prepare_vg 2 +aux prepare_pvs 2 +aux pvcreate --metadatacopies 0 $dev1 +vgcreate -cn $vg $devs -# "lvcreate rejects repeated invocation (run 2 times)" +# "lvcreate rejects repeated invocation (run 2 times) (bz178216)" lvcreate -n $lv -l 4 $vg not lvcreate -n $lv -l 4 $vg lvremove -ff $vg/$lv @@ -46,6 +48,10 @@ not lvcreate -L 64M -n $lv -i129 $vg 2>err grep "^ Number of stripes (129) must be between 1 and 128\$" err +# 'lvcreate rejects an invalid regionsize (bz186013)' +not lvcreate -L 64M -n $lv -R0 $vg 2>err +grep "Non-zero region size must be supplied." err + # The case on lvdisplay output is to verify that the LV was not created. # 'lvcreate rejects an invalid stripe size' not lvcreate -L 64M -n $lv -i2 --stripesize 3 $vg 2>err From agk@sourceware.org Mon Nov 10 12:39:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 10 Nov 2008 12:39:00 -0000 Subject: LVM2 VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Message-ID: <20081110123951.23618.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-10 12:39:51 Modified files: . : VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Log message: First test release of the merged code base. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION.diff?cvsroot=lvm2&r1=1.186&r2=1.187 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION_DM.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.992&r2=1.993 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.255&r2=1.256 --- LVM2/VERSION 2008/10/26 10:40:50 1.186 +++ LVM2/VERSION 2008/11/10 12:39:50 1.187 @@ -1 +1 @@ -2.02.43-cvs (2008-10-26) +2.02.43-cvs (2008-11-10) --- LVM2/VERSION_DM 2008/10/31 21:55:40 1.1 +++ LVM2/VERSION_DM 2008/11/10 12:39:50 1.2 @@ -1 +1 @@ -1.02.29-cvs (2008-09-18) +1.02.29-cvs (2008-11-10) --- LVM2/WHATS_NEW 2008/11/07 19:23:52 1.992 +++ LVM2/WHATS_NEW 2008/11/10 12:39:50 1.993 @@ -1,11 +1,11 @@ -Version 2.02.43 - -=================================== +Version 2.02.43 - 10th November 2008 +==================================== + Merge device-mapper into the lvm2 tree. Fix lvchange and lvcreate man pages permissions option. Fix vgdisplay return code and exit status. Move list.c into libdevmapper and rename functions. Rename a couple of variables that matched function names. Use simplified x.y.z version number in libdevmapper.pc. - Merge device-mapper into the lvm2 tree. Remove ancient debian directory. Split out lvm-logging.h from log.h and lvm-globals.[ch] from log.[ch]. --- LVM2/WHATS_NEW_DM 2008/10/30 17:24:03 1.255 +++ LVM2/WHATS_NEW_DM 2008/11/10 12:39:50 1.256 @@ -1,5 +1,6 @@ -Version 1.02.29 - -===================================== +Version 1.02.29 - 10th November 2008 +==================================== + Merge device-mapper into the LVM2 tree. Split out dm-logging.h from log.h. Use lvm-types.h. Add usrsbindir to configure. From mornfall@sourceware.org Mon Nov 10 12:41:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Mon, 10 Nov 2008 12:41:00 -0000 Subject: LVM2/test t-mirror-lvconvert.sh t-mirror-names ... Message-ID: <20081110124155.10288.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-10 12:41:52 Modified files: test : t-mirror-lvconvert.sh t-mirror-names.sh t-pvmove-basic.sh t-pvremove-usage.sh t-vgmerge-operation.sh Log message: add bz264241 check remove lvconvert progress notifications (-i100) (by jstava) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-lvconvert.sh.diff?cvsroot=lvm2&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-names.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvmove-basic.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvremove-usage.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgmerge-operation.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5 --- LVM2/test/t-mirror-lvconvert.sh 2008/11/10 12:32:00 1.6 +++ LVM2/test/t-mirror-lvconvert.sh 2008/11/10 12:41:52 1.7 @@ -193,7 +193,7 @@ lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1 check_mirror_count_ $vg/$lv1 2 check_mirror_log_ $vg/$lv1 -lvconvert -m+1 -b -i100 $vg/$lv1 $dev4 +lvconvert -m+1 -b $vg/$lv1 $dev4 lvconvert -m+1 -i3 $vg/$lv1 $dev5 check_no_tmplvs_ $vg/$lv1 check_mirror_count_ $vg/$lv1 4 @@ -240,7 +240,7 @@ lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1 check_mirror_count_ $vg/$lv1 2 check_mirror_log_ $vg/$lv1 -lvconvert -m+1 -b -i100 $vg/$lv1 $dev4 +lvconvert -m+1 -b $vg/$lv1 $dev4 lvconvert -m-1 $vg/$lv1 $dev4 wait_conversion_ $vg/$lv1 check_no_tmplvs_ $vg/$lv1 @@ -254,7 +254,7 @@ lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1 check_mirror_count_ $vg/$lv1 2 check_mirror_log_ $vg/$lv1 -lvconvert -m+2 -b -i100 $vg/$lv1 $dev4 $dev5 +lvconvert -m+2 -b $vg/$lv1 $dev4 $dev5 lvconvert -m-1 $vg/$lv1 $dev4 lvconvert -i1 $vg/$lv1 wait_conversion_ $vg/$lv1 @@ -269,7 +269,7 @@ lvcreate -l2 -m2 -n $lv1 $vg $dev1 $dev2 $dev5 $dev3:0-1 check_mirror_count_ $vg/$lv1 3 check_mirror_log_ $vg/$lv1 -lvconvert -m+1 -b -i100 $vg/$lv1 $dev4 +lvconvert -m+1 -b $vg/$lv1 $dev4 lvconvert -m-1 $vg/$lv1 $dev2 lvconvert -i1 $vg/$lv1 wait_conversion_ $vg/$lv1 @@ -284,7 +284,7 @@ lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1 check_mirror_count_ $vg/$lv1 2 check_mirror_log_ $vg/$lv1 -lvconvert -m+1 -b -i100 $vg/$lv1 $dev4 +lvconvert -m+1 -b $vg/$lv1 $dev4 lvconvert -m-1 $vg/$lv1 $dev2 lvconvert -i1 $vg/$lv1 wait_conversion_ $vg/$lv1 @@ -294,6 +294,8 @@ mirrorlog_is_on_ $vg/$lv1 $dev3 check_and_cleanup_lvs_ +# --------------------------------------------------------------------- + # "rhbz440405: lvconvert -m0 incorrectly fails if all PEs allocated" prepare_lvs_ lvcreate -l`pvs --noheadings -ope_count $dev1` -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0 @@ -304,5 +306,10 @@ check_mirror_count_ $vg/$lv1 1 check_and_cleanup_lvs_ -# --------------------------------------------------------------------- +# "rhbz264241: lvm mirror doesn't lose it's "M" --nosync attribute after being down and the up converted" +prepare_lvs_ +lvcreate -l2 -m1 -n$lv1 --nosync $vg +lvconvert -m0 $vg/$lv1 +lvconvert -m1 $vg/$lv1 +lvs --noheadings -o attr $vg/$lv1 | grep '^ *m' --- LVM2/test/t-mirror-names.sh 2008/11/10 12:32:00 1.3 +++ LVM2/test/t-mirror-names.sh 2008/11/10 12:41:52 1.4 @@ -90,7 +90,13 @@ #COMM "mirror log is ${lv1}_mlog" lv_mirror_log_ $vg/$lv1 "$lv1"_mlog -#COMM "cleanup" +# "cleanup" +check_and_cleanup_lvs_ + +#COMM "mirror with name longer than 22 characters (bz221322)" +name="LVwithanamelogerthan22characters_butidontwonttocounthem" +lvcreate -m1 -l2 -n"$name" $vg +lvs $vg/"$name" check_and_cleanup_lvs_ # --------------------------------------------------------------------- --- LVM2/test/t-pvmove-basic.sh 2008/11/10 12:32:00 1.3 +++ LVM2/test/t-pvmove-basic.sh 2008/11/10 12:41:52 1.4 @@ -362,3 +362,11 @@ pvmove --abort check_and_cleanup_lvs_ +#COMM "pvmove out of --metadatacopies 0 PV (bz252150)" +vgremove -ff $vg +pvcreate $devs +pvcreate --metadatacopies 0 $dev1 $dev2 +vgcreate $vg $devs +lvcreate -l4 -n $lv1 $vg $dev1 +pvmove $dev1 + --- LVM2/test/t-pvremove-usage.sh 2008/09/30 13:19:56 1.2 +++ LVM2/test/t-pvremove-usage.sh 2008/11/10 12:41:52 1.3 @@ -34,6 +34,10 @@ pvremove $dev3 pvscan | not grep $dev3 + # bz179473 refuse to wipe non-PV device without -f + not pvremove $dev3 + pvremove -f $dev3 + # reset setup vgremove -ff $vg pvcreate --metadatacopies $mdacp $dev1 --- LVM2/test/t-vgmerge-operation.sh 2008/10/06 16:47:07 1.4 +++ LVM2/test/t-vgmerge-operation.sh 2008/11/10 12:41:52 1.5 @@ -64,3 +64,18 @@ lvremove -f $vg2/$lv1 vgremove -f $vg2 +# 'vgmerge rejects LV name collision' +vgcreate $vg1 $dev1 $dev2 +vgcreate $vg2 $dev3 $dev4 +lvcreate -l 4 -n $lv1 $vg1 +lvcreate -l 4 -n $lv1 $vg2 +vgchange -an $vg1 +aux vg_validate_pvlv_counts_ $vg1 2 1 0 +aux vg_validate_pvlv_counts_ $vg2 2 1 0 +not vgmerge $vg2 $vg1 2>err +grep "Duplicate logical volume name \"$lv1\" in \"$vg2\" and \"$vg1" err +aux vg_validate_pvlv_counts_ $vg1 2 1 0 +aux vg_validate_pvlv_counts_ $vg2 2 1 0 +vgremove -f $vg1 +vgremove -f $vg2 + From mornfall@sourceware.org Mon Nov 10 12:43:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Mon, 10 Nov 2008 12:43:00 -0000 Subject: LVM2/test t-lvcreate-pvtags.sh t-pvcreate-oper ... Message-ID: <20081110124339.25695.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-10 12:43:35 Modified files: test : t-lvcreate-pvtags.sh t-pvcreate-operation.sh t-pvcreate-usage.sh t-read-ahead.sh t-unlost-pv.sh t-vgcreate-usage.sh t-vgreduce-usage.sh t-vgsplit-usage.sh Log message: Minor code and documentation cleanups and changes by jstava. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvcreate-pvtags.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation.sh.diff?cvsroot=lvm2&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-usage.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-read-ahead.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-unlost-pv.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgcreate-usage.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgreduce-usage.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgsplit-usage.sh.diff?cvsroot=lvm2&r1=1.11&r2=1.12 --- LVM2/test/t-lvcreate-pvtags.sh 2008/09/29 16:02:49 1.4 +++ LVM2/test/t-lvcreate-pvtags.sh 2008/11/10 12:43:35 1.5 @@ -11,6 +11,8 @@ . ./test-utils.sh aux prepare_pvs 3 +# not required, just testing +aux pvcreate --metadatacopies 0 $dev1 vgcreate $vg $devs pvchange --addtag fast $devs --- LVM2/test/t-pvcreate-operation.sh 2008/09/30 17:47:34 1.11 +++ LVM2/test/t-pvcreate-operation.sh 2008/11/10 12:43:35 1.12 @@ -15,7 +15,7 @@ for mdatype in 1 2 do -# pvcreate (lvm$mdatype) succeeds when run repeatedly (pv not in a vg) +# pvcreate (lvm$mdatype) succeeds when run repeatedly (pv not in a vg) (bz178216) pvcreate -M$mdatype $dev1 pvcreate -M$mdatype $dev1 pvremove -f $dev1 --- LVM2/test/t-pvcreate-usage.sh 2008/10/06 16:47:07 1.3 +++ LVM2/test/t-pvcreate-usage.sh 2008/11/10 12:43:35 1.4 @@ -31,7 +31,6 @@ # x. metadatasize too large # For some reason we allow this, even though there's no room for data? -#test_expect_success \ ##COMM 'pvcreate rejects metadatasize too large' #not pvcreate --metadatasize 100000000000000 $dev1 --- LVM2/test/t-read-ahead.sh 2008/10/06 16:47:07 1.3 +++ LVM2/test/t-read-ahead.sh 2008/11/10 12:43:35 1.4 @@ -19,7 +19,11 @@ get_lvs_() { - case $(lvs --units s --nosuffix --noheadings -o $1_read_ahead "$vg"/"$lv") in + lvs --units s --nosuffix --noheadings -o $1 "$vg"/"$lv" +} + +check_lvs_() { + case $(get_lvs_ $1) in *$2) true ;; *) false ;; esac @@ -27,13 +31,15 @@ aux prepare_vg 5 -#COMM "test various read ahead settings" +#COMM "test various read ahead settings (bz450922)" lvcreate -n "$lv" -l 100%FREE -i5 -I256 "$vg" +ra="$(get_lvs_ lv_kernel_read_ahead)" +test "$(( ( $ra / 5 ) * 5 ))" -eq $ra lvdisplay "$vg"/"$lv" lvchange -r auto "$vg"/"$lv" 2>&1 | grep auto -get_lvs_ lv auto -get_lvs_ lv_kernel 5120 +check_lvs_ lv_read_ahead auto +check_lvs_ lv_kernel_read_ahead 5120 lvchange -r 400 "$vg/$lv" -get_lvs_ lv 400 -vgremove -f "$vg" +check_lvs_ lv_read_ahead 400 +lvremove -ff "$vg" --- LVM2/test/t-unlost-pv.sh 2008/09/29 16:06:10 1.1 +++ LVM2/test/t-unlost-pv.sh 2008/11/10 12:43:35 1.2 @@ -1,3 +1,14 @@ +#!/bin/sh +# Copyright (C) 2008 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + . ./test-utils.sh aux prepare_vg 3 @@ -12,7 +23,7 @@ not grep "Inconsistent metadata found for VG $vg" vgscan.out } -# try orphaning a missing PV +# try orphaning a missing PV (bz45867) disable_dev $dev1 vgreduce --removemissing --force $vg enable_dev $dev1 --- LVM2/test/t-vgcreate-usage.sh 2008/10/06 16:47:07 1.5 +++ LVM2/test/t-vgcreate-usage.sh 2008/11/10 12:43:35 1.6 @@ -55,7 +55,7 @@ #not vgcreate $vg $dev1 $dev2 2>err #grep "New volume group name \"$vg\" is invalid\$" err -#COMM "vgcreate rejects repeated invocation (run 2 times)" +#COMM "vgcreate rejects repeated invocation (run 2 times) (bz178216)" vgcreate $vg $dev1 $dev2 not vgcreate $vg $dev1 $dev2 vgremove -ff $vg --- LVM2/test/t-vgreduce-usage.sh 2008/09/30 17:17:04 1.4 +++ LVM2/test/t-vgreduce-usage.sh 2008/11/10 12:43:35 1.5 @@ -43,43 +43,43 @@ pvcreate -M$mdatype $dev1 $dev2 pvcreate --metadatacopies 0 -M$mdatype $dev3 $dev4 -# (lvm$mdatype) vgreduce rejects removing pv with the last mda copy +# (lvm$mdatype) vgreduce rejects removing pv with the last mda copy (bz247448) vgcreate -M$mdatype $vg1 $dev1 $dev3 not vgreduce $vg1 $dev1 vgremove -f $vg1 +#COMM "(lvm$mdatype) vgreduce --removemissing --force repares to linear (bz221921)" # (lvm$mdatype) setup: create mirror & damage one pv vgcreate -M$mdatype $vg1 $dev1 $dev2 $dev3 lvcreate -n $lv1 -m1 -l 4 $vg1 lvcreate -n $lv2 -l 4 $vg1 $dev2 lvcreate -n $lv3 -l 4 $vg1 $dev3 vgchange -an $vg1 -pvcreate -ff -y $dev1 - +aux disable_dev $dev1 # (lvm$mdatype) vgreduce --removemissing --force repares to linear vgreduce --removemissing --force $vg1 check_lv_field_ $vg1/$lv1 segtype linear vg_validate_pvlv_counts_ $vg1 2 3 0 - +# cleanup +aux enable_dev $dev1 vgremove -ff $vg1 +#COMM "vgreduce rejects --removemissing --mirrorsonly --force when nonmirror lv lost too" # (lvm$mdatype) setup: create mirror + linear lvs -vgcreate -M$mdatype $vg1 $dev1 +vgcreate -M$mdatype $vg1 $devs lvcreate -n $lv2 -l 4 $vg1 -lvcreate -n $lv1 -l 4 $vg1 -vgextend $vg1 $dev2 $dev3 +lvcreate -m1 -n $lv1 -l 4 $vg1 $dev1 $dev2 $dev3 lvcreate -n $lv3 -l 4 $vg1 $dev3 -lvconvert -m1 $vg1/$lv1 - pvs --segments -o +lv_name # for record only - # (lvm$mdatype) setup: damage one pv -vgchange -an $vg1 && -pvcreate -ff -y $dev1 - +vgchange -an $vg1 +aux disable_dev $dev1 +#pvcreate -ff -y $dev1 # vgreduce rejects --removemissing --mirrorsonly --force when nonmirror lv lost too not vgreduce --removemissing --mirrorsonly --force $vg1 +aux enable_dev $dev1 + pvs -P # for record lvs -P # for record vgs -P # for record --- LVM2/test/t-vgsplit-usage.sh 2008/09/30 21:43:55 1.11 +++ LVM2/test/t-vgsplit-usage.sh 2008/11/10 12:43:35 1.12 @@ -25,6 +25,7 @@ pvcreate -M$mdatype $devs # vgsplit accepts new vg as destination of split +# lvm1 -- bz244792 vgcreate -M$mdatype $vg1 $devs vgsplit $vg1 $vg2 $dev1 1>err grep "New volume group \"$vg2\" successfully split from \"$vg1\"" err From mbroz@sourceware.org Mon Nov 10 13:41:00 2008 From: mbroz@sourceware.org (mbroz@sourceware.org) Date: Mon, 10 Nov 2008 13:41:00 -0000 Subject: LVM2/tools Makefile.in Message-ID: <20081110134144.3709.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mbroz@sourceware.org 2008-11-10 13:41:44 Modified files: tools : Makefile.in Log message: Fix lvm2.static build. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/Makefile.in.diff?cvsroot=lvm2&r1=1.88&r2=1.89 --- LVM2/tools/Makefile.in 2008/11/04 17:25:32 1.88 +++ LVM2/tools/Makefile.in 2008/11/10 13:41:43 1.89 @@ -119,7 +119,7 @@ LIB_PTHREAD = @LIB_PTHREAD@ lvm.static: $(OBJECTS) lvm-static.o $(top_srcdir)/lib/liblvm.a $(CC) -o $@ $(CFLAGS) $(OBJECTS) lvm-static.o -static \ - $(LDFLAGS) $(LVMLIBS) $(LIBS) $(LIB_PTHREAD) -rdynamic + -L$(interfacedir) $(LDFLAGS) $(LVMLIBS) $(LIBS) $(LIB_PTHREAD) -rdynamic liblvm2cmd.a: $(top_srcdir)/lib/liblvm.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o cat $(top_srcdir)/lib/liblvm.a > $@ From mornfall@sourceware.org Mon Nov 10 13:44:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Mon, 10 Nov 2008 13:44:00 -0000 Subject: LVM2/test t-pool-labels.sh Message-ID: <20081110134402.19357.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-10 13:44:01 Modified files: test : t-pool-labels.sh Log message: Fix t-pool-labels to pass again after the vgdisplay error return fix from last Friday. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pool-labels.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3 --- LVM2/test/t-pool-labels.sh 2008/09/29 16:02:49 1.2 +++ LVM2/test/t-pool-labels.sh 2008/11/10 13:44:01 1.3 @@ -31,7 +31,9 @@ not pvcreate "$dev1" # check that vgdisplay and pvcreate -ff works with the pool device -vgdisplay +vgdisplay --config 'global { locking_type = 0 }' disable_dev "$dev2" -vgdisplay +# FIXME! since pool1 cannot be opened, vgdisplay gives error... should we say +# "not" there instead, checking that it indeed does fail? +vgdisplay --config 'global { locking_type = 0 }' || true pvcreate -ff -y "$dev1" From mornfall@sourceware.org Mon Nov 10 14:04:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Mon, 10 Nov 2008 14:04:00 -0000 Subject: LVM2 Makefile.in Message-ID: <20081110140413.11889.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-10 14:04:12 Modified files: . : Makefile.in Log message: Include libdm in lcov reports. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.28&r2=1.29 --- LVM2/Makefile.in 2008/11/04 15:55:26 1.28 +++ LVM2/Makefile.in 2008/11/10 14:04:12 1.29 @@ -84,18 +84,21 @@ lcov-reset: $(LCOV) -d $(top_srcdir)/dmeventd --zerocounters + $(LCOV) -d $(top_srcdir)/libdm --zerocounters $(LCOV) -d $(top_srcdir)/lib --zerocounters $(LCOV) -d $(top_srcdir)/tools --zerocounters lcov: all $(RM) -rf $(LCOV_REPORTS_DIR) $(MKDIR_P) $(LCOV_REPORTS_DIR) + $(LCOV) -b ${top_srcdir}/libdm -d $(top_srcdir)/libdm -c -o $(LCOV_REPORTS_DIR)/libdm.info $(LCOV) -b $(top_srcdir)/lib -d $(top_srcdir)/lib -c -o $(LCOV_REPORTS_DIR)/lib.info $(LCOV) -b $(top_srcdir)/tools -d $(top_srcdir)/tools -c -o $(LCOV_REPORTS_DIR)/tools.info DMEVENTD_INFO="$(LCOV_REPORTS_DIR)/dmeventd.info" ;\ DMEVENTD_INFO_A="-a $$DMEVENTDINFO" ;\ $(LCOV) -b $(top_srcdir)/dmeventd -d $(top_srcdir)/dmeventd -c -o $$DMEVENTD_INFO || DMEVENTD_INFO_A="" ;\ $(LCOV) $$DMEVENTD_INFO_A -a $(LCOV_REPORTS_DIR)/lib.info \ + -a $(LCOV_REPORTS_DIR)/libdm.info \ -a $(LCOV_REPORTS_DIR)/tools.info \ -o $(LCOV_REPORTS_DIR)/lvm.info ifneq ("@GENHTML@", "") From agk@sourceware.org Mon Nov 10 21:25:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 10 Nov 2008 21:25:00 -0000 Subject: LVM2 ./configure ./configure.in lib/misc/confi ... Message-ID: <20081110212546.7691.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-10 21:25:45 Modified files: . : configure configure.in lib/misc : configure.h.in Log message: no need for libdevmapper.h on system any more Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.84&r2=1.85 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.88&r2=1.89 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/configure.h.in.diff?cvsroot=lvm2&r1=1.8&r2=1.9 --- LVM2/configure 2008/11/03 22:14:26 1.84 +++ LVM2/configure 2008/11/10 21:25:45 1.85 @@ -11389,151 +11389,6 @@ fi - -for ac_header in libdevmapper.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - { { echo "$as_me:$LINENO: error: bailing out" >&5 -echo "$as_me: error: bailing out" >&2;} - { (exit 1); exit 1; }; } -fi - -done - - if test x$HAVE_SELINUX = xyes; then for ac_header in selinux/selinux.h --- LVM2/configure.in 2008/11/03 22:14:26 1.88 +++ LVM2/configure.in 2008/11/10 21:25:45 1.89 @@ -666,8 +666,6 @@ AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out)) fi -AC_CHECK_HEADERS(libdevmapper.h,,AC_MSG_ERROR(bailing out)) - if test x$HAVE_SELINUX = xyes; then AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out)) fi --- LVM2/lib/misc/configure.h.in 2008/11/01 02:19:17 1.8 +++ LVM2/lib/misc/configure.h.in 2008/11/10 21:25:45 1.9 @@ -90,9 +90,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBDEVMAPPER_H - /* Define to 1 if dynamic libraries are available. */ #undef HAVE_LIBDL From agk@sourceware.org Mon Nov 10 21:26:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 10 Nov 2008 21:26:00 -0000 Subject: LVM2 WHATS_NEW Message-ID: <20081110212606.9845.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-10 21:26:06 Modified files: . : WHATS_NEW Log message: clarify Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.993&r2=1.994 --- LVM2/WHATS_NEW 2008/11/10 12:39:50 1.993 +++ LVM2/WHATS_NEW 2008/11/10 21:26:06 1.994 @@ -1,8 +1,8 @@ Version 2.02.43 - 10th November 2008 ==================================== Merge device-mapper into the lvm2 tree. - Fix lvchange and lvcreate man pages permissions option. - Fix vgdisplay return code and exit status. + Correct prototype for --permission on lvchange and lvcreate man pages. + Exit with non-zero status from vgdisplay if couldn't show any requested VG. Move list.c into libdevmapper and rename functions. Rename a couple of variables that matched function names. Use simplified x.y.z version number in libdevmapper.pc. From mornfall@sourceware.org Tue Nov 11 15:29:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Tue, 11 Nov 2008 15:29:00 -0000 Subject: LVM2/test t-listings.sh t-lvcreate-operation.s ... Message-ID: <20081111152925.17132.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-11 15:29:24 Added files: test : t-listings.sh t-lvcreate-operation.sh t-mirror-lvconvert-usage.sh t-vgcfgbackup-usage.sh t-vgchange-usage.sh Log message: Import a bunch of new tests by jstava. Mostly everything pass, they however tend to expose the lvremove -ff vg ordering bug. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-listings.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvcreate-operation.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-lvconvert-usage.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgcfgbackup-usage.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgchange-usage.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1 /cvs/lvm2/LVM2/test/t-listings.sh,v --> standard output revision 1.1 --- LVM2/test/t-listings.sh +++ - 2008-11-11 15:29:25.263969000 +0000 @@ -0,0 +1,79 @@ +# Copyright (C) 2008 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# +# tests functionality of lvs, pvs, vgs, *display tools +# + +. ./test-utils.sh + +get_lvs_() +{ + case $(lvs --units s --nosuffix --noheadings -o $1_read_ahead "$vg"/"$lv") in + *$2) true ;; + *) false ;; + esac +} + +aux prepare_devs 5 + +pvcreate $dev1 +pvcreate --metadatacopies 0 $dev2 +pvcreate --metadatacopies 0 $dev3 +pvcreate $dev4 +pvcreate --metadatacopies 0 $dev5 + +#COMM bz195276 -- pvs doesn't show PVs until a VG is created +pvs --noheadings|tee out +test $(wc -l out +pvdisplay --maps $devs >out2 +not diff out out2 + /cvs/lvm2/LVM2/test/t-lvcreate-operation.sh,v --> standard output revision 1.1 --- LVM2/test/t-lvcreate-operation.sh +++ - 2008-11-11 15:29:25.392211000 +0000 @@ -0,0 +1,33 @@ +#!/bin/sh +# Copyright (C) 2008 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# 'Exercise some lvcreate diagnostics' + +. ./test-utils.sh + +cleanup_lvs() { + lvremove -ff $vg + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi +} + +aux prepare_pvs 2 +aux pvcreate --metadatacopies 0 $dev1 +aux vgcreate $vg $devs + +#COMM create snapshots of LVs on --metadatacopies 0 PV (bz450651) +lvcreate -n$lv1 -l4 $vg $dev1 +lvcreate -n$lv2 -l4 -s $vg/$lv1 +#lvremove -f $vg/$lv2 +cleanup_lvs + /cvs/lvm2/LVM2/test/t-mirror-lvconvert-usage.sh,v --> standard output revision 1.1 --- LVM2/test/t-mirror-lvconvert-usage.sh +++ - 2008-11-11 15:29:25.520187000 +0000 @@ -0,0 +1,95 @@ +# Copyright (C) 2008 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +. ./test-utils.sh + +dmsetup_has_dm_devdir_support_ || exit 200 + +aux prepare_vg 5 + + +lv_is_on_() { + local lv=$1 #allready vg/lv + shift 1 + lvs -a -odevices --noheadings $lv | sed 's/,/\n/g' > out + #is on all specified devs + for d in $*; do grep "$d(" out; done + #isn't on any other dev (we are set -e remember) + for d in $*; do ! grep -v "$d(" out; done + return 0 +} + +mimages_are_on_ () +{ + local lv=$1 + shift + local pvs="$*" + local mimages + local i + + echo "Check if mirror images of $lv are on PVs $pvs" + rm -f out1 out2 + echo $pvs | sed 's/ /\n/g' | sort | uniq > out1 + + mimages=$(lvs --noheadings -a -o lv_name $vg | grep "${lv}_mimage_" | \ + sed 's/\[//g; s/\]//g') + for i in $mimages; do + echo "Checking $vg/$i" + lvs -a -odevices --noheadings $vg/$i | \ + sed 's/([^)]*)//g; s/ //g; s/,/ /g' | sort | uniq >> out2 + done + + diff --ignore-blank-lines out1 out2 +} + +# --------------------------------------------------------------------- +# Common environment setup/cleanup for each sub testcases + +prepare_lvs_() +{ + lvremove -ff $vg + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi + : +} + +check_and_cleanup_lvs_() +{ + lvs -a -o+devices $vg + lvremove -ff $vg + if dmsetup table|grep $vg; then + echo "ERROR: lvremove did leave some some mappings in DM behind!" + return 1 + fi +} + +prepare_lvs_ +check_and_cleanup_lvs_ + + +#COMM "convert from 2-way mirror to linear -- specify leg to remove (bz453643)" +prepare_lvs_ +lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1 +lvconvert -m0 $vg/$lv1 $dev2 +lv_is_on_ $vg/$lv1 $dev1 +check_and_cleanup_lvs_ + +prepare_lvs_ +lvcreate -l2 -m2 -n $lv1 $vg $dev1 $dev2 $dev4 $dev3:0-1 +lvconvert -m-1 $vg/$lv1 $dev1 +lvs -a -o+devices +mimages_are_on_ $lv1 $dev2 $dev4 +lvconvert -m-1 $vg/$lv1 $dev2 +lvs -a -o+devices +lv_is_on_ $vg/$lv1 $dev4 +check_and_cleanup_lvs_ + /cvs/lvm2/LVM2/test/t-vgcfgbackup-usage.sh,v --> standard output revision 1.1 --- LVM2/test/t-vgcfgbackup-usage.sh +++ - 2008-11-11 15:29:25.635297000 +0000 @@ -0,0 +1,24 @@ +#!/bin/sh +# Copyright (C) 2008 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +. ./test-utils.sh + +aux prepare_pvs 2 + +# vgcfgbackup handles similar VG names (bz458941) +vg1=${PREFIX}vg00 +vg1=${PREFIX}vg01 +vgcreate $vg1 $dev1 +vgcreate $vg2 $dev2 +vgcfgbackup -f /tmp/bak-%s >out +grep "Volume group \"$vg1\" successfully backed up." out +grep "Volume group \"$vg2\" successfully backed up." out + /cvs/lvm2/LVM2/test/t-vgchange-usage.sh,v --> standard output revision 1.1 --- LVM2/test/t-vgchange-usage.sh +++ - 2008-11-11 15:29:25.759506000 +0000 @@ -0,0 +1,51 @@ +#!/bin/sh +# Copyright (C) 2008 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +test_description='Exercise some vgchange diagnostics' + +. ./test-utils.sh + +aux prepare_pvs 3 +pvcreate --metadatacopies 0 $dev1 +vgcreate $vg $devs + +get_vg_field() { + local vg=$1 + local field=$2 + local value + vgs --noheading -o $field $vg | sed 's/^ *//' +} + +vgdisplay $vg + +# vgchange -p MaxPhysicalVolumes (bz202232) +aux check_vg_field_ $vg max_pv 0 +vgchange -p 128 $vg +aux check_vg_field_ $vg max_pv 128 + +pv_count=$(get_vg_field $vg pv_count) +not vgchange -p 2 $vg 2>err +grep "MaxPhysicalVolumes is less than the current number $pv_count of PVs for" err +aux check_vg_field_ $vg max_pv 128 + +# vgchange -l MaxLogicalVolumes +aux check_vg_field_ $vg max_lv 0 +vgchange -l 128 $vg +aux check_vg_field_ $vg max_lv 128 + +lvcreate -l4 -n$lv1 $vg +lvcreate -l4 -n$lv2 $vg + +lv_count=$(get_vg_field $vg lv_count) +not vgchange -l 1 $vg 2>err +grep "MaxLogicalVolume is less than the current number $lv_count of LVs for" err +aux check_vg_field_ $vg max_lv 128 + From mornfall@sourceware.org Tue Nov 11 15:46:00 2008 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Tue, 11 Nov 2008 15:46:00 -0000 Subject: LVM2/test t-metadata.sh t-lvextend-percent-ext ... Message-ID: <20081111154620.17843.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2008-11-11 15:46:19 Modified files: test : t-metadata.sh t-lvextend-percent-extents.sh t-pvcreate-operation.sh Log message: Add a bunch of sub-tests aimed at testing various bugzillas, by jstava. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-metadata.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvextend-percent-extents.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation.sh.diff?cvsroot=lvm2&r1=1.12&r2=1.13 --- LVM2/test/t-metadata.sh 2008/09/29 16:02:49 1.2 +++ LVM2/test/t-metadata.sh 2008/11/11 15:46:15 1.3 @@ -28,6 +28,26 @@ pvchange --uuid $dev2 vgremove -f $vg +# check that PVs without metadata don't cause too many full device rescans (bz452606) +for mdacp in 1 0; do + pvcreate --metadatacopies $mdacp $devs + pvcreate $dev1 + vgcreate $vg $devs + lvcreate -n $lv1 -l 2 -i5 -I256 $vg + lvcreate -n $lv2 -m2 -l 2 $vg + #lvchange -an $vg + lvchange -an $vg/$lv1 >out$mdacp 2>&1 + lvchange -an $vg/$lv2 >>out$mdacp 2>&1 + test ! -s out$mdacp + vgchange -ay $vg + lvchange -vvvv -an $vg/$lv1 >out$mdacp 2>&1 + lvchange -vvvv -an $vg/$lv2 >>out$mdacp 2>&1 + eval run$mdacp=$(wc -l err + grep "Can't open $dev1 exclusively. Mounted filesystem?" err + umount $dev1 + fi # pvcreate (lvm$mdatype) succeeds when run repeatedly (pv not in a vg) (bz178216) pvcreate -M$mdatype $dev1 From zkabelac@sourceware.org Wed Nov 12 09:30:00 2008 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Wed, 12 Nov 2008 09:30:00 -0000 Subject: LVM2/lib/locking file_locking.c Message-ID: <20081112093053.10947.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2008-11-12 09:30:53 Modified files: lib/locking : file_locking.c Log message: * minor compilator warning fix for improper function declaration. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.40&r2=1.41 --- LVM2/lib/locking/file_locking.c 2008/11/03 22:14:29 1.40 +++ LVM2/lib/locking/file_locking.c 2008/11/12 09:30:52 1.41 @@ -92,7 +92,7 @@ _release_lock(NULL, 0); } -static void _remove_ctrl_c_handler() +static void _remove_ctrl_c_handler(void) { siginterrupt(SIGINT, 0); if (!_handler_installed) From zkabelac@sourceware.org Wed Nov 12 09:41:00 2008 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Wed, 12 Nov 2008 09:41:00 -0000 Subject: LVM2/lib/misc lvm-globals.h Message-ID: <20081112094145.18337.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2008-11-12 09:41:45 Modified files: lib/misc : lvm-globals.h Log message: removed redundant redeclaration of init_indent() and init_msg_prefix() from lvm-logging.h Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-globals.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3 --- LVM2/lib/misc/lvm-globals.h 2008/11/03 18:59:58 1.2 +++ LVM2/lib/misc/lvm-globals.h 2008/11/12 09:41:44 1.3 @@ -27,8 +27,6 @@ void init_trust_cache(int trustcache); void init_debug(int level); void init_cmd_name(int status); -void init_msg_prefix(const char *prefix); -void init_indent(int indent); void init_ignorelockingfailure(int level); void init_lockingfailed(int level); void init_security_level(int level); From zkabelac@sourceware.org Wed Nov 12 09:49:00 2008 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Wed, 12 Nov 2008 09:49:00 -0000 Subject: LVM2/tools lvmcmdline.c Message-ID: <20081112094906.9121.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2008-11-12 09:49:06 Modified files: tools : lvmcmdline.c Log message: minor compiler warning fix for function declaration prototype Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.72&r2=1.73 --- LVM2/tools/lvmcmdline.c 2008/11/03 22:14:30 1.72 +++ LVM2/tools/lvmcmdline.c 2008/11/12 09:49:06 1.73 @@ -1210,7 +1210,7 @@ log_sys_error("execvp", path); } -static void _nonroot_warning() +static void _nonroot_warning(void) { if (getuid() || geteuid()) log_warn("WARNING: Running as a non-root user. Functionality may be unavailable."); From zkabelac@sourceware.org Wed Nov 12 09:53:00 2008 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Wed, 12 Nov 2008 09:53:00 -0000 Subject: LVM2 lib/misc/last-path-component.h tools/lvmc ... Message-ID: <20081112095334.15933.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2008-11-12 09:53:33 Modified files: lib/misc : last-path-component.h tools : lvmcmdline.c Log message: cleaner const char* usage for last_path_component() Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/last-path-component.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.73&r2=1.74 --- LVM2/lib/misc/last-path-component.h 2008/07/31 15:38:51 1.2 +++ LVM2/lib/misc/last-path-component.h 2008/11/12 09:53:33 1.3 @@ -19,10 +19,9 @@ #include -static inline char *last_path_component(char const *name) +static inline const char *last_path_component(char const *name) { char const *slash = strrchr(name, '/'); - char const *res = slash ? slash + 1 : name; - return (char *)res; + return (slash) ? slash + 1 : name; } --- LVM2/tools/lvmcmdline.c 2008/11/12 09:49:06 1.73 +++ LVM2/tools/lvmcmdline.c 2008/11/12 09:53:33 1.74 @@ -483,7 +483,7 @@ static struct command *_find_command(const char *name) { int i; - char *base; + const char *base; base = last_path_component(name); From wysochanski@sourceware.org Wed Nov 12 15:01:00 2008 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Wed, 12 Nov 2008 15:01:00 -0000 Subject: LVM2 ./WHATS_NEW man/lvchange.8.in man/lvconve ... Message-ID: <20081112150140.18645.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2008-11-12 15:01:36 Modified files: . : WHATS_NEW man : lvchange.8.in lvconvert.8.in lvcreate.8.in lvdisplay.8.in lvextend.8.in lvmdiskscan.8.in lvreduce.8.in lvremove.8.in lvresize.8.in lvs.8.in pvchange.8.in pvcreate.8.in pvdisplay.8.in pvmove.8.in pvs.8.in vgck.8.in vgexport.8.in vgextend.8.in vgimport.8.in vgmerge.8.in vgmknodes.8.in vgreduce.8.in vgremove.8.in vgrename.8.in vgs.8.in vgscan.8.in Log message: Make man pages consistent with either-or options (use "|" everywhere). Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.994&r2=1.995 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvchange.8.in.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvconvert.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvcreate.8.in.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvdisplay.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvextend.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvmdiskscan.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvreduce.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvremove.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvresize.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvs.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvchange.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvcreate.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvdisplay.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvmove.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvs.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgck.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgexport.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgextend.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgimport.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgmerge.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgmknodes.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgreduce.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgremove.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgrename.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgs.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgscan.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/WHATS_NEW 2008/11/10 21:26:06 1.994 +++ LVM2/WHATS_NEW 2008/11/12 15:01:35 1.995 @@ -1,5 +1,6 @@ Version 2.02.43 - 10th November 2008 ==================================== + Make man pages consistent with either-or options (use "|" everywhere). Merge device-mapper into the lvm2 tree. Correct prototype for --permission on lvchange and lvcreate man pages. Exit with non-zero status from vgdisplay if couldn't show any requested VG. --- LVM2/man/lvchange.8.in 2008/11/07 19:23:52 1.2 +++ LVM2/man/lvchange.8.in 2008/11/12 15:01:36 1.3 @@ -4,27 +4,27 @@ .SH SYNOPSIS .B lvchange [\-\-addtag Tag] -[\-A/\-\-autobackup y/n] [\-a/\-\-available y/n/ey/en/ly/ln] +[\-A|\-\-autobackup y|n] [\-a|\-\-available y|n|ey|en|ly|ln] [\-\-alloc AllocationPolicy] -[\-C/\-\-contiguous y/n] [\-d/\-\-debug] [\-\-deltag Tag] +[\-C|\-\-contiguous y|n] [\-d|\-\-debug] [\-\-deltag Tag] [\-\-resync] -[\-h/\-?/\-\-help] +[\-h|\-?|\-\-help] [\-\-ignorelockingfailure] [\-\-ignoremonitoring] [\-\-monitor {y|n}] -[\-M/\-\-persistent y/n] [\-\-minor minor] -[\-P/\-\-partial] -[\-p/\-\-permission r|rw] [\-r/\-\-readahead ReadAheadSectors|auto|none] +[\-M|\-\-persistent y|n] [\-\-minor minor] +[\-P|\-\-partial] +[\-p|\-\-permission r|rw] [\-r/\-\-readahead ReadAheadSectors|auto|none] [\-\-refresh] -[\-t/\-\-test] -[\-v/\-\-verbose] LogicalVolumePath [LogicalVolumePath...] +[\-t|\-\-test] +[\-v|\-\-verbose] LogicalVolumePath [LogicalVolumePath...] .SH DESCRIPTION lvchange allows you to change the attributes of a logical volume including making them known to the kernel ready for use. .SH OPTIONS See \fBlvm\fP for common options. .TP -.I \-a, \-\-available y/n/ey/en/ly/ln +.I \-a, \-\-available y|n|ey|en|ly|ln Controls the availability of the logical volumes for use. Communicates with the kernel device-mapper driver via libdevmapper to activate (-ay) or deactivate (-an) the @@ -36,7 +36,7 @@ Logical volumes with single-host snapshots are always activated exclusively because they can only be used on one node at once. .TP -.I \-C, \-\-contiguous y/n +.I \-C, \-\-contiguous y|n Tries to set or reset the contiguous allocation policy for logical volumes. It's only possible to change a non-contiguous logical volume's allocation policy to contiguous, if all of the @@ -53,7 +53,7 @@ .I \-\-minor minor Set the minor number. .TP -.I \-\-monitor y/n +.I \-\-monitor y|n Controls whether or not a mirrored logical volume is monitored by dmeventd, if it is installed. If a device used by a monitored mirror reports an I/O error, @@ -66,7 +66,7 @@ is specified. Do not use this if dmeventd is already monitoring a device. .TP -.I \-M, \-\-persistent y/n +.I \-M, \-\-persistent y|n Set to y to make the minor number specified persistent. .TP .I \-p, \-\-permission r|rw --- LVM2/man/lvconvert.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvconvert.8.in 2008/11/12 15:01:36 1.2 @@ -3,11 +3,11 @@ lvconvert \- convert a logical volume from linear to mirror or snapshot .SH SYNOPSIS .B lvconvert -\-m/\-\-mirrors Mirrors [\-\-mirrorlog {disk|core}] [\-\-corelog] [\-R/\-\-regionsize MirrorLogRegionSize] -[\-A/\-\-alloc AllocationPolicy] -[\-b/\-\-background] [\-i/\-\-interval Seconds] -[\-h/\-?/\-\-help] -[\-v/\-\-verbose] +\-m|\-\-mirrors Mirrors [\-\-mirrorlog {disk|core}] [\-\-corelog] [\-R|\-\-regionsize MirrorLogRegionSize] +[\-A|\-\-alloc AllocationPolicy] +[\-b|\-\-background] [\-i|\-\-interval Seconds] +[\-h|\-?|\-\-help] +[\-v|\-\-verbose] [\-\-version] .br LogicalVolume[Path] [PhysicalVolume[Path]...] @@ -15,10 +15,10 @@ .br .B lvconvert -\-s/\-\-snapshot [\-c/\-\-chunksize ChunkSize] -[\-h/\-?/\-\-help] -[\-v/\-\-verbose] -[\-Z/\-\-zero y/n] +\-s|\-\-snapshot [\-c|\-\-chunksize ChunkSize] +[\-h|\-?|\-\-help] +[\-v|\-\-verbose] +[\-Z|\-\-zero y|n] [\-\-version] .br OriginalLogicalVolume[Path] SnapshotLogicalVolume[Path] @@ -68,7 +68,7 @@ .I \-c, \-\-chunksize ChunkSize Power of 2 chunk size for the snapshot logical volume between 4k and 512k. .TP -.I \-Z, \-\-zero y/n +.I \-Z, \-\-zero y|n Controls zeroing of the first KB of data in the snapshot. If the volume is read-only the snapshot will not be zeroed. .br --- LVM2/man/lvcreate.8.in 2008/11/07 19:23:52 1.2 +++ LVM2/man/lvcreate.8.in 2008/11/12 15:01:36 1.3 @@ -5,27 +5,27 @@ .B lvcreate [\-\-addtag Tag] [\-\-alloc AllocationPolicy] -[\-A/\-\-autobackup y/n] [\-C/\-\-contiguous y/n] [\-d/\-\-debug] -[\-h/\-?/\-\-help] -[\-i/\-\-stripes Stripes [\-I/\-\-stripesize StripeSize]] -{\-l/\-\-extents LogicalExtentsNumber[%{VG|PVS|FREE}] | - \-L/\-\-size LogicalVolumeSize[kKmMgGtT]} -[\-M/\-\-persistent y/n] [\-\-minor minor] -[\-m/\-\-mirrors Mirrors [\-\-nosync] [\-\-mirrorlog {disk|core}] [\-\-corelog] -[\-R/\-\-regionsize MirrorLogRegionSize]] -[\-n/\-\-name LogicalVolumeName] -[\-p/\-\-permission r|rw] [\-r/\-\-readahead ReadAheadSectors|auto|none] -[\-t/\-\-test] -[\-v/\-\-verbose] [\-Z/\-\-zero y/n] +[\-A|\-\-autobackup y|n] [\-C|\-\-contiguous y|n] [\-d|\-\-debug] +[\-h|\-?|\-\-help] +[\-i|\-\-stripes Stripes [\-I|\-\-stripesize StripeSize]] +{\-l|\-\-extents LogicalExtentsNumber[%{VG|PVS|FREE}] | + \-L|\-\-size LogicalVolumeSize[kKmMgGtT]} +[\-M|\-\-persistent y|n] [\-\-minor minor] +[\-m|\-\-mirrors Mirrors [\-\-nosync] [\-\-mirrorlog {disk|core}] [\-\-corelog] +[\-R|\-\-regionsize MirrorLogRegionSize]] +[\-n|\-\-name LogicalVolumeName] +[\-p|\-\-permission r|rw] [\-r|\-\-readahead ReadAheadSectors|auto|none] +[\-t|\-\-test] +[\-v|\-\-verbose] [\-Z|\-\-zero y|n] VolumeGroupName [PhysicalVolumePath...] .br .br .B lvcreate -{\-l/\-\-extents LogicalExtentsNumber[%{VG|FREE}] | - \-L/\-\-size LogicalVolumeSize[kKmMgGtT]} -[\-c/\-\-chunksize ChunkSize] -\-s/\-\-snapshot \-n/\-\-name SnapshotLogicalVolumeName OriginalLogicalVolumePath +{\-l|\-\-extents LogicalExtentsNumber[%{VG|FREE}] | + \-L|\-\-size LogicalVolumeSize[kKmMgGtT]} +[\-c|\-\-chunksize ChunkSize] +\-s|\-\-snapshot \-n|\-\-name SnapshotLogicalVolumeName OriginalLogicalVolumePath .SH DESCRIPTION lvcreate creates a new logical volume in a volume group ( see .B vgcreate(8), vgchange(8) @@ -46,7 +46,7 @@ .I \-c, \-\-chunksize ChunkSize Power of 2 chunk size for the snapshot logical volume between 4k and 512k. .TP -.I \-C, \-\-contiguous y/n +.I \-C, \-\-contiguous y|n Sets or resets the contiguous allocation policy for logical volumes. Default is no contiguous allocation based on a next free principle. @@ -83,7 +83,7 @@ .I \-\-minor minor Set the minor number. .TP -.I \-M, \-\-persistent y/n +.I \-M, \-\-persistent y|n Set to y to make the minor number specified persistent. .TP .I \-m, \-\-mirrors Mirrors @@ -145,7 +145,7 @@ .B lvdisplay(8) on the snapshot in order to check how much data is allocated to it. .TP -.I \-Z, \-\-zero y/n +.I \-Z, \-\-zero y|n Controls zeroing of the first KB of data in the new logical volume. .br Default is yes. --- LVM2/man/lvdisplay.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvdisplay.8.in 2008/11/12 15:01:36 1.2 @@ -3,10 +3,10 @@ lvdisplay \- display attributes of a logical volume .SH SYNOPSIS .B lvdisplay -[\-c/\-\-colon] [\-d/\-\-debug] [\-h/\-?/\-\-help] +[\-c|\-\-colon] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-\-ignorelockingfailure] -[\-\-maps] [\-P/\-\-partial] -[\-v/\-\-verbose] LogicalVolumePath [LogicalVolumePath...] +[\-\-maps] [\-P|\-\-partial] +[\-v|\-\-verbose] LogicalVolumePath [LogicalVolumePath...] .SH DESCRIPTION lvdisplay allows you to see the attributes of a logical volume like size, read/write status, snapshot information etc. --- LVM2/man/lvextend.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvextend.8.in 2008/11/12 15:01:36 1.2 @@ -4,12 +4,12 @@ .SH SYNOPSIS .B lvextend [\-\-alloc AllocationPolicy] -[\-A/\-\-autobackup y/n] [\-d/\-\-debug] [\-h/\-?/\-\-help] -[\-i/\-\-stripes Stripes [\-I/\-\-stripesize StripeSize]] -{\-l/\-\-extents [+]LogicalExtentsNumber[%{VG|LV|PVS|FREE}] | -\-L/\-\-size [+]LogicalVolumeSize[kKmMgGtT]} -[\-t/\-\-test] -[\-v/\-\-verbose] LogicalVolumePath [PhysicalVolumePath...] +[\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-h|\-?|\-\-help] +[\-i|\-\-stripes Stripes [\-I|\-\-stripesize StripeSize]] +{\-l|\-\-extents [+]LogicalExtentsNumber[%{VG|LV|PVS|FREE}] | +\-L|\-\-size [+]LogicalVolumeSize[kKmMgGtT]} +[\-t|\-\-test] +[\-v|\-\-verbose] LogicalVolumePath [PhysicalVolumePath...] .SH DESCRIPTION lvextend allows you to extend the size of a logical volume. Extension of snapshot logical volumes (see --- LVM2/man/lvmdiskscan.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvmdiskscan.8.in 2008/11/12 15:01:36 1.2 @@ -3,9 +3,9 @@ lvmdiskscan \- scan for all devices visible to LVM2 .SH SYNOPSIS .B lvmdiskscan -[\-d/\-\-debug] [\-h/\-?/\-\-help] -[\-l/\-\-lvmpartition] -[\-v/\-\-verbose] +[\-d|\-\-debug] [\-h|\-?|\-\-help] +[\-l|\-\-lvmpartition] +[\-v|\-\-verbose] .SH DESCRIPTION \fBlvmdiskscan\fP scans all SCSI, (E)IDE disks, multiple devices and a bunch of other block devices in the system looking for LVM physical volumes. --- LVM2/man/lvreduce.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvreduce.8.in 2008/11/12 15:01:36 1.2 @@ -3,12 +3,12 @@ lvreduce \- reduce the size of a logical volume .SH SYNOPSIS .B lvreduce -[\-A/\-\-autobackup y/n] [\-d/\-\-debug] [\-f/\-\-force] -[\-h/\-?/\-\-help] -{\-l/\-\-extents [\-]LogicalExtentsNumber[%{VG|LV|FREE}] | -\-L/\-\-size [\-]LogicalVolumeSize[kKmMgGtT]} -[\-t/\-\-test] -[\-v/\-\-verbose] LogicalVolume[Path] +[\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-f|\-\-force] +[\-h|\-?|\-\-help] +{\-l|\-\-extents [\-]LogicalExtentsNumber[%{VG|LV|FREE}] | +\-L|\-\-size [\-]LogicalVolumeSize[kKmMgGtT]} +[\-t|\-\-test] +[\-v|\-\-verbose] LogicalVolume[Path] .SH DESCRIPTION lvreduce allows you to reduce the size of a logical volume. Be careful when reducing a logical volume's size, because data in the --- LVM2/man/lvremove.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvremove.8.in 2008/11/12 15:01:36 1.2 @@ -3,10 +3,10 @@ lvremove \- remove a logical volume .SH SYNOPSIS .B lvremove -[\-A/\-\-autobackup y/n] [\-d/\-\-debug] [\-f/\-\-force] -[\-h/\-?/\-\-help] -[\-t/\-\-test] -[\-v/\-\-verbose] LogicalVolumePath [LogicalVolumePath...] +[\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-f|\-\-force] +[\-h|\-?|\-\-help] +[\-t|\-\-test] +[\-v|\-\-verbose] LogicalVolumePath [LogicalVolumePath...] .SH DESCRIPTION \fBlvremove\fP removes one or more logical volumes. Confirmation will be requested before deactivating any active logical --- LVM2/man/lvresize.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvresize.8.in 2008/11/12 15:01:36 1.2 @@ -4,12 +4,12 @@ .SH SYNOPSIS .B lvresize [\-\-alloc AllocationPolicy] -[\-A/\-\-autobackup y/n] [\-d/\-\-debug] [\-h/\-?/\-\-help] -[\-i/\-\-stripes Stripes [\-I/\-\-stripesize StripeSize]] -{\-l/\-\-extents [+]LogicalExtentsNumber[%{VG|LV|PVS|FREE}] | -\-L/\-\-size [+]LogicalVolumeSize[kKmMgGtT]} -[\-t/\-\-test] -[\-v/\-\-verbose] LogicalVolumePath [PhysicalVolumePath...] +[\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-h|\-?|\-\-help] +[\-i|\-\-stripes Stripes [\-I|\-\-stripesize StripeSize]] +{\-l|\-\-extents [+]LogicalExtentsNumber[%{VG|LV|PVS|FREE}] | +\-L|\-\-size [+]LogicalVolumeSize[kKmMgGtT]} +[\-t|\-\-test] +[\-v|\-\-verbose] LogicalVolumePath [PhysicalVolumePath...] .SH DESCRIPTION lvresize allows you to resize a logical volume. Be careful when reducing a logical volume's size, because data in the reduced --- LVM2/man/lvs.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/lvs.8.in 2008/11/12 15:01:36 1.2 @@ -3,14 +3,14 @@ lvs \- report information about logical volumes .SH SYNOPSIS .B lvs -[\-\-aligned] [\-d/\-\-debug] [\-h/\-?/\-\-help] +[\-\-aligned] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-\-ignorelockingfailure] [\-\-noheadings] [\-\-nosuffix] -[\-o/\-\-options [+]Field[,Field]] -[\-O/\-\-sort [+/-]Key1[,[+/-]Key2[,...]]] -[\-P/\-\-partial] [\-\-segments] +[\-o|\-\-options [+]Field[,Field]] +[\-O|\-\-sort [+/-]Key1[,[+/-]Key2[,...]]] +[\-P|\-\-partial] [\-\-segments] [\-\-separator Separator] [\-\-unbuffered] [\-\-units hsbkmgtHKMGT] -[\-v/\-\-verbose] +[\-v|\-\-verbose] [\-\-version] [VolumeGroupName [VolumeGroupName...]] .SH DESCRIPTION lvs produces formatted output about logical volumes. --- LVM2/man/pvchange.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/pvchange.8.in 2008/11/12 15:01:36 1.2 @@ -4,12 +4,12 @@ .SH SYNOPSIS .B pvchange [\-\-addtag Tag] -[\-A/\-\-autobackup y/n] [\-d/\-\-debug] +[\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-\-deltag Tag] -[\-h/\-?/\-\-help] -[\-t/\-\-test] -[\-v/\-\-verbose] [\-a/\-\-all] [\-x/\-\-allocatable y/n] -[\-u/\-\-uuid] [PhysicalVolumePath...] +[\-h|\-?|\-\-help] +[\-t|\-\-test] +[\-v|\-\-verbose] [\-a|\-\-all] [\-x|\-\-allocatable y|n] +[\-u|\-\-uuid] [PhysicalVolumePath...] .SH DESCRIPTION pvchange allows you to change the allocation permissions of one or more physical volumes. @@ -23,7 +23,7 @@ .I \-u, \-\-uuid Generate new random UUID for specified physical volumes. .TP -.I \-x, \-\-allocatable y/n +.I \-x, \-\-allocatable y|n Enable or disable allocation of physical extents on this physical volume. .SH Example "pvchange -x n /dev/sdk1" disallows the allocation of physical extents --- LVM2/man/pvcreate.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/pvcreate.8.in 2008/11/12 15:01:36 1.2 @@ -17,7 +17,7 @@ .RB [ \-\-setphysicalvolumesize size ] .RB [ \-u | \-\-uuid uuid ] .RB [ \-\-version ] -.RB [ \-Z | \-\-zero y/n ] +.RB [ \-Z | \-\-zero y|n ] .IR PhysicalVolume " [" PhysicalVolume ...] .SH DESCRIPTION .B pvcreate @@ -62,7 +62,7 @@ .BR \-y ", " \-\-yes Answer yes to all questions. .TP -.BR \-Z ", " \-\-zero " y/n" +.BR \-Z ", " \-\-zero " y|n" Whether or not the first 4 sectors (2048 bytes) of the device should be wiped. If this option is not given, the --- LVM2/man/pvdisplay.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/pvdisplay.8.in 2008/11/12 15:01:36 1.2 @@ -3,8 +3,8 @@ pvdisplay \- display attributes of a physical volume .SH SYNOPSIS .B pvdisplay -[\-c/\-\-colon] [\-d/\-\-debug] [\-h/\-?/\-\-help] [\-s/\-\-short] -[\-v[v]/\-\-verbose [\-\-verbose]] +[\-c|\-\-colon] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-s|\-\-short] +[\-v[v]|\-\-verbose [\-\-verbose]] PhysicalVolumePath [PhysicalVolumePath...] .SH DESCRIPTION pvdisplay allows you to see the attributes of one or more physical volumes --- LVM2/man/pvmove.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/pvmove.8.in 2008/11/12 15:01:36 1.2 @@ -5,9 +5,9 @@ .B pvmove [\-\-abort] [\-\-alloc AllocationPolicy] -[\-b/\-\-background] -[\-d/\-\-debug] [\-h/\-\-help] [\-i/\-\-interval Seconds] [\-v/\-\-verbose] -[\-n/\-\-name LogicalVolume] +[\-b|\-\-background] +[\-d|\-\-debug] [\-h|\-\-help] [\-i|\-\-interval Seconds] [\-v|\-\-verbose] +[\-n|\-\-name LogicalVolume] [SourcePhysicalVolume[:PE[-PE]...] [DestinationPhysicalVolume[:PE[-PE]...]...]] .SH DESCRIPTION .B pvmove --- LVM2/man/pvs.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/pvs.8.in 2008/11/12 15:01:36 1.2 @@ -3,13 +3,13 @@ pvs \- report information about physical volumes .SH SYNOPSIS .B pvs -[\-\-aligned] [\-d/\-\-debug] [\-h/\-?/\-\-help] +[\-\-aligned] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-\-ignorelockingfailure] [\-\-noheadings] [\-\-nosuffix] -[\-o/\-\-options [+]Field[,Field]] -[\-O/\-\-sort [+/-]Key1[,[+/-]Key2[,...]]] +[\-o|\-\-options [+]Field[,Field]] +[\-O|\-\-sort [+/-]Key1[,[+/-]Key2[,...]]] [\-\-separator Separator] [\-\-unbuffered] [\-\-units hsbkmgtHKMGT] -[\-v/\-\-verbose] +[\-v|\-\-verbose] [\-\-version] [PhysicalVolume [PhysicalVolume...]] .SH DESCRIPTION pvs produces formatted output about physical volumes. --- LVM2/man/vgck.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgck.8.in 2008/11/12 15:01:36 1.2 @@ -3,7 +3,7 @@ vgck \- check volume group metadata .SH SYNOPSIS .B vgck -[\-d/\-\-debug] [\-h/\-?/\-\-help] [\-v/\-\-verbose] [VolumeGroupName...] +[\-d|\-\-debug] [\-h|\-?|\-\-help] [\-v|\-\-verbose] [VolumeGroupName...] .SH DESCRIPTION vgck checks LVM metadata for each named volume group for consistency. .SH OPTIONS --- LVM2/man/vgexport.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgexport.8.in 2008/11/12 15:01:36 1.2 @@ -3,9 +3,9 @@ vgexport \- make volume groups unknown to the system .SH SYNOPSIS .B vgexport -[\-a/\-\-all] -[\-d/\-\-debug] [\-h/\-?/\-\-help] -[\-v/\-\-verbose] +[\-a|\-\-all] +[\-d|\-\-debug] [\-h|\-?|\-\-help] +[\-v|\-\-verbose] VolumeGroupName [VolumeGroupName...] .SH DESCRIPTION vgexport allows you to make the inactive --- LVM2/man/vgextend.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgextend.8.in 2008/11/12 15:01:36 1.2 @@ -3,9 +3,9 @@ vgextend \- add physical volumes to a volume group .SH SYNOPSIS .B vgextend -[\-A/\-\-autobackup y/n] [\-d/\-\-debug] [\-h/\-?/\-\-help] -[\-t/\-\-test] -[\-v/\-\-verbose] +[\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-h|\-?|\-\-help] +[\-t|\-\-test] +[\-v|\-\-verbose] VolumeGroupName PhysicalDevicePath [PhysicalDevicePath...] .SH DESCRIPTION vgextend allows you to add one or more initialized physical volumes ( see --- LVM2/man/vgimport.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgimport.8.in 2008/11/12 15:01:36 1.2 @@ -3,9 +3,9 @@ vgimport \- make exported volume groups known to the system .SH SYNOPSIS .B vgimport -[\-a/\-\-all] -[\-d/\-\-debug] [\-h/\-?/\-\-help] -[\-v/\-\-verbose] +[\-a|\-\-all] +[\-d|\-\-debug] [\-h|\-?|\-\-help] +[\-v|\-\-verbose] VolumeGroupName [VolumeGroupName...] .SH DESCRIPTION .B vgimport --- LVM2/man/vgmerge.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgmerge.8.in 2008/11/12 15:01:36 1.2 @@ -3,8 +3,8 @@ vgmerge \- merge two volume groups .SH SYNOPSIS .B vgmerge -[\-A/\-\-autobackup y/n] [\-d/\-\-debug] [\-h/\-?/\-\-help] [\-l/\-\-list] -[\-t/\-\-test] [\-v/\-\-verbose] DestinationVolumeGroupName +[\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-l|\-\-list] +[\-t|\-\-test] [\-v|\-\-verbose] DestinationVolumeGroupName SourceVolumeGroupName .SH DESCRIPTION vgmerge merges two existing volume groups. The inactive SourceVolumeGroupName --- LVM2/man/vgmknodes.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgmknodes.8.in 2008/11/12 15:01:36 1.2 @@ -3,8 +3,8 @@ vgmknodes \- recreate volume group directory and logical volume special files .SH SYNOPSIS .B vgmknodes -[\-d/\-\-debug] [\-h/\-?/\-\-help] -[\-v/\-\-verbose] +[\-d|\-\-debug] [\-h|\-?|\-\-help] +[\-v|\-\-verbose] [[VolumeGroupName | LogicalVolumePath]...] .SH DESCRIPTION Checks the LVM2 special files in /dev that are needed for active --- LVM2/man/vgreduce.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgreduce.8.in 2008/11/12 15:01:36 1.2 @@ -3,10 +3,10 @@ vgreduce \- reduce a volume group .SH SYNOPSIS .B vgreduce -[\-a/\-\-all] [\-A/\-\-autobackup y/n] [\-d/\-\-debug] [\-h/\-?/\-\-help] +[\-a|\-\-all] [\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-\-removemissing] -[\-t/\-\-test] -[\-v/\-\-verbose] VolumeGroupName +[\-t|\-\-test] +[\-v|\-\-verbose] VolumeGroupName [PhysicalVolumePath...] .SH DESCRIPTION vgreduce allows you to remove one or more unused physical volumes --- LVM2/man/vgremove.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgremove.8.in 2008/11/12 15:01:36 1.2 @@ -3,8 +3,8 @@ vgremove \- remove a volume group .SH SYNOPSIS .B vgremove -[\-d/\-\-debug] [\-f/\-\-force] [\-h/\-?/\-\-help] -[\-t/\-\-test] [\-v/\-\-verbose] +[\-d|\-\-debug] [\-f|\-\-force] [\-h|\-?|\-\-help] +[\-t|\-\-test] [\-v|\-\-verbose] VolumeGroupName [VolumeGroupName...] .SH DESCRIPTION vgremove allows you to remove one or more volume groups. --- LVM2/man/vgrename.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgrename.8.in 2008/11/12 15:01:36 1.2 @@ -3,11 +3,11 @@ vgrename \- rename a volume group .SH SYNOPSIS .B vgrename -[\-A/\-\-autobackup y/n] -[\-d/\-\-debug] -[\-h/\-?/\-\-help] -[\-t/\-\-test] -[\-v/\-\-verbose] +[\-A|\-\-autobackup y|n] +[\-d|\-\-debug] +[\-h|\-?|\-\-help] +[\-t|\-\-test] +[\-v|\-\-verbose] .IR OldVolumeGroup { Path | Name | UUID } .IR NewVolumeGroup { Path | Name } .SH DESCRIPTION --- LVM2/man/vgs.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgs.8.in 2008/11/12 15:01:36 1.2 @@ -3,14 +3,14 @@ vgs \- report information about volume groups .SH SYNOPSIS .B vgs -[\-\-aligned] [\-d/\-\-debug] [\-h/\-?/\-\-help] +[\-\-aligned] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-\-ignorelockingfailure] [\-\-noheadings] [\-\-nosuffix] -[\-o/\-\-options [+]Field[,Field]] -[\-O/\-\-sort [+/-]Key1[,[+/-]Key2[,...]]] -[\-P/\-\-partial] +[\-o|\-\-options [+]Field[,Field]] +[\-O|\-\-sort [+/-]Key1[,[+/-]Key2[,...]]] +[\-P|\-\-partial] [\-\-separator Separator] [\-\-unbuffered] [\-\-units hsbkmgtHKMGT] -[\-v/\-\-verbose] +[\-v|\-\-verbose] [\-\-version] [VolumeGroupName [VolumeGroupName...]] .SH DESCRIPTION vgs produces formatted output about volume groups. --- LVM2/man/vgscan.8.in 2008/10/08 12:50:13 1.1 +++ LVM2/man/vgscan.8.in 2008/11/12 15:01:36 1.2 @@ -3,11 +3,11 @@ vgscan \- scan all disks for volume groups and rebuild caches .SH SYNOPSIS .B vgscan -[\-d/\-\-debug] [\-h/\-?/\-\-help] +[\-d|\-\-debug] [\-h|\-?|\-\-help] [\-\-ignorelockingfailure] [\-\-mknodes] -[\-P/\-\-partial] -[\-v/\-\-verbose] +[\-P|\-\-partial] +[\-v|\-\-verbose] .SH DESCRIPTION vgscan scans all SCSI, (E)IDE disks, multiple devices and a bunch of other disk devices in the system looking for LVM physical volumes From wysochanski@sourceware.org Wed Nov 12 15:16:00 2008 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Wed, 12 Nov 2008 15:16:00 -0000 Subject: LVM2/man lvresize.8.in lvs.8.in pvs.8.in vgs.8.in Message-ID: <20081112151659.21376.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2008-11-12 15:16:58 Modified files: man : lvresize.8.in lvs.8.in pvs.8.in vgs.8.in Log message: More man page cleanup - convert "+/-" to "+|-" Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvresize.8.in.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvs.8.in.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvs.8.in.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgs.8.in.diff?cvsroot=lvm2&r1=1.2&r2=1.3 --- LVM2/man/lvresize.8.in 2008/11/12 15:01:36 1.2 +++ LVM2/man/lvresize.8.in 2008/11/12 15:16:58 1.3 @@ -25,7 +25,7 @@ .SH OPTIONS See \fBlvm\fP for common options. .TP -.I \-l, \-\-extents [+/-]LogicalExtentsNumber[%{VG|LV|PVS|FREE}] +.I \-l, \-\-extents [+|-]LogicalExtentsNumber[%{VG|LV|PVS|FREE}] Change or set the logical volume size in units of logical extents. With the + or - sign the value is added to or subtracted from the actual size of the logical volume and without it, the value is taken as an absolute one. @@ -36,7 +36,7 @@ suffix %PVS, or as a percentage of the remaining free space in the Volume Group with the suffix %FREE. .TP -.I \-L, \-\-size [+/-]LogicalVolumeSize[kKmMgGtTpPeE] +.I \-L, \-\-size [+|-]LogicalVolumeSize[kKmMgGtTpPeE] Change or set the logical volume size in units of megabytes. A size suffix of M for megabytes, G for gigabytes, T for terabytes, P for petabytes --- LVM2/man/lvs.8.in 2008/11/12 15:01:36 1.2 +++ LVM2/man/lvs.8.in 2008/11/12 15:16:58 1.3 @@ -6,7 +6,7 @@ [\-\-aligned] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-\-ignorelockingfailure] [\-\-noheadings] [\-\-nosuffix] [\-o|\-\-options [+]Field[,Field]] -[\-O|\-\-sort [+/-]Key1[,[+/-]Key2[,...]]] +[\-O|\-\-sort [+|-]Key1[,[+|-]Key2[,...]]] [\-P|\-\-partial] [\-\-segments] [\-\-separator Separator] [\-\-unbuffered] [\-\-units hsbkmgtHKMGT] --- LVM2/man/pvs.8.in 2008/11/12 15:01:36 1.2 +++ LVM2/man/pvs.8.in 2008/11/12 15:16:58 1.3 @@ -6,7 +6,7 @@ [\-\-aligned] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-\-ignorelockingfailure] [\-\-noheadings] [\-\-nosuffix] [\-o|\-\-options [+]Field[,Field]] -[\-O|\-\-sort [+/-]Key1[,[+/-]Key2[,...]]] +[\-O|\-\-sort [+|-]Key1[,[+|-]Key2[,...]]] [\-\-separator Separator] [\-\-unbuffered] [\-\-units hsbkmgtHKMGT] [\-v|\-\-verbose] --- LVM2/man/vgs.8.in 2008/11/12 15:01:36 1.2 +++ LVM2/man/vgs.8.in 2008/11/12 15:16:58 1.3 @@ -6,7 +6,7 @@ [\-\-aligned] [\-d|\-\-debug] [\-h|\-?|\-\-help] [\-\-ignorelockingfailure] [\-\-noheadings] [\-\-nosuffix] [\-o|\-\-options [+]Field[,Field]] -[\-O|\-\-sort [+/-]Key1[,[+/-]Key2[,...]]] +[\-O|\-\-sort [+|-]Key1[,[+|-]Key2[,...]]] [\-P|\-\-partial] [\-\-separator Separator] [\-\-unbuffered] [\-\-units hsbkmgtHKMGT] From agk@sourceware.org Fri Nov 14 20:59:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Fri, 14 Nov 2008 20:59:00 -0000 Subject: LVM2 libdm/Makefile.in tools/Makefile.in Message-ID: <20081114205957.22260.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-14 20:59:57 Modified files: libdm : Makefile.in tools : Makefile.in Log message: some makefile fixes for liblvm2cmd & remove some hardcoded .so Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/Makefile.in.diff?cvsroot=lvm2&r1=1.42&r2=1.43 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/Makefile.in.diff?cvsroot=lvm2&r1=1.89&r2=1.90 --- LVM2/libdm/Makefile.in 2008/11/04 17:25:32 1.42 +++ LVM2/libdm/Makefile.in 2008/11/14 20:59:56 1.43 @@ -95,8 +95,8 @@ $(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION_DM): $(interface)/%.$(LIB_SUFFIX) rm -f $@ $(LN_S) $< $@ - rm -f libdevmapper.so - $(LN_S) $< libdevmapper.so + rm -f libdevmapper.$(LIB_SUFFIX) + $(LN_S) $< libdevmapper.$(LIB_SUFFIX) .PHONY: distclean_lib distclean --- LVM2/tools/Makefile.in 2008/11/10 13:41:43 1.89 +++ LVM2/tools/Makefile.in 2008/11/14 20:59:57 1.90 @@ -79,13 +79,13 @@ LVMLIBS = -llvm -CLEAN_TARGETS = liblvm2cmd.so liblvm2cmd.a liblvm2cmd-static.a lvm lvm.o \ +CLEAN_TARGETS = liblvm2cmd.$(LIB_SUFFIX) liblvm2cmd.a liblvm2cmd-static.a lvm lvm.o \ lvm2cmd.o lvm2cmd-static.o lvm2cmdlib.o lvm.static \ lvm.cflow lvm.xref lvm.tree lvm.rxref lvm.rtree \ lvmcmdlib.o lvm-static.o dmsetup.o ifeq ("@CMDLIB@", "yes") - TARGETS += liblvm2cmd.so + TARGETS += liblvm2cmd.$(LIB_SUFFIX) INSTALL_LVM_TARGETS += $(INSTALL_CMDLIB_TARGETS) endif @@ -129,7 +129,7 @@ cat $(top_srcdir)/lib/liblvm.a > $@ $(AR) rs $@ $(OBJECTS) lvmcmdlib.o lvm2cmd-static.o -liblvm2cmd.so: liblvm2cmd.a $(LDDEPS) +liblvm2cmd.$(LIB_SUFFIX): liblvm2cmd.a $(LDDEPS) .commands: commands.h cmdnames.h Makefile $(CC) -E -P cmdnames.h 2> /dev/null | \ @@ -155,17 +155,17 @@ cflow: lvm.cflow lvm.xref lvm.tree lvm.rtree lvm.rxref endif -install_cmdlib_dynamic: liblvm2cmd.so - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) liblvm2cmd.so \ - $(libdir)/liblvm2cmd.so.$(LIB_VERSION) - $(LN_S) -f liblvm2cmd.so.$(LIB_VERSION) $(libdir)/liblvm2cmd.so +install_cmdlib_dynamic: liblvm2cmd.$(LIB_SUFFIX) + $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) liblvm2cmd.$(LIB_SUFFIX) \ + $(libdir)/liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION_LVM) + $(LN_S) -f liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION_LVM) $(libdir)/liblvm2cmd.$(LIB_SUFFIX) $(INSTALL) -D $(OWNER) $(GROUP) -m 444 lvm2cmd.h \ $(includedir)/lvm2cmd.h install_cmdlib_static: liblvm2cmd-static.a $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) liblvm2cmd-static.a \ - $(libdir)/liblvm2cmd.a.$(LIB_VERSION) - $(LN_S) -f liblvm2cmd.a.$(LIB_VERSION) $(libdir)/liblvm2cmd.a + $(libdir)/liblvm2cmd.a.$(LIB_VERSION_LVM) + $(LN_S) -f liblvm2cmd.a.$(LIB_VERSION_LVM) $(libdir)/liblvm2cmd.a $(INSTALL) -D $(OWNER) $(GROUP) -m 444 lvm2cmd.h \ $(includedir)/lvm2cmd.h From wysochanski@sourceware.org Mon Nov 17 18:20:00 2008 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Mon, 17 Nov 2008 18:20:00 -0000 Subject: LVM2 ./WHATS_NEW man/lvremove.8.in tools/lvrem ... Message-ID: <20081117182015.8703.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2008-11-17 18:20:14 Modified files: . : WHATS_NEW man : lvremove.8.in tools : lvremove.c Log message: Fix "lvremove -f vgname" when vgname contains snapshots. Prior to this patch, "lvremove -f vgname" would fail if vgname contained one or more snapshot LVs. Now this passes, but has a side-effect. If you issue "lvremove vgname" where vgname contains one or more snaps, you will get an extra "y/n" prompt to remove the same snapshot. Example: $ lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert lvsnap vgtest swi-a- 16.00M lvtest 0.05 lvtest vgtest owi-a- 64.00M $ lvremove vgtest Do you really want to remove active logical volume "lvsnap"? [y/n]: n Logical volume "lvsnap" not removed Do you really want to remove active logical volume "lvsnap"? [y/n]: n Logical volume "lvsnap" not removed Command failed with status code 5. Fixing this will most likely require modification of the iterator function, process_each_lvs_in_vg() to iterate over snaps in some cases (e.g. lvs, vgdisplay -v) but not in others (lvremove). Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.995&r2=1.996 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvremove.8.in.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvremove.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56 --- LVM2/WHATS_NEW 2008/11/12 15:01:35 1.995 +++ LVM2/WHATS_NEW 2008/11/17 18:20:13 1.996 @@ -1,5 +1,6 @@ Version 2.02.43 - 10th November 2008 ==================================== + Cope with snapshot dependencies when removing a whole VG with lvremove. Make man pages consistent with either-or options (use "|" everywhere). Merge device-mapper into the lvm2 tree. Correct prototype for --permission on lvchange and lvcreate man pages. --- LVM2/man/lvremove.8.in 2008/11/12 15:01:36 1.2 +++ LVM2/man/lvremove.8.in 2008/11/17 18:20:13 1.3 @@ -12,6 +12,7 @@ Confirmation will be requested before deactivating any active logical volume prior to removal. Logical volumes cannot be deactivated or removed while they are open (e.g. if they contain a mounted filesystem). +Removing an origin logical volume will also remove all dependent snapshots. .sp If the logical volume is clustered then it must be deactivated on all nodes in the cluster before it can be removed. A single lvchange command --- LVM2/tools/lvremove.c 2008/09/19 06:42:00 1.55 +++ LVM2/tools/lvremove.c 2008/11/17 18:20:14 1.56 @@ -18,7 +18,7 @@ static int lvremove_single(struct cmd_context *cmd, struct logical_volume *lv, void *handle __attribute((unused))) { - if (!lv_remove_single(cmd, lv, arg_count(cmd, force_ARG))) + if (!lv_remove_with_dependencies(cmd, lv, arg_count(cmd, force_ARG))) return ECMD_FAILED; return ECMD_PROCESSED; From zkabelac@sourceware.org Tue Nov 18 10:13:00 2008 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Tue, 18 Nov 2008 10:13:00 -0000 Subject: LVM2/tools lvmcmdline.c Message-ID: <20081118101324.3901.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2008-11-18 10:13:23 Modified files: tools : lvmcmdline.c Log message: fix missing const char* Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.74&r2=1.75 --- LVM2/tools/lvmcmdline.c 2008/11/12 09:53:33 1.74 +++ LVM2/tools/lvmcmdline.c 2008/11/18 10:13:23 1.75 @@ -1218,7 +1218,7 @@ int lvm2_main(int argc, char **argv, unsigned is_static) { - char *base; + const char *base; int ret, alias = 0; struct cmd_context *cmd; From zkabelac@sourceware.org Tue Nov 18 13:16:00 2008 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Tue, 18 Nov 2008 13:16:00 -0000 Subject: LVM2 Makefile.in Message-ID: <20081118131604.28336.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2008-11-18 13:16:03 Modified files: . : Makefile.in Log message: daemons depends on liblvm2cmd - fixes parallel builds Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.29&r2=1.30 --- LVM2/Makefile.in 2008/11/10 14:04:12 1.29 +++ LVM2/Makefile.in 2008/11/18 13:16:03 1.30 @@ -42,7 +42,7 @@ libdm: include lib: libdm -daemons: lib +daemons: lib tools tools: lib device-mapper po: tools daemons From agk@sourceware.org Wed Nov 19 14:14:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 19 Nov 2008 14:14:00 -0000 Subject: LVM2 VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Message-ID: <20081119141454.15572.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-19 14:14:52 Modified files: . : VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Log message: post-release (retrospective) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION.diff?cvsroot=lvm2&r1=1.187&r2=1.188 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION_DM.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.996&r2=1.997 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.256&r2=1.257 --- LVM2/VERSION 2008/11/10 12:39:50 1.187 +++ LVM2/VERSION 2008/11/19 14:14:51 1.188 @@ -1 +1 @@ -2.02.43-cvs (2008-11-10) +2.02.44-cvs (2008-11-19) --- LVM2/VERSION_DM 2008/11/10 12:39:50 1.2 +++ LVM2/VERSION_DM 2008/11/19 14:14:52 1.3 @@ -1 +1 @@ -1.02.29-cvs (2008-11-10) +1.02.30-cvs (2008-11-19) --- LVM2/WHATS_NEW 2008/11/17 18:20:13 1.996 +++ LVM2/WHATS_NEW 2008/11/19 14:14:52 1.997 @@ -1,7 +1,11 @@ -Version 2.02.43 - 10th November 2008 +Version 2.02.44 - ==================================== + Fix clvmd & dmeventd builds after tree restructuring. Cope with snapshot dependencies when removing a whole VG with lvremove. Make man pages consistent with either-or options (use "|" everywhere). + +Version 2.02.43 - 10th November 2008 +==================================== Merge device-mapper into the lvm2 tree. Correct prototype for --permission on lvchange and lvcreate man pages. Exit with non-zero status from vgdisplay if couldn't show any requested VG. --- LVM2/WHATS_NEW_DM 2008/11/10 12:39:50 1.256 +++ LVM2/WHATS_NEW_DM 2008/11/19 14:14:52 1.257 @@ -1,3 +1,6 @@ +Version 1.02.30 - +==================================== + Version 1.02.29 - 10th November 2008 ==================================== Merge device-mapper into the LVM2 tree. From agk@sourceware.org Wed Nov 19 19:33:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 19 Nov 2008 19:33:00 -0000 Subject: LVM2 ./WHATS_NEW ./configure.in scripts/clvmd_ ... Message-ID: <20081119193331.20438.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-19 19:33:28 Modified files: . : WHATS_NEW configure.in Removed files: scripts : clvmd_init clvmd_init_rhel4 Log message: Generate clvmd init script at configuration time for Red Hat-based distros. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.997&r2=1.998 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.89&r2=1.90 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/clvmd_init.diff?cvsroot=lvm2&r1=1.1&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/clvmd_init_rhel4.diff?cvsroot=lvm2&r1=1.12&r2=NONE --- LVM2/WHATS_NEW 2008/11/19 14:14:52 1.997 +++ LVM2/WHATS_NEW 2008/11/19 19:33:25 1.998 @@ -1,5 +1,6 @@ Version 2.02.44 - ==================================== + Generate Red Hat clvmd startup script at configuration time with correct paths. Fix clvmd & dmeventd builds after tree restructuring. Cope with snapshot dependencies when removing a whole VG with lvremove. Make man pages consistent with either-or options (use "|" everywhere). --- LVM2/configure.in 2008/11/10 21:25:45 1.89 +++ LVM2/configure.in 2008/11/19 19:33:25 1.90 @@ -803,6 +803,7 @@ libdm/libdevmapper.pc man/Makefile po/Makefile +scripts/clvmd_init_red_hat scripts/Makefile test/Makefile tools/Makefile From agk@sourceware.org Wed Nov 19 19:34:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 19 Nov 2008 19:34:00 -0000 Subject: LVM2 configure Message-ID: <20081119193434.23270.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-19 19:34:34 Modified files: . : configure Log message: regenerate Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.85&r2=1.86 --- LVM2/configure 2008/11/10 21:25:45 1.85 +++ LVM2/configure 2008/11/19 19:34:32 1.86 @@ -11720,7 +11720,7 @@ ################################################################################ -ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc man/Makefile po/Makefile scripts/Makefile test/Makefile tools/Makefile tools/version.h" +ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/Makefile test/Makefile tools/Makefile tools/version.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -12298,6 +12298,7 @@ "libdm/libdevmapper.pc") CONFIG_FILES="$CONFIG_FILES libdm/libdevmapper.pc" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;; + "scripts/clvmd_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/clvmd_init_red_hat" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; From agk@sourceware.org Wed Nov 19 20:14:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 19 Nov 2008 20:14:00 -0000 Subject: LVM2/scripts clvmd_init_red_hat.in Message-ID: <20081119201425.3209.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-19 20:14:25 Added files: scripts : clvmd_init_red_hat.in Log message: generate init script Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/clvmd_init_red_hat.in.diff?cvsroot=lvm2&r1=NONE&r2=1.1 /cvs/lvm2/LVM2/scripts/clvmd_init_red_hat.in,v --> standard output revision 1.1 --- LVM2/scripts/clvmd_init_red_hat.in +++ - 2008-11-19 20:14:25.838796000 +0000 @@ -0,0 +1,147 @@ +#!/bin/bash +# +# chkconfig: - 24 76 +# description: Starts and stops clvmd +# +# For Red-Hat-based distributions such as Fedora, RHEL, CentOS. +# +### BEGIN INIT INFO +# Provides: +### END INIT INFO + +. /etc/init.d/functions + +DAEMON=clvmd + +exec_prefix=@exec_prefix@ +sbindir=@sbindir@ + +LVDISPLAY=${sbindir}/lvdisplay +VGCHANGE=${sbindir}/vgchange +VGSCAN=${sbindir}/vgscan +VGDISPLAY=${sbindir}/vgdisplay +VGS=${sbindir}/vgs + +CLVMDOPTS="-T20" + +[ -f /etc/sysconfig/cluster ] && . /etc/sysconfig/cluster + +LOCK_FILE="/var/lock/subsys/$DAEMON" + +start() +{ + for rtrn in 0 + do + if ! pidof $DAEMON > /dev/null + then + echo -n "Starting $DAEMON: " + daemon $DAEMON $CLVMDOPTS + rtrn=$? + echo + if [ $rtrn -ne 0 ] + then + break + fi + fi + # refresh cache + $VGSCAN > /dev/null 2>&1 + + if [ -n "$LVM_VGS" ] + then + for vg in $LVM_VGS + do + action "Activating VG $vg:" $VGCHANGE -ayl $vg || rtrn=$? + done + else + action "Activating VGs:" $VGCHANGE -ayl || rtrn=$? + fi + done + + return $rtrn +} + +stop() +{ + for rtrn in 0 + do + if [ -n "$LVM_VGS" ] + then + for vg in $LVM_VGS + do + action "Deactivating VG $vg:" $VGCHANGE -anl $vg || rtrn=$? + done + else + # Hack to only deactivate clustered volumes + clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'` + for vg in $clustervgs; do + action "Deactivating VG $vg:" $VGCHANGE -anl $vg || rtrn=$? + done + fi + + [ $rtrn -ne 0 ] && break + + echo -n "Stopping clvm:" + killproc $DAEMON -TERM + rtrn=$? + echo + done + + return $rtrn +} + +wait_for_finish() +{ + count=0 + + while [ "$count" -le 10 -a -n "`pidof $DAEMON`" ] + do + sleep 1 + count=$((count + 1)) + done + + if [ `pidof $DAEMON` ] + then + return 1 + else + return 0 + fi +} + +rtrn=1 + +# See how we were called. +case "$1" in + start) + start + rtrn=$? + [ $rtrn = 0 ] && touch $LOCK_FILE + ;; + + stop) + stop + rtrn=$? + [ $rtrn = 0 ] && rm -f $LOCK_FILE + ;; + + restart) + if stop + then + wait_for_finish + start + fi + rtrn=$? + ;; + + status) + status $DAEMON + rtrn=$? + vols=$( $LVDISPLAY -C --nohead 2> /dev/null | awk '($3 ~ /....a./) {print $1}' ) + echo active volumes: ${vols:-"(none)"} + ;; + + *) + echo $"Usage: $0 {start|stop|restart|status}" + ;; +esac + +exit $rtrn From ccaulfield@sourceware.org Fri Nov 21 13:48:00 2008 From: ccaulfield@sourceware.org (ccaulfield@sourceware.org) Date: Fri, 21 Nov 2008 13:48:00 -0000 Subject: LVM2 ./WHATS_NEW daemons/clvmd/clvmd.c Message-ID: <20081121134801.10871.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: ccaulfield@sourceware.org 2008-11-21 13:48:00 Modified files: . : WHATS_NEW daemons/clvmd : clvmd.c Log message: Fix a starup race in clvmd that could result in huge waits for the first command to be processed. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.998&r2=1.999 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52 --- LVM2/WHATS_NEW 2008/11/19 19:33:25 1.998 +++ LVM2/WHATS_NEW 2008/11/21 13:48:00 1.999 @@ -1,5 +1,6 @@ Version 2.02.44 - ==================================== + Fix startup race in clvmd. Generate Red Hat clvmd startup script at configuration time with correct paths. Fix clvmd & dmeventd builds after tree restructuring. Cope with snapshot dependencies when removing a whole VG with lvremove. --- LVM2/daemons/clvmd/clvmd.c 2008/11/04 16:41:47 1.51 +++ LVM2/daemons/clvmd/clvmd.c 2008/11/21 13:48:00 1.52 @@ -423,6 +423,9 @@ /* This needs to be started after cluster initialisation as it may need to take out locks */ DEBUGLOG("starting LVM thread\n"); + + /* Don't let anyone else to do work until we are started */ + pthread_mutex_lock(&lvm_start_mutex); pthread_create(&lvm_thread, NULL, lvm_thread_fn, (void *)(long)using_gulm); @@ -1758,9 +1761,6 @@ sigset_t ss; int using_gulm = (int)(long)arg; - /* Don't let anyone else to do work until we are started */ - pthread_mutex_lock(&lvm_start_mutex); - DEBUGLOG("LVM thread function started\n"); /* Ignore SIGUSR1 & 2 */ From agk@sourceware.org Mon Nov 24 13:33:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 24 Nov 2008 13:33:00 -0000 Subject: LVM2 WHATS_NEW configure configure.in Message-ID: <20081124133320.15162.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-24 13:33:19 Modified files: . : WHATS_NEW configure configure.in Log message: Add tinfo to termcap search path for pld-linux. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.999&r2=1.1000 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.86&r2=1.87 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.90&r2=1.91 --- LVM2/WHATS_NEW 2008/11/21 13:48:00 1.999 +++ LVM2/WHATS_NEW 2008/11/24 13:33:16 1.1000 @@ -1,5 +1,6 @@ Version 2.02.44 - ==================================== + Add tinfo to termcap search path for pld-linux. Fix startup race in clvmd. Generate Red Hat clvmd startup script at configuration time with correct paths. Fix clvmd & dmeventd builds after tree restructuring. --- LVM2/configure 2008/11/19 19:34:32 1.86 +++ LVM2/configure 2008/11/24 13:33:18 1.87 @@ -9137,7 +9137,7 @@ return 0; } _ACEOF -for ac_lib in '' ncurses curses termcap termlib; do +for ac_lib in '' tinfo ncurses curses termcap termlib; do if test -z "$ac_lib"; then ac_res="none required" else --- LVM2/configure.in 2008/11/19 19:33:25 1.90 +++ LVM2/configure.in 2008/11/24 13:33:19 1.91 @@ -472,7 +472,7 @@ ################################################################################ dnl -- Check for termcap (Shamelessly copied from parted 1.4.17) if test x$READLINE != xno; then - AC_SEARCH_LIBS([tgetent], [ncurses curses termcap termlib], + AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib], [tg_found=yes], [tg_found=no]) test x$READLINE:$tg_found = xyes:no && AC_MSG_ERROR( From agk@sourceware.org Thu Nov 27 18:13:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Thu, 27 Nov 2008 18:13:00 -0000 Subject: LVM2 ./WHATS_NEW lib/cache/lvmcache.c Message-ID: <20081127181351.27924.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-27 18:13:51 Modified files: . : WHATS_NEW lib/cache : lvmcache.c Log message: Don't skip updating pvid hash when lvmcache_info struct got swapped. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1000&r2=1.1001 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62 --- LVM2/WHATS_NEW 2008/11/24 13:33:16 1.1000 +++ LVM2/WHATS_NEW 2008/11/27 18:13:50 1.1001 @@ -1,5 +1,6 @@ Version 2.02.44 - ==================================== + Don't skip updating pvid hash when lvmcache_info struct got swapped. Add tinfo to termcap search path for pld-linux. Fix startup race in clvmd. Generate Red Hat clvmd startup script at configuration time with correct paths. --- LVM2/lib/cache/lvmcache.c 2008/11/03 22:14:27 1.61 +++ LVM2/lib/cache/lvmcache.c 2008/11/27 18:13:51 1.62 @@ -707,7 +707,11 @@ static int _lvmcache_update_pvid(struct lvmcache_info *info, const char *pvid) { - if (!strcmp(info->dev->pvid, pvid)) + /* + * Nothing to do if already stored with same pvid. + */ + if (((dm_hash_lookup(_pvid_hash, pvid)) == info) && + !strcmp(info->dev->pvid, pvid)) return 1; if (*info->dev->pvid) { dm_hash_remove(_pvid_hash, info->dev->pvid); From agk@sourceware.org Fri Nov 28 15:51:00 2008 From: agk@sourceware.org (agk@sourceware.org) Date: Fri, 28 Nov 2008 15:51:00 -0000 Subject: LVM2/lib/cache lvmcache.c Message-ID: <20081128155140.26223.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-28 15:51:40 Modified files: lib/cache : lvmcache.c Log message: Suppress 'duplicate PV' message when it's only a cache update not a real duplicate. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63 --- LVM2/lib/cache/lvmcache.c 2008/11/27 18:13:51 1.62 +++ LVM2/lib/cache/lvmcache.c 2008/11/28 15:51:40 1.63 @@ -713,9 +713,8 @@ if (((dm_hash_lookup(_pvid_hash, pvid)) == info) && !strcmp(info->dev->pvid, pvid)) return 1; - if (*info->dev->pvid) { + if (*info->dev->pvid) dm_hash_remove(_pvid_hash, info->dev->pvid); - } strncpy(info->dev->pvid, pvid, sizeof(info->dev->pvid)); if (!dm_hash_insert(_pvid_hash, pvid, info)) { log_error("_lvmcache_update: pvid insertion failed: %s", pvid); @@ -1140,11 +1139,15 @@ //else if (dm_is_dm_major(MAJOR(existing->dev->dev)) && //dm_is_dm_major(MAJOR(dev->dev))) // - else + else if (!strcmp(pvid_s, existing->dev->pvid)) log_error("Found duplicate PV %s: using %s not " "%s", pvid, dev_name(dev), dev_name(existing->dev)); } + if (strcmp(pvid_s, existing->dev->pvid)) + log_debug("Updating pvid cache to %s (%s) from %s (%s)", + pvid_s, dev_name(dev), + existing->dev->pvid, dev_name(existing->dev)); /* Switch over to new preferred device */ existing->dev = dev; info = existing;