CVS commit: src/external/gpl2/lvm2

2020-05-31 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Jun  1 00:34:25 UTC 2020

Modified Files:
src/external/gpl2/lvm2: lvm2tools.mk
src/external/gpl2/lvm2/dist/include: lib.h
src/external/gpl2/lvm2/dist/lib/misc: lib.h

Log Message:
Avoid redefining _REENTRANT under sanitizers

Switch away from -Wno-macro-redefined which was Clang specific.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/lvm2tools.mk
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/lvm2/dist/include/lib.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/lvm2/dist/lib/misc/lib.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lvm2tools.mk
diff -u src/external/gpl2/lvm2/lvm2tools.mk:1.6 src/external/gpl2/lvm2/lvm2tools.mk:1.7
--- src/external/gpl2/lvm2/lvm2tools.mk:1.6	Sat Feb  8 00:11:18 2020
+++ src/external/gpl2/lvm2/lvm2tools.mk	Mon Jun  1 00:34:25 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: lvm2tools.mk,v 1.6 2020/02/08 00:11:18 kamil Exp $
+#	$NetBSD: lvm2tools.mk,v 1.7 2020/06/01 00:34:25 kamil Exp $
 
 .include 
 
@@ -24,7 +24,3 @@ CPPFLAGS+=-DDM_DEVICE_UID=0 -DDM_DEVICE_
 #.endif
 #
 #LVM2.liblvm=	${LVM2OBJDIR.liblvm}/liblvm.a
-
-.if ${MKSANITIZER:Uno} == "yes" || ${MKLIBCSANITIZER:Uno} == "yes"
-CFLAGS+=	-Wno-macro-redefined # _REENTRANT redefined in lib.h
-.endif

Index: src/external/gpl2/lvm2/dist/include/lib.h
diff -u src/external/gpl2/lvm2/dist/include/lib.h:1.1.1.1 src/external/gpl2/lvm2/dist/include/lib.h:1.2
--- src/external/gpl2/lvm2/dist/include/lib.h:1.1.1.1	Mon Dec 22 00:18:44 2008
+++ src/external/gpl2/lvm2/dist/include/lib.h	Mon Jun  1 00:34:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lib.h,v 1.1.1.1 2008/12/22 00:18:44 haad Exp $	*/
+/*	$NetBSD: lib.h,v 1.2 2020/06/01 00:34:25 kamil Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
@@ -23,7 +23,9 @@
 
 #include "configure.h"
 
+#ifndef _REENTRANT
 #define _REENTRANT
+#endif
 #define _GNU_SOURCE
 #define _FILE_OFFSET_BITS 64
 

Index: src/external/gpl2/lvm2/dist/lib/misc/lib.h
diff -u src/external/gpl2/lvm2/dist/lib/misc/lib.h:1.1.1.1 src/external/gpl2/lvm2/dist/lib/misc/lib.h:1.2
--- src/external/gpl2/lvm2/dist/lib/misc/lib.h:1.1.1.1	Mon Dec 22 00:18:12 2008
+++ src/external/gpl2/lvm2/dist/lib/misc/lib.h	Mon Jun  1 00:34:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lib.h,v 1.1.1.1 2008/12/22 00:18:12 haad Exp $	*/
+/*	$NetBSD: lib.h,v 1.2 2020/06/01 00:34:25 kamil Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
@@ -23,7 +23,9 @@
 
 #include "configure.h"
 
+#ifndef _REENTRANT
 #define _REENTRANT
+#endif
 #define _GNU_SOURCE
 #define _FILE_OFFSET_BITS 64
 



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2019-12-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Dec 14 09:05:30 UTC 2019

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm_netbsd.c

Log Message:
Handle NULL params, fix error paths.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.7 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.8
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.7	Tue Feb  8 03:26:12 2011
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Sat Dec 14 09:05:30 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.7 2011/02/08 03:26:12 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.8 2019/12/14 09:05:30 mlelstv Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -345,9 +345,10 @@ dm_table_status(libdm_task_t task, struc
 		type = libdm_table_get_target(table);
 		params = libdm_table_get_params(table);
 
-		if (params != NULL)
-			plen = strlen(params) + 1;
+		if (params == NULL)
+			params = "";
 
+		plen = strlen(params) + 1;
 		rec_size = sizeof(struct dm_target_spec) + plen;
 
 		/*
@@ -357,17 +358,17 @@ dm_table_status(libdm_task_t task, struc
 		 */
 		next += rec_size;
 
-		if (rec_size > dmi->data_size)
+		if (rec_size > dmi->data_size) {
+			libdm_table_destroy(table);
+			libdm_iter_destroy(iter);
 			return -ENOMEM;
+		}
 
 		dmts->next = next;
 		strlcpy(dmts->target_type, type, DM_MAX_TYPE_NAME);
 		params_start = (char *)dmts + sizeof(struct dm_target_spec);
 
-		if (params != NULL)
-			strlcpy(params_start, params, plen);
-		else
-			params_start = "\0";
+		strlcpy(params_start, params, plen);
 
 		odmts = dmts;
 		dmts = (struct dm_target_spec *)((uint8_t *)dmts + rec_size);



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2018-11-24 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 24 11:27:37 UTC 2018

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Support device nodes that have no entry in /dev, identify them by major:minor
numbers like the original Linux code.

While here, fix a memory leak.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.11 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.12
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.11	Tue Feb  8 03:26:12 2011
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Sat Nov 24 11:27:37 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.11 2011/02/08 03:26:12 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.12 2018/11/24 11:27:37 mlelstv Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -25,7 +25,9 @@
 #include 
 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include 
@@ -367,40 +369,31 @@ static int _unmarshal_status(struct dm_t
 }
 
 static char *
-get_dev_name(char *d_name, uint32_t d_major, uint32_t d_minor)
+get_dev_name(dev_t dev)
 {
+	static char * const dirs[2] = { _PATH_DEV, NULL };
 	static char d_buf[MAXPATHLEN];
-	struct dirent *dire;
-	struct stat st;
-	DIR *dev_dir;
-
-	int err;
+	FTS *ftsp;
+	FTSENT *fe;
 	char *name;
 
-	dev_dir = opendir("/dev");
-
-	while ((dire = readdir(dev_dir)) != NULL) {
+	if ((ftsp = fts_open(dirs, FTS_NOCHDIR | FTS_PHYSICAL, NULL)) == NULL)
+		return NULL;
 
-		if (strstr(dire->d_name, d_name) == NULL)
+	name = NULL;
+	while ((fe = fts_read(ftsp)) != NULL) {
+		if (fe->fts_info != FTS_DEFAULT)
 			continue;
-
-		snprintf(d_buf, MAXPATHLEN, "/dev/%s", dire->d_name);
-
-		if ((err = stat(d_buf, )) < 0)
-			printf("stat failed with %d", err);
-
-		if (st.st_mode & S_IFBLK){
-			if ((major(st.st_rdev) == d_major) && (minor(st.st_rdev) == d_minor)) {
-strncpy(d_buf, dire->d_name, strlen(dire->d_name) + 1);
+		if (S_ISBLK(fe->fts_statp->st_mode)) {
+			if (fe->fts_statp->st_rdev == dev) {
+strlcpy(d_buf, fe->fts_path, sizeof(d_buf));
 name = d_buf;
 break;
 			}
 		}
-
-		memset(d_buf, '0', sizeof(d_buf));
 	}
 
-	(void)closedir(dev_dir);
+	fts_close(ftsp);
 
 	return name;
 }
@@ -417,13 +410,15 @@ int dm_format_dev(char *buf, int bufsize
 		  uint32_t dev_minor)
 {
 	int r;
-	uint32_t major, dm_major;
+	uint32_t dm_major;
+	int major;
 	char *name;
 	mode_t mode;
 	dev_t dev;
 	size_t val_len,i;
 	struct kinfo_drivers *kd;
 
+	major = -1;
 	mode = 0;
 
 	nbsd_get_dm_major(_major, DM_BLOCK_MAJOR);
@@ -432,7 +427,7 @@ int dm_format_dev(char *buf, int bufsize
 		return 0;
 
 	if (sysctlbyname("kern.drivers",NULL,_len,NULL,0) < 0) {
-		printf("sysctlbyname failed");
+		printf("sysctlbyname failed\n");
 		return 0;
 	}
 
@@ -442,7 +437,8 @@ int dm_format_dev(char *buf, int bufsize
 	}
 
 	if (sysctlbyname("kern.drivers", kd, _len, NULL, 0) < 0) {
-		printf("sysctlbyname failed kd");
+		free(kd);
+		printf("sysctlbyname failed kd\n");
 		return 0;
 	}
 
@@ -453,18 +449,22 @@ int dm_format_dev(char *buf, int bufsize
 		}
 	}
 
-	dev = MKDEV(major,dev_minor);
-
-	mode |= S_IFBLK;
-
-	if ((name = devname(dev,mode)) == NULL)
-		name = get_dev_name(kd[i].d_name, major, dev_minor);
-
-	r = snprintf(buf, (size_t) bufsize, "/dev/%s",name);
+	if (major != -1) {
+		dev = MKDEV(major,dev_minor);
+		mode |= S_IFBLK;
+		if ((name = devname(dev,mode)) == NULL)
+			name = get_dev_name(dev);
+	} else
+		name = NULL;
 
 	free(kd);
 
-	if (r < 0 || r > bufsize - 1 || name == NULL)
+	if (name == NULL)
+		r = snprintf(buf, (size_t) bufsize, "%d:%d", dev_major, dev_minor);
+	else
+		r = snprintf(buf, (size_t) bufsize, _PATH_DEV "%s", name);
+
+	if (r < 0 || r > bufsize - 1)
 		return 0;
 
 	return 1;



CVS commit: src/external/gpl2/lvm2/lib/libdevmapper

2016-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct  4 14:33:16 UTC 2016

Modified Files:
src/external/gpl2/lvm2/lib/libdevmapper: Makefile

Log Message:
Hack for powerpc64


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl2/lvm2/lib/libdevmapper/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/libdevmapper/Makefile
diff -u src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.9 src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.10
--- src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.9	Wed Sep 11 19:04:10 2013
+++ src/external/gpl2/lvm2/lib/libdevmapper/Makefile	Tue Oct  4 10:33:16 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2013/09/11 23:04:10 joerg Exp $
+#	$NetBSD: Makefile,v 1.10 2016/10/04 14:33:16 christos Exp $
 
 USE_SHLIBDIR=	yes
 USE_FORT?=	no
@@ -35,6 +35,11 @@ LDADD+= -lrumpvfs -lrump -lrumpu
 DBG=-g
 .endif
 
+# call to `dm_lib_release' lacks nop, can't restore toc; recompile with -fPIC
+.if ${MACHINE_ARCH} == "powerpc64"
+COPTS.libdm-nbsd-iface.c+= -O0
+.endif
+
 .PATH: ${LIBDEVMAPPER_DISTDIR}/
 .PATH: ${LIBDEVMAPPER_DISTDIR}/datastruct
 .PATH: ${LIBDEVMAPPER_DISTDIR}/mm



CVS commit: src/external/gpl2/lvm2/dist/man

2016-06-09 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Thu Jun  9 09:01:21 UTC 2016

Modified Files:
src/external/gpl2/lvm2/dist/man: dmsetup.8

Log Message:
Fix typo: processess -> processes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/man/dmsetup.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/man/dmsetup.8
diff -u src/external/gpl2/lvm2/dist/man/dmsetup.8:1.2 src/external/gpl2/lvm2/dist/man/dmsetup.8:1.3
--- src/external/gpl2/lvm2/dist/man/dmsetup.8:1.2	Wed Feb 18 12:16:13 2009
+++ src/external/gpl2/lvm2/dist/man/dmsetup.8	Thu Jun  9 09:01:21 2016
@@ -1,4 +1,4 @@
-.\"$NetBSD: dmsetup.8,v 1.2 2009/02/18 12:16:13 haad Exp $
+.\"$NetBSD: dmsetup.8,v 1.3 2016/06/09 09:01:21 abhinav Exp $
 .\"
 .TH DMSETUP 8 "Apr 06 2006" "Linux" "MAINTENANCE COMMANDS"
 .SH NAME
@@ -234,7 +234,7 @@ process to be killed.
 .br
 Attempts to remove all device definitions i.e. reset the driver.
 Use with care!  From version 4.8.0 onwards, if devices can't
-be removed because uninterruptible processess are waiting for
+be removed because uninterruptible processes are waiting for
 I/O to return from them, adding --force will replace the table 
 with one that fails all I/O, which might allow the 
 process to be killed.  This also runs \fBmknodes\fP afterwards.



CVS commit: src/external/gpl2/lvm2/dist/daemons/clvmd

2015-11-08 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Nov  9 00:53:57 UTC 2015

Modified Files:
src/external/gpl2/lvm2/dist/daemons/clvmd: clvmd.c

Log Message:
Don't use %m in format strings sent to printf.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c
diff -u src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c:1.1.1.3 src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c:1.2
--- src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c:1.1.1.3	Wed Dec  2 00:27:05 2009
+++ src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c	Mon Nov  9 00:53:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: clvmd.c,v 1.1.1.3 2009/12/02 00:27:05 haad Exp $	*/
+/*	$NetBSD: clvmd.c,v 1.2 2015/11/09 00:53:57 dholland Exp $	*/
 
 /*
  * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
@@ -924,12 +924,13 @@ static void be_daemon(int timeout)
 
 	if (dup2(devnull, 0) < 0 || dup2(devnull, 1) < 0
 	|| dup2(devnull, 2) < 0) {
+		int e = errno;
 		perror("Error setting terminal FDs to /dev/null");
-		log_error("Error setting terminal FDs to /dev/null: %m");
+		log_error("Error setting terminal FDs to /dev/null: %s", strerror(e));
 		exit(5);
 	}
 	if (chdir("/")) {
-		log_error("Error setting current directory to /: %m");
+		log_error("Error setting current directory to /: %s", strerror(e));
 		exit(6);
 	}
 
@@ -1492,7 +1493,7 @@ static __attribute__ ((noreturn)) void *
 			if (write_status < 0 &&
 			(errno == EINTR || errno == EAGAIN))
 continue;
-			log_error("Error sending to pipe: %m\n");
+			log_error("Error sending to pipe: %s\n", strerror(errno));
 			break;
 		} while(1);
 
@@ -1525,7 +1526,7 @@ static __attribute__ ((noreturn)) void *
 			if (write_status < 0 &&
 			(errno == EINTR || errno == EAGAIN))
 continue;
-			log_error("Error sending to pipe: %m\n");
+			log_error("Error sending to pipe: %s\n", strerror(errno));
 			break;
 		} while(1);
 next_pre:
@@ -1934,7 +1935,7 @@ static int open_local_sock()
 		unlink(CLVMD_SOCKNAME);
 	local_socket = socket(PF_UNIX, SOCK_STREAM, 0);
 	if (local_socket < 0) {
-		log_error("Can't create local socket: %m");
+		log_error("Can't create local socket: %s", strerror(errno));
 		return -1;
 	}
 	/* Set Close-on-exec & non-blocking */
@@ -1945,12 +1946,12 @@ static int open_local_sock()
 	memcpy(sockaddr.sun_path, CLVMD_SOCKNAME, sizeof(CLVMD_SOCKNAME));
 	sockaddr.sun_family = AF_UNIX;
 	if (bind(local_socket, (struct sockaddr *) , sizeof(sockaddr))) {
-		log_error("can't bind local socket: %m");
+		log_error("can't bind local socket: %s", strerror(errno));
 		close(local_socket);
 		return -1;
 	}
 	if (listen(local_socket, 1) != 0) {
-		log_error("listen local: %m");
+		log_error("listen local: %s", strerror(errno));
 		close(local_socket);
 		return -1;
 	}



CVS commit: src/external/gpl2/lvm2/lib/libdevmapper

2014-11-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Nov 19 10:37:29 UTC 2014

Modified Files:
src/external/gpl2/lvm2/lib/libdevmapper: libdm-netbsd.h

Log Message:
Close comment.
From Henning Petersen in PR 49403.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h
diff -u src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h:1.3 src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h:1.4
--- src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h:1.3	Tue Feb  8 10:45:40 2011
+++ src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h	Wed Nov 19 10:37:29 2014
@@ -1,4 +1,4 @@
-/*$NetBSD: libdm-netbsd.h,v 1.3 2011/02/08 10:45:40 rmind Exp $
+/*$NetBSD: libdm-netbsd.h,v 1.4 2014/11/19 10:37:29 wiz Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.



CVS commit: src/external/gpl2/lvm2/dist/lib/format1

2014-11-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Nov 15 01:24:53 UTC 2014

Modified Files:
src/external/gpl2/lvm2/dist/lib/format1: import-export.c

Log Message:
Remove tautologic check.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl2/lvm2/dist/lib/format1/import-export.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/format1/import-export.c
diff -u src/external/gpl2/lvm2/dist/lib/format1/import-export.c:1.1.1.2 src/external/gpl2/lvm2/dist/lib/format1/import-export.c:1.2
--- src/external/gpl2/lvm2/dist/lib/format1/import-export.c:1.1.1.2	Wed Dec  2 00:26:49 2009
+++ src/external/gpl2/lvm2/dist/lib/format1/import-export.c	Sat Nov 15 01:24:53 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: import-export.c,v 1.1.1.2 2009/12/02 00:26:49 haad Exp $	*/
+/*	$NetBSD: import-export.c,v 1.2 2014/11/15 01:24:53 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -187,7 +187,7 @@ int export_pv(struct cmd_context *cmd, s
 	}
 
 	/* Generate system_id if PV is in VG */
-	if (!pvd-system_id || !*pvd-system_id)
+	if (!pvd-system_id[0])
 		if (!_system_id(cmd, (char *)pvd-system_id, ))
 			return_0;
 



CVS commit: src/external/gpl2/lvm2/dist/lib/commands

2014-11-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Nov 15 01:24:38 UTC 2014

Modified Files:
src/external/gpl2/lvm2/dist/lib/commands: toolcontext.c

Log Message:
Comment out impossible code.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c
diff -u src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.7 src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.8
--- src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.7	Sat Dec  5 01:52:44 2009
+++ src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c	Sat Nov 15 01:24:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: toolcontext.c,v 1.7 2009/12/05 01:52:44 haad Exp $	*/
+/*	$NetBSD: toolcontext.c,v 1.8 2014/11/15 01:24:38 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -992,12 +992,14 @@ static int _init_backup(struct cmd_conte
 	char default_dir[PATH_MAX];
 	const char *dir;
 
+#if 0
 	if (!cmd-system_dir) {
 		log_warn(WARNING: Metadata changes will NOT be backed up);
 		backup_init(cmd, , 0);
 		archive_init(cmd, , 0, 0, 0);
 		return 1;
 	}
+#endif
 
 	/* set up archiving */
 	cmd-default_settings.archive =



CVS commit: src/external/gpl2/lvm2/dist

2014-02-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb 20 02:09:58 UTC 2014

Modified Files:
src/external/gpl2/lvm2/dist/include: xlate.h
src/external/gpl2/lvm2/dist/lib/mm: xlate.h

Log Message:
Use sys/endian.h for bswapXX.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/lvm2/dist/include/xlate.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/lvm2/dist/lib/mm/xlate.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/xlate.h
diff -u src/external/gpl2/lvm2/dist/include/xlate.h:1.1.1.1 src/external/gpl2/lvm2/dist/include/xlate.h:1.2
--- src/external/gpl2/lvm2/dist/include/xlate.h:1.1.1.1	Mon Dec 22 00:18:44 2008
+++ src/external/gpl2/lvm2/dist/include/xlate.h	Thu Feb 20 02:09:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: xlate.h,v 1.1.1.1 2008/12/22 00:18:44 haad Exp $	*/
+/*	$NetBSD: xlate.h,v 1.2 2014/02/20 02:09:58 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
@@ -21,6 +21,11 @@
 #ifdef linux
 #  include endian.h
 #  include byteswap.h
+#elif defined(__NetBSD__)
+#  include sys/endian.h
+#  define bswap_16(x) bswap16(x)
+#  define bswap_32(x) bswap32(x)
+#  define bswap_64(x) bswap64(x)
 #else
 #  include machine/endian.h
 #  define bswap_16(x) (((x)  0x00ffU)  8 | \

Index: src/external/gpl2/lvm2/dist/lib/mm/xlate.h
diff -u src/external/gpl2/lvm2/dist/lib/mm/xlate.h:1.1.1.1 src/external/gpl2/lvm2/dist/lib/mm/xlate.h:1.2
--- src/external/gpl2/lvm2/dist/lib/mm/xlate.h:1.1.1.1	Mon Dec 22 00:18:13 2008
+++ src/external/gpl2/lvm2/dist/lib/mm/xlate.h	Thu Feb 20 02:09:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: xlate.h,v 1.1.1.1 2008/12/22 00:18:13 haad Exp $	*/
+/*	$NetBSD: xlate.h,v 1.2 2014/02/20 02:09:58 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
@@ -21,6 +21,11 @@
 #ifdef linux
 #  include endian.h
 #  include byteswap.h
+#elif defined(__NetBSD__)
+#  include sys/endian.h
+#  define bswap_16(x) bswap16(x)
+#  define bswap_32(x) bswap32(x)
+#  define bswap_64(x) bswap64(x)
 #else
 #  include machine/endian.h
 #  define bswap_16(x) (((x)  0x00ffU)  8 | \



CVS commit: src/external/gpl2/lvm2/lib/liblvm

2014-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 14 19:58:19 UTC 2014

Modified Files:
src/external/gpl2/lvm2/lib/liblvm: Makefile

Log Message:
USE_SSP is defined in bsd.own.mk


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/lib/liblvm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/liblvm/Makefile
diff -u src/external/gpl2/lvm2/lib/liblvm/Makefile:1.6 src/external/gpl2/lvm2/lib/liblvm/Makefile:1.7
--- src/external/gpl2/lvm2/lib/liblvm/Makefile:1.6	Wed May  2 09:35:03 2012
+++ src/external/gpl2/lvm2/lib/liblvm/Makefile	Tue Jan 14 14:58:19 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2012/05/02 13:35:03 cheusov Exp $
+#	$NetBSD: Makefile,v 1.7 2014/01/14 19:58:19 christos Exp $
 
 LIBISPRIVATE=	yes
 
@@ -15,7 +15,6 @@ CPPFLAGS+=	-I${LVM2_DISTDIR}/lib -I${LVM
 		-I. 
 
 .include bsd.own.mk
-.include bsd.sys.mk # for USE_SSP
 
 # Some parts of liblvm can't be protected because if its
 # alloca() usage.



CVS commit: src/external/gpl2/lvm2/sbin/lvm

2014-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 14 20:22:35 UTC 2014

Modified Files:
src/external/gpl2/lvm2/sbin/lvm: Makefile

Log Message:
USE_SSP is not defined in bsd.sys.mk


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl2/lvm2/sbin/lvm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/sbin/lvm/Makefile
diff -u src/external/gpl2/lvm2/sbin/lvm/Makefile:1.11 src/external/gpl2/lvm2/sbin/lvm/Makefile:1.12
--- src/external/gpl2/lvm2/sbin/lvm/Makefile:1.11	Wed May  2 09:35:04 2012
+++ src/external/gpl2/lvm2/sbin/lvm/Makefile	Tue Jan 14 15:22:35 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2012/05/02 13:35:04 cheusov Exp $
+#	$NetBSD: Makefile,v 1.12 2014/01/14 20:22:35 christos Exp $
 
 USE_FORT?=	no
 NOLINT=		#defined
@@ -31,7 +31,6 @@ CPPFLAGS+=	-I${LVM2_DISTDIR}/lib -I${LVM
 CPPFLAGS+=	-DLVM_SHARED_PATH=\$(BINDIR)/lvm\
 
 .include bsd.own.mk
-.include bsd.sys.mk # for USE_SSP
 
 # Some parts of the code can't be protected because if its
 # alloca() usage.



CVS commit: src/external/gpl2/lvm2

2012-05-02 Thread Aleksey Cheusov
Module Name:src
Committed By:   cheusov
Date:   Wed May  2 13:35:04 UTC 2012

Modified Files:
src/external/gpl2/lvm2/lib/liblvm: Makefile
src/external/gpl2/lvm2/sbin/lvm: Makefile

Log Message:
Add .include bsd.sys.mk for initializing USE_SSP.
   This fixes build failure if USE_FORT=YES
   Approved by christos@


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/lvm2/lib/liblvm/Makefile
cvs rdiff -u -r1.10 -r1.11 src/external/gpl2/lvm2/sbin/lvm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/liblvm/Makefile
diff -u src/external/gpl2/lvm2/lib/liblvm/Makefile:1.5 src/external/gpl2/lvm2/lib/liblvm/Makefile:1.6
--- src/external/gpl2/lvm2/lib/liblvm/Makefile:1.5	Thu May 26 12:56:26 2011
+++ src/external/gpl2/lvm2/lib/liblvm/Makefile	Wed May  2 13:35:03 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2011/05/26 12:56:26 joerg Exp $
+#	$NetBSD: Makefile,v 1.6 2012/05/02 13:35:03 cheusov Exp $
 
 LIBISPRIVATE=	yes
 
@@ -14,6 +14,9 @@ CWARNFLAGS+=	-Wno-parentheses
 CPPFLAGS+=	-I${LVM2_DISTDIR}/lib -I${LVM2_DISTDIR}/include \
 		-I. 
 
+.include bsd.own.mk
+.include bsd.sys.mk # for USE_SSP
+
 # Some parts of liblvm can't be protected because if its
 # alloca() usage.
 #

Index: src/external/gpl2/lvm2/sbin/lvm/Makefile
diff -u src/external/gpl2/lvm2/sbin/lvm/Makefile:1.10 src/external/gpl2/lvm2/sbin/lvm/Makefile:1.11
--- src/external/gpl2/lvm2/sbin/lvm/Makefile:1.10	Thu May 26 12:56:26 2011
+++ src/external/gpl2/lvm2/sbin/lvm/Makefile	Wed May  2 13:35:04 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2011/05/26 12:56:26 joerg Exp $
+#	$NetBSD: Makefile,v 1.11 2012/05/02 13:35:04 cheusov Exp $
 
 USE_FORT?=	no
 NOLINT=		#defined
@@ -30,6 +30,9 @@ CPPFLAGS+=	-I${LVM2_DISTDIR}/lib -I${LVM
 
 CPPFLAGS+=	-DLVM_SHARED_PATH=\$(BINDIR)/lvm\
 
+.include bsd.own.mk
+.include bsd.sys.mk # for USE_SSP
+
 # Some parts of the code can't be protected because if its
 # alloca() usage.
 #



CVS commit: src/external/gpl2/lvm2/dist/lib/filters

2012-01-04 Thread Michael L. Hitch
Module Name:src
Committed By:   mhitch
Date:   Wed Jan  4 16:37:45 UTC 2012

Modified Files:
src/external/gpl2/lvm2/dist/lib/filters: filter_netbsd.c

Log Message:
Add logical drive device ld - a number of raid controllers provide these.
Also fix a typo/pasto when checking devices against devices/types in the
configuration file:  use value from configuration, not the end of the
device_info table.  Devices which aren't explicitly specified in the
device_info table can now be used by adding a type entry in the config
file.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c
diff -u src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c:1.3 src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c:1.4
--- src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c:1.3	Wed Dec  2 01:53:25 2009
+++ src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c	Wed Jan  4 16:37:45 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: filter_netbsd.c,v 1.3 2009/12/02 01:53:25 haad Exp $*/
+/*  $NetBSD: filter_netbsd.c,v 1.4 2012/01/04 16:37:45 mhitch Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -82,6 +82,7 @@ static const device_info_t device_info[]
 	{cgd, 1},
 	{ccd, 1},	
 	{xbd, 64},
+	{ld, 64},
 	{NULL, -1}
 };
 
@@ -221,9 +222,9 @@ static int _scan_dev(const struct config
 			
 			if (!strncmp(name, kd[i].d_name, strlen(name))){
 	_char_device_major[kd[i].d_cmajor] =
-	device_info[j].max_partitions;
+	cv-v.i;
 	_block_device_major[kd[i].d_bmajor] =
-	device_info[j].max_partitions;
+	cv-v.i;
 	break;
 			}
 		}



CVS commit: src/external/gpl2/lvm2/dist/lib/report

2011-05-30 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 30 16:03:02 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/lib/report: report.c

Log Message:
Pull in report.c, 1.107 from upstream:
Use offsetof() macro and avoid defining dummy static union for FIELD()
macro.  Makes it compilable by clang compiler.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl2/lvm2/dist/lib/report/report.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/report/report.c
diff -u src/external/gpl2/lvm2/dist/lib/report/report.c:1.1.1.3 src/external/gpl2/lvm2/dist/lib/report/report.c:1.2
--- src/external/gpl2/lvm2/dist/lib/report/report.c:1.1.1.3	Wed Dec  2 00:26:46 2009
+++ src/external/gpl2/lvm2/dist/lib/report/report.c	Mon May 30 16:03:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: report.c,v 1.1.1.3 2009/12/02 00:26:46 haad Exp $	*/
+/*	$NetBSD: report.c,v 1.2 2011/05/30 16:03:02 joerg Exp $	*/
 
 /*
  * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
@@ -26,6 +26,8 @@
 #include str_list.h
 #include lvmcache.h
 
+#include stddef.h /* offsetof() */
+
 struct lvm_report_object {
 	struct volume_group *vg;
 	struct logical_volume *lv;
@@ -34,17 +36,6 @@
 	struct pv_segment *pvseg;
 };
 
-/*
- * For macro use
- */
-static union {
-	struct physical_volume _pv;
-	struct logical_volume _lv;
-	struct volume_group _vg;
-	struct lv_segment _seg;
-	struct pv_segment _pvseg;
-} _dummy;
-
 static char _alloc_policy_char(alloc_policy_t alloc)
 {
 	switch (alloc) {
@@ -1158,9 +1149,17 @@
 
 #define STR DM_REPORT_FIELD_TYPE_STRING
 #define NUM DM_REPORT_FIELD_TYPE_NUMBER
-#define FIELD(type, strct, sorttype, head, field, width, func, id, desc) {type, sorttype, (off_t)((uintptr_t)_dummy._ ## strct.field - (uintptr_t)_dummy._ ## strct), width, id, head, _ ## func ## _disp, desc},
+#define FIELD(type, strct, sorttype, head, field, width, func, id, desc) \
+	{type, sorttype, offsetof(type_ ## strct, field), width, \
+	 id, head, _ ## func ## _disp, desc},
+
+typedef struct physical_volume type_pv;
+typedef struct logical_volume type_lv;
+typedef struct volume_group type_vg;
+typedef struct lv_segment type_seg;
+typedef struct pv_segment type_pvseg;
 
-static struct dm_report_field_type _fields[] = {
+static const struct dm_report_field_type _fields[] = {
 #include columns.h
 {0, 0, 0, 0, , , NULL, NULL},
 };



CVS commit: src/external/gpl2/lvm2/dist/lib/format_text

2011-05-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue May 24 15:51:00 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/lib/format_text: export.c

Log Message:
Fix printing of time_t


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/gpl2/lvm2/dist/lib/format_text/export.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/format_text/export.c
diff -u src/external/gpl2/lvm2/dist/lib/format_text/export.c:1.1.1.3 src/external/gpl2/lvm2/dist/lib/format_text/export.c:1.2
--- src/external/gpl2/lvm2/dist/lib/format_text/export.c:1.1.1.3	Wed Dec  2 00:26:29 2009
+++ src/external/gpl2/lvm2/dist/lib/format_text/export.c	Tue May 24 15:51:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: export.c,v 1.1.1.3 2009/12/02 00:26:29 haad Exp $	*/
+/*	$NetBSD: export.c,v 1.2 2011/05/24 15:51:00 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -346,7 +346,7 @@
 	outf(f, creation_host = \%s\\t# %s %s %s %s %s, _utsname.nodename,
 	 _utsname.sysname, _utsname.nodename, _utsname.release,
 	 _utsname.version, _utsname.machine);
-	outf(f, creation_time = %lu\t# %s, t, ctime(t));
+	outf(f, creation_time = %jd\t# %s, (intmax_t)t, ctime(t));
 
 	return 1;
 }



CVS commit: src/external/gpl2/lvm2/dist/include

2011-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 15 01:13:30 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/include: lvm-globals.h

Log Message:
copy from misc directory


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl2/lvm2/dist/include/lvm-globals.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/lvm-globals.h
diff -u src/external/gpl2/lvm2/dist/include/lvm-globals.h:1.1.1.2 src/external/gpl2/lvm2/dist/include/lvm-globals.h:1.2
--- src/external/gpl2/lvm2/dist/include/lvm-globals.h:1.1.1.2	Wed Feb 18 06:16:46 2009
+++ src/external/gpl2/lvm2/dist/include/lvm-globals.h	Sat May 14 21:13:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: lvm-globals.h,v 1.1.1.2 2009/02/18 11:16:46 haad Exp $	*/
+/*	$NetBSD: lvm-globals.h,v 1.2 2011/05/15 01:13:29 christos Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
@@ -21,6 +21,11 @@
 #define VERBOSE_BASE_LEVEL _LOG_WARN
 #define SECURITY_LEVEL 0
 
+#ifdef __NetBSD__
+void init_operator(int operator);
+int  is_operator(void);
+#endif
+
 void init_verbose(int level);
 void init_test(int level);
 void init_md_filtering(int level);



CVS commit: src/external/gpl2/lvm2/dist/lib/netbsd

2011-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 15 01:16:29 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/lib/netbsd: dev.c

Log Message:
missing string.h


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/netbsd/dev.c
diff -u src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.2 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.3
--- src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.2	Fri Oct 16 17:00:41 2009
+++ src/external/gpl2/lvm2/dist/lib/netbsd/dev.c	Sat May 14 21:16:29 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: dev.c,v 1.2 2009/10/16 21:00:41 joerg Exp $*/
+/*  $NetBSD: dev.c,v 1.3 2011/05/15 01:16:29 christos Exp $*/
 
 /*
  * NetBSD specific device routines are added to this file.
@@ -11,6 +11,7 @@
 
 #include dirent.h
 #include stdio.h
+#include string.h
 #include stdlib.h
 #include unistd.h
 #include ctype.h



CVS commit: src/external/gpl2/lvm2

2011-03-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Mar  4 22:48:29 UTC 2011

Modified Files:
src/external/gpl2/lvm2: lvm2tools.mk
src/external/gpl2/lvm2/lib/libdevmapper: Makefile
src/external/gpl2/lvm2/sbin/dmsetup: Makefile
src/external/gpl2/lvm2/sbin/lvm: Makefile

Log Message:
Use static libdm so dmsetup and lvm can be linked dynamically.
Change LIBDM_* to LIBDEVMAPPER_* so LIBDM can refer to libdm.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/lvm2/lvm2tools.mk
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/lib/libdevmapper/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/sbin/dmsetup/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/gpl2/lvm2/sbin/lvm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lvm2tools.mk
diff -u src/external/gpl2/lvm2/lvm2tools.mk:1.3 src/external/gpl2/lvm2/lvm2tools.mk:1.4
--- src/external/gpl2/lvm2/lvm2tools.mk:1.3	Wed Jan  5 14:57:27 2011
+++ src/external/gpl2/lvm2/lvm2tools.mk	Fri Mar  4 22:48:29 2011
@@ -1,20 +1,22 @@
-#	$NetBSD: lvm2tools.mk,v 1.3 2011/01/05 14:57:27 haad Exp $
+#	$NetBSD: lvm2tools.mk,v 1.4 2011/03/04 22:48:29 matt Exp $
 
 .include bsd.own.mk
 
 LVM2_SRCDIR=	${NETBSDSRCDIR}/external/gpl2/lvm2
 LVM2_DISTDIR=	${NETBSDSRCDIR}/external/gpl2/lvm2/dist
 
-LIBDM_SRCDIR=		${NETBSDSRCDIR}/external/gpl2/lvm2/lib/libdevmapper
-LIBDM_DISTDIR=		${NETBSDSRCDIR}/external/gpl2/lvm2/dist/libdm
-LIBDM_INCLUDE=		${NETBSDSRCDIR}/external/gpl2/lvm2/dist/include
+LIBDEVMAPPER_SRCDIR=		${LVM2_SRCDIR}/lib/libdevmapper
+LIBDEVMAPPER_DISTDIR=		${LVM2_DISTDIR}/libdm
+LIBDEVMAPPER_INCLUDE=		${LVM2_DISTDIR}/include
+
+LIBDM_SRCDIR=			${NETBSDSRCDIR}/lib/libdm
 
 # root:operator [cb]rw-r-
 CPPFLAGS+=-DDM_DEVICE_UID=0 -DDM_DEVICE_GID=5 -DDM_DEVICE_MODE=0640 \
 	  -DDM_CONTROL_DEVICE_MODE=0660 -DLVM_LOCKDIR_MODE=0770
 
 #
-#LIBDM_OBJDIR.libdevmapper=${LIBDM_SRCDIR}/lib/libdevmapper/
+#LIBDEVMAPPER_OBJDIR.libdevmapper=${LIBDEVMAPPER_SRCDIR}/lib/libdevmapper/
 #
 #.if !defined(LVM2OBJDIR.liblvm)
 #LVM2OBJDIR.liblvm!=	cd ${LVM2_SRCDIR}/lib/liblvm  ${PRINTOBJDIR}

Index: src/external/gpl2/lvm2/lib/libdevmapper/Makefile
diff -u src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.6 src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.7
--- src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.6	Fri Feb 11 06:35:26 2011
+++ src/external/gpl2/lvm2/lib/libdevmapper/Makefile	Fri Mar  4 22:48:29 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2011/02/11 06:35:26 matt Exp $
+#	$NetBSD: Makefile,v 1.7 2011/03/04 22:48:29 matt Exp $
 
 USE_SHLIBDIR=	yes
 USE_FORT?=	no
@@ -8,10 +8,14 @@
 
 LIB=		devmapper
 
-CPPFLAGS+=	-I${LIBDM_DISTDIR} -I${LIBDM_DISTDIR}/misc -I${LIBDM_DISTDIR}/mm \
-		-I${LIBDM_DISTDIR}/datastruct -I${LIBDM_DISTDIR}/ioctl \
-		-I${LVM2_DISTDIR}/include -I${LIBDM_SRCDIR} -D__NetBSD__
-
+CPPFLAGS+=	-I${LIBDEVMAPPER_DISTDIR} \
+		-I${LIBDEVMAPPER_DISTDIR}/misc \
+		-I${LIBDEVMAPPER_DISTDIR}/mm \
+		-I${LIBDEVMAPPER_DISTDIR}/datastruct \
+		-I${LIBDEVMAPPER_DISTDIR}/ioctl \
+		-I${LVM2_DISTDIR}/include \
+		-I${LIBDEVMAPPER_SRCDIR} \
+		-D__NetBSD__
 
 CPPFLAGS+=	-D__LIB_DEVMAPPER__ 
 
@@ -29,10 +33,10 @@
 DBG=-g
 .endif
 
-.PATH: ${LIBDM_DISTDIR}/
-.PATH: ${LIBDM_DISTDIR}/datastruct
-.PATH: ${LIBDM_DISTDIR}/mm
-.PATH: ${LIBDM_DISTDIR}/regex
-.PATH: ${LIBDM_DISTDIR}/ioctl
+.PATH: ${LIBDEVMAPPER_DISTDIR}/
+.PATH: ${LIBDEVMAPPER_DISTDIR}/datastruct
+.PATH: ${LIBDEVMAPPER_DISTDIR}/mm
+.PATH: ${LIBDEVMAPPER_DISTDIR}/regex
+.PATH: ${LIBDEVMAPPER_DISTDIR}/ioctl
 
 .include bsd.lib.mk

Index: src/external/gpl2/lvm2/sbin/dmsetup/Makefile
diff -u src/external/gpl2/lvm2/sbin/dmsetup/Makefile:1.6 src/external/gpl2/lvm2/sbin/dmsetup/Makefile:1.7
--- src/external/gpl2/lvm2/sbin/dmsetup/Makefile:1.6	Tue Feb  8 03:26:13 2011
+++ src/external/gpl2/lvm2/sbin/dmsetup/Makefile	Fri Mar  4 22:48:29 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2011/02/08 03:26:13 haad Exp $
+#	$NetBSD: Makefile,v 1.7 2011/03/04 22:48:29 matt Exp $
 
 USE_FORT?=	no
 NOLINT=		#defined
@@ -15,18 +15,23 @@
 
 #CFLAGS+= -g -O0
 
-CPPFLAGS+=  -I${LIBDM_DISTDIR}/ -I${LIBDM_DISTDIR}/misc \
-		-I. -I${LIBDM_DISTDIR}/ioctl -I${LVM2_DISTDIR}/include
+CPPFLAGS+=  -I${LIBDEVMAPPER_DISTDIR}/ -I${LIBDEVMAPPER_DISTDIR}/misc \
+		-I. -I${LIBDEVMAPPER_DISTDIR}/ioctl -I${LVM2_DISTDIR}/include
 
 CPPFLAGS+=	-D__LIB_DEVMAPPER__
 
+LIBDEVMAPPER_OBJDIR!=	cd ${LIBDEVMAPPER_SRCDIR}  ${PRINTOBJDIR}
+LDADD+=		-L${LIBDEVMAPPER_OBJDIR} -ldevmapper
+DPADD+=		${LIBDEVMAPPER_OBJDIR}/libdevmapper.a
+
 LIBDM_OBJDIR!=	cd ${LIBDM_SRCDIR}  ${PRINTOBJDIR}
-LDADD+=		-L${LIBDM_OBJDIR} -ldevmapper
-DPADD+=		${LIBDM_OBJDIR}/libdevmapper.a
+#LDADD+=		-L${LIBDM_OBJDIR} -ldm
+LDADD+=		${LIBDM_OBJDIR}/libdm.a
+DPADD+=		${LIBDM_OBJDIR}/libdm.a
 
-LDADD+=		-ldm -lprop
+LDADD+=		-lprop
 
-LDSTATIC= -static
+#LDSTATIC= -static
 .PATH:	

CVS commit: src/external/gpl2/lvm2/lib/libdevmapper

2011-02-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 11 06:35:26 UTC 2011

Modified Files:
src/external/gpl2/lvm2/lib/libdevmapper: Makefile

Log Message:
Use LIBDPLIBS


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/lvm2/lib/libdevmapper/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/libdevmapper/Makefile
diff -u src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.5 src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.6
--- src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.5	Thu Dec 23 17:46:55 2010
+++ src/external/gpl2/lvm2/lib/libdevmapper/Makefile	Fri Feb 11 06:35:26 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2010/12/23 17:46:55 christos Exp $
+#	$NetBSD: Makefile,v 1.6 2011/02/11 06:35:26 matt Exp $
 
 USE_SHLIBDIR=	yes
 USE_FORT?=	no
@@ -15,7 +15,7 @@
 
 CPPFLAGS+=	-D__LIB_DEVMAPPER__ 
 
-LDADD+=		-lprop
+LIBDPLIBS+=	prop ${NETBSDSRCDIR}/lib/libprop
 
 SRCS+=		bitset.c hash.c list.c libdm-common.c libdm-file.c \
 		libdm-deptree.c	libdm-string.c libdm-report.c \



CVS commit: src/external/gpl2/lvm2/lib/libdevmapper

2011-02-08 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Feb  8 10:45:40 UTC 2011

Modified Files:
src/external/gpl2/lvm2/lib/libdevmapper: libdm-netbsd.h

Log Message:
Build fix.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h
diff -u src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h:1.2 src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h:1.3
--- src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h:1.2	Tue Feb  8 03:26:13 2011
+++ src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h	Tue Feb  8 10:45:40 2011
@@ -1,4 +1,4 @@
-/*$NetBSD: libdm-netbsd.h,v 1.2 2011/02/08 03:26:13 haad Exp $
+/*$NetBSD: libdm-netbsd.h,v 1.3 2011/02/08 10:45:40 rmind Exp $
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define __LIB_DM_H__
 
 #include prop/proplib.h
-#include libdm.h
+#include dm.h
 
 #  define MAJOR(x) major((x))
 #  define MINOR(x) minor((x))



CVS commit: src/external/gpl2/lvm2

2011-02-07 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Tue Feb  8 03:26:13 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c
libdm_netbsd.c
src/external/gpl2/lvm2/lib/libdevmapper: libdm-netbsd.h
src/external/gpl2/lvm2/sbin/dmsetup: Makefile
src/external/gpl2/lvm2/sbin/lvm: Makefile

Log Message:
Switch libdevmapper library to use libdm as it;s backend lib and do not
communicate with device-mapper directly. Our lvm stack now looks like this
lvm-libdevmapper-libdm-dm where only libdm knows how our dm protocol
looks like.

No objections on tech-userlevel@.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/lvm2/sbin/dmsetup/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/lvm2/sbin/lvm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.10 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.11
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.10	Wed Jan 12 08:16:23 2011
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Tue Feb  8 03:26:12 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.10 2011/01/12 08:16:23 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.11 2011/02/08 03:26:12 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -28,6 +28,7 @@
 #include dirent.h
 #include limits.h
 
+#include dm.h
 #include dev/dm/netbsd-dm.h
 
 #include dm-ioctl.h
@@ -38,8 +39,8 @@
 #endif
 
 /*
- * Ensure build compatibility.  
- * The hard-coded versions here are the highest present 
+ * Ensure build compatibility.
+ * The hard-coded versions here are the highest present
  * in the _cmd_data arrays.
  */
 
@@ -104,9 +105,9 @@
 {
 
 	nbsd_get_dm_major(major, DM_CHAR_MAJOR);
-	
+
 	*minor = 0;
-	
+
 	return 1;
 }
 
@@ -185,7 +186,7 @@
 	uint32_t dm_major;
 
 	nbsd_get_dm_major(dm_major, DM_BLOCK_MAJOR);
-	
+
 	if (major == dm_major)
 		return 1;
 
@@ -201,7 +202,7 @@
 	if (_control_fd != -1)
 		return 1;
 
-#ifdef RUMP_ACTION	
+#ifdef RUMP_ACTION
 	rump_init();
 #endif
 	snprintf(control, sizeof(control), %s/control, dm_dir());
@@ -297,7 +298,7 @@
 }
 
 /*
- * Find out device-mapper's major version number the first time 
+ * Find out device-mapper's major version number the first time
  * this is called and whether or not we support it.
  */
 int dm_check_version(void)
@@ -422,14 +423,14 @@
 	dev_t dev;
 	size_t val_len,i;
 	struct kinfo_drivers *kd;
-	
+
 	mode = 0;
-	
+
 	nbsd_get_dm_major(dm_major, DM_BLOCK_MAJOR);
 
 	if (bufsize  8)
 		return 0;
-	
+
 	if (sysctlbyname(kern.drivers,NULL,val_len,NULL,0)  0) {
 		printf(sysctlbyname failed);
 		return 0;
@@ -451,7 +452,7 @@
 			break;
 		}
 	}
-	
+
 	dev = MKDEV(major,dev_minor);
 
 	mode |= S_IFBLK;
@@ -489,10 +490,10 @@
 	info-target_count = dmt-dmi.v4-target_count;
 	info-open_count = dmt-dmi.v4-open_count;
 	info-event_nr = dmt-dmi.v4-event_nr;
-	
+
 	nbsd_get_dm_major(info-major, DM_BLOCK_MAJOR); /* get netbsd dm device major number */
 	info-minor = MINOR(dmt-dmi.v4-dev);
-	
+
 	return 1;
 }
 
@@ -657,44 +658,39 @@
 }
 
 /* Parse given dm task structure to proplib dictionary.  */
-static int _flatten(struct dm_task *dmt, prop_dictionary_t dm_dict)
+static int _flatten(struct dm_task *dmt, libdm_task_t task)
 {
-	prop_array_t cmd_array;
-	prop_dictionary_t target_spec;
-	
+	libdm_cmd_t cmd;
+	libdm_table_t table;
+
 	struct target *t;
-	
+
 	size_t len;
 	char type[DM_MAX_TYPE_NAME];
-	
+
 	uint32_t major, flags;
 	int count = 0;
-	const int (*version)[3];
-	
+
 	flags = 0;
-	version = _cmd_data_v4[dmt-type].version;
 
-	cmd_array = prop_array_create();
+	cmd = libdm_cmd_create();
 
 	for (t = dmt-head; t; t = t-next) {
-		target_spec = prop_dictionary_create();
-
-		prop_dictionary_set_uint64(target_spec,DM_TABLE_START,t-start);
-		prop_dictionary_set_uint64(target_spec,DM_TABLE_LENGTH,t-length);
-
 		strlcpy(type,t-type,DM_MAX_TYPE_NAME);
 
-		prop_dictionary_set_cstring(target_spec,DM_TABLE_TYPE,type);
-		prop_dictionary_set_cstring(target_spec,DM_TABLE_PARAMS,t-params);
+		table = libdm_table_create();
+
+		libdm_table_set_start(t-start, table);
+		libdm_table_set_length(t-length, table);
+		libdm_table_set_target(type, table);
+		libdm_table_set_params(t-params, table);
+		libdm_cmd_set_table(table, cmd);
 
-		prop_array_set(cmd_array,count,target_spec);
+		libdm_table_destroy(table);
 
-		prop_object_release(target_spec);
-		
 		count++;
 	}
 
-	
 	if (count 

CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2011-01-12 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Jan 12 08:16:23 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Use DM_DEVICE_CONTROL_MODE, because mapper/control device should have 660
and not 640 permissions.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.9 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.10
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.9	Sun Dec 26 14:48:34 2010
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Wed Jan 12 08:16:23 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.9 2010/12/26 14:48:34 christos Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.10 2011/01/12 08:16:23 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -163,7 +163,7 @@
 	log_verbose(Creating device %s (%u, %u), control, major, minor);
 
 	old_umask = umask(0);
-	if (mknod(control, S_IFCHR | DM_DEVICE_MODE,
+	if (mknod(control, S_IFCHR | DM_CONTROL_DEVICE_MODE,
 		  MKDEV(major, minor))  0)  {
 		umask(old_umask);
 		log_sys_error(mknod, control);



CVS commit: src/external/gpl2/lvm2/dist/libdm

2010-12-29 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec 29 10:39:28 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/libdm: libdm-common.c

Log Message:
Fix problem where chown was used on normal device in time when only
raw device was created. While here do some cleanup.

Problem find and reported by Martin Mersberger on current-us...@.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/dist/libdm/libdm-common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/libdm-common.c
diff -u src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.6 src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.7
--- src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.6	Sun Dec 26 14:48:34 2010
+++ src/external/gpl2/lvm2/dist/libdm/libdm-common.c	Wed Dec 29 10:39:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdm-common.c,v 1.6 2010/12/26 14:48:34 christos Exp $	*/
+/*	$NetBSD: libdm-common.c,v 1.7 2010/12/29 10:39:27 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -418,16 +418,16 @@
 	dev_t dev = MKDEV(major, minor);
 	mode_t old_mask;
 
-	#ifdef __NetBSD__
+#ifdef __NetBSD__
 	char rpath[PATH_MAX];
 	uint32_t raw_major;
 	dev_t rdev;
 	char raw_devname[DM_NAME_LEN+1]; /* r + other device name */
 
-	nbsd_get_dm_major(raw_major,DM_CHAR_MAJOR);
-	rdev = MKDEV(raw_major,minor);
+	nbsd_get_dm_major(raw_major, DM_CHAR_MAJOR);
+	rdev = MKDEV(raw_major, minor);
 
-	snprintf(raw_devname,sizeof(raw_devname),r%s,dev_name);
+	snprintf(raw_devname, sizeof(raw_devname), r%s, dev_name);
 
 	_build_dev_path(rpath, sizeof(rpath), raw_devname);
 
@@ -457,8 +457,8 @@
 	}
 	umask(old_mask);
 
-	if (chown(path, uid, gid)  0) {
-		log_sys_error(chown, rpath);
+	if (chown(rpath, uid, gid)  0) {
+		log_sys_error(Raw device chown, rpath);
 		return 0;
 	}
 #endif



CVS commit: src/external/gpl2/lvm2/dist/lib/device

2010-12-29 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec 29 23:14:21 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-io.c

Log Message:
Fix my yesterday fix and finally make _get_dev_size recognise partition size
for device without DIOWEDGEINFO, where DIOCGDINFO is used. Patch tested by
Martin Mersberger.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl2/lvm2/dist/lib/device/dev-io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.9 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.10
--- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.9	Wed Dec 29 00:14:04 2010
+++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c	Wed Dec 29 23:14:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-io.c,v 1.9 2010/12/29 00:14:04 haad Exp $	*/
+/*	$NetBSD: dev-io.c,v 1.10 2010/12/29 23:14:21 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -268,6 +268,7 @@
 #ifdef __NetBSD__
 	struct disklabel	lab;
 	struct dkwedge_info dkw;
+	struct stat stat;
 #endif
 
 	if ((fd = open(name, O_RDONLY))  0) {
@@ -285,8 +286,12 @@
 			DIOCGDINFO for disk device %s, name);
 			close(fd);
 			return 0;
-		} else
-			*size = lab.d_nsectors;
+		} else {
+			if (fstat(fd, stat)  0)
+log_debug(fstat on device %s failure, name);
+			
+			*size = lab.d_partitions[DISKPART(stat.st_rdev)].p_size;
+		}
 	} else
 		*size = dkw.dkw_size;
 #else



CVS commit: src/external/gpl2/lvm2/dist/lib/device

2010-12-28 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec 29 00:14:05 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-io.c

Log Message:
Fix bug added by my last commit. This should fix

PR: bin/44286

Reported by: mlelstv@ and Martin Mersberger.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl2/lvm2/dist/lib/device/dev-io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.8 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.9
--- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.8	Thu Dec 23 21:39:08 2010
+++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c	Wed Dec 29 00:14:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-io.c,v 1.8 2010/12/23 21:39:08 haad Exp $	*/
+/*	$NetBSD: dev-io.c,v 1.9 2010/12/29 00:14:04 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -286,7 +286,7 @@
 			close(fd);
 			return 0;
 		} else
-			*size /= lab.d_secsize;
+			*size = lab.d_nsectors;
 	} else
 		*size = dkw.dkw_size;
 #else



CVS commit: src/external/gpl2/lvm2/dist

2010-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 26 14:48:34 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/daemons/cmirrord: functions.c
src/external/gpl2/lvm2/dist/libdm: libdm-common.c
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-iface.c
libdm-nbsd-iface.c

Log Message:
- don't forget to restore the umask on error.
- save and restore umask for control
- chown/chgrp for raw devices


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/lvm2/dist/libdm/libdm-common.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c
diff -u src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c:1.2 src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c:1.3
--- src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c:1.2	Thu Dec 23 12:46:54 2010
+++ src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c	Sun Dec 26 09:48:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: functions.c,v 1.2 2010/12/23 17:46:54 christos Exp $	*/
+/*	$NetBSD: functions.c,v 1.3 2010/12/26 14:48:34 christos Exp $	*/
 
 /*
  * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
@@ -303,6 +303,7 @@
 	struct dirent *dep;
 	struct stat statbuf;
 	int major, minor;
+	mode_t old_umask;
 
 	if (!strstr(major_minor_str, :)) {
 		r = stat(major_minor_str, statbuf);
@@ -350,7 +351,9 @@
 	LOG_DBG(Path not found for %d/%d, major, minor);
 	LOG_DBG(Creating /dev/mapper/%d-%d, major, minor);
 	sprintf(path_rtn, /dev/mapper/%d-%d, major, minor);
+	old_umask = umask(0);
 	r = mknod(path_rtn, S_IFBLK | DM_DEVICE_MODE, MKDEV(major, minor));
+	umask(old_umask);
 
 	if (r != -1)
 		r = chown(path_rtn, DM_DEVICE_UID, DM_DEVICE_GID);

Index: src/external/gpl2/lvm2/dist/libdm/libdm-common.c
diff -u src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.5 src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.6
--- src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.5	Sat Dec  5 06:42:24 2009
+++ src/external/gpl2/lvm2/dist/libdm/libdm-common.c	Sun Dec 26 09:48:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdm-common.c,v 1.5 2009/12/05 11:42:24 haad Exp $	*/
+/*	$NetBSD: libdm-common.c,v 1.6 2010/12/26 14:48:34 christos Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -450,11 +450,17 @@
 	}
 
 	old_mask = umask(0);
-
 	if (mknod(rpath, S_IFCHR | mode, rdev)  0) {
+		umask(old_mask);
 		log_error(Unable to make device node for '%s', raw_devname);
 		return 0;
 	}
+	umask(old_mask);
+
+	if (chown(path, uid, gid)  0) {
+		log_sys_error(chown, rpath);
+		return 0;
+	}
 #endif
 	
 	_build_dev_path(path, sizeof(path), dev_name);
@@ -505,7 +511,7 @@
 	char path[PATH_MAX];
 	struct stat info;
 
-	#ifdef __NetBSD__
+#ifdef __NetBSD__
 	char rpath[PATH_MAX];
 	char raw_devname[DM_NAME_LEN+1]; /* r + other device name */
 

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c:1.2 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c:1.3
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c:1.2	Thu Dec 23 12:46:54 2010
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c	Sun Dec 26 09:48:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdm-iface.c,v 1.2 2010/12/23 17:46:54 christos Exp $	*/
+/*	$NetBSD: libdm-iface.c,v 1.3 2010/12/26 14:48:34 christos Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -245,11 +245,14 @@
 
 	log_verbose(Creating device %s (%u, %u), control, major, minor);
 
+	old_umask = umask(0);
 	if (mknod(control, S_IFCHR | DM_DEVICE_MODE,
 		  MKDEV(major, minor))  0)  {
+		umask(old_umask);
 		log_sys_error(mknod, control);
 		return 0;
 	}
+	umask(old_umask);
 	if (chown(control, DM_DEVICE_UID, DM_DEVICE_GID) == -1) {
 		log_sys_error(cbown, control);
 		return 0;

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.8 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.9
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.8	Thu Dec 23 12:46:54 2010
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Sun Dec 26 09:48:34 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.8 2010/12/23 17:46:54 christos Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.9 2010/12/26 14:48:34 christos Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -153,7 +153,7 @@
 	if (!major)
 		return 0;
 
-	old_umask = umask(0022);
+	old_umask = umask(DM_DEV_DIR_UMASK);
 	ret = 

CVS commit: src/external/gpl2/lvm2/dist/lib/device

2010-12-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Dec 23 14:46:25 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-io.c

Log Message:
Get sector size from device properties using DIOCGDISKINFO and
use the disklabel (DIOCGDINFO) only as a fallback. This works
with wedges.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/dist/lib/device/dev-io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.6 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.7
--- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.6	Wed Dec  2 01:53:25 2009
+++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c	Thu Dec 23 14:46:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-io.c,v 1.6 2009/12/02 01:53:25 haad Exp $	*/
+/*	$NetBSD: dev-io.c,v 1.7 2010/12/23 14:46:25 mlelstv Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -41,6 +41,7 @@
 #elif __NetBSD__
 #  include sys/disk.h
 #  include sys/disklabel.h
+#  include prop/proplib.h
 #  include sys/param.h
 #else
 #  include sys/disk.h
@@ -133,14 +134,22 @@
 	const char *name = dev_name(dev);
 #ifdef __NetBSD__
 	struct disklabel	lab;
+	prop_dictionary_t	disk_dict, geom_dict;
+	uint32_t		secsize;
 #endif
 
 	if ((dev-block_size == -1)) {
 #ifdef __NetBSD__
-		if (ioctl(dev_fd(dev), DIOCGDINFO, lab)  0) {
-			dev-block_size = DEV_BSIZE;
-		} else
-			dev-block_size = lab.d_secsize;
+		if (prop_dictionary_recv_ioctl(dev_fd(dev), DIOCGDISKINFO, disk_dict)) {
+			if (ioctl(dev_fd(dev), DIOCGDINFO, lab)  0) {
+dev-block_size = DEV_BSIZE;
+			} else
+dev-block_size = lab.d_secsize;
+		} else {
+			geom_dict = prop_dictionary_get(disk_dict, geometry);
+			prop_dictionary_get_uint32(geom_dict, sector-size, secsize);
+			dev-block_size = secsize;
+		}
 #else
 		if (ioctl(dev_fd(dev), BLKBSZGET, dev-block_size)  0) {
 			log_sys_error(ioctl BLKBSZGET, name);



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2010-12-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 23 17:44:33 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm_netbsd.c

Log Message:
false needs stdbool.h


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.5 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.6
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.5	Sat Dec  5 06:42:24 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Thu Dec 23 12:44:33 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.5 2009/12/05 11:42:24 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.6 2010/12/23 17:44:33 christos Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -40,6 +40,7 @@
 #include stdio.h
 #include stdlib.h
 #include unistd.h
+#include stdbool.h
 
 #include dev/dm/netbsd-dm.h
 



CVS commit: src/external/gpl2/lvm2

2010-12-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 23 17:46:55 UTC 2010

Modified Files:
src/external/gpl2/lvm2: lvm2tools.mk
src/external/gpl2/lvm2/dist/daemons/cmirrord: functions.c
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-iface.c
libdm-nbsd-iface.c
src/external/gpl2/lvm2/lib/libdevmapper: Makefile
src/external/gpl2/lvm2/sbin/dmsetup: Makefile

Log Message:
PR/44267: Michael van Elst: LVM devices have wrong permissions
- Centralize CPPFLAGS for DM_DEVICE_{UID,GID,MODE}
- Make DM_DEVICE_GID operator DM_DEVICE_MODE 0640 to be more NetBSD like
- make all the code use DM_DEVICE_MODE instead of hard-coding.
- make sure that all mknod calls are followed by a chown call.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/lvm2/lvm2tools.mk
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/lvm2/lib/libdevmapper/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/lvm2/sbin/dmsetup/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lvm2tools.mk
diff -u src/external/gpl2/lvm2/lvm2tools.mk:1.1 src/external/gpl2/lvm2/lvm2tools.mk:1.2
--- src/external/gpl2/lvm2/lvm2tools.mk:1.1	Sun Dec 21 19:57:58 2008
+++ src/external/gpl2/lvm2/lvm2tools.mk	Thu Dec 23 12:46:54 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: lvm2tools.mk,v 1.1 2008/12/22 00:57:58 haad Exp $
+#	$NetBSD: lvm2tools.mk,v 1.2 2010/12/23 17:46:54 christos Exp $
 
 .include bsd.own.mk
 
@@ -9,6 +9,9 @@
 LIBDM_DISTDIR=		${NETBSDSRCDIR}/external/gpl2/lvm2/dist/libdm
 LIBDM_INCLUDE=		${NETBSDSRCDIR}/external/gpl2/lvm2/dist/include
 
+# root:operator [cb]rw-r-
+CPPFLAGS+=-DDM_DEVICE_UID=0 -DDM_DEVICE_GID=5 -DDM_DEVICE_MODE=0640
+
 #
 #LIBDM_OBJDIR.libdevmapper=${LIBDM_SRCDIR}/lib/libdevmapper/
 #

Index: src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c
diff -u src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c:1.1.1.1 src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c:1.2
--- src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c:1.1.1.1	Tue Dec  1 19:27:10 2009
+++ src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c	Thu Dec 23 12:46:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: functions.c,v 1.1.1.1 2009/12/02 00:27:10 haad Exp $	*/
+/*	$NetBSD: functions.c,v 1.2 2010/12/23 17:46:54 christos Exp $	*/
 
 /*
  * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
@@ -350,7 +350,10 @@
 	LOG_DBG(Path not found for %d/%d, major, minor);
 	LOG_DBG(Creating /dev/mapper/%d-%d, major, minor);
 	sprintf(path_rtn, /dev/mapper/%d-%d, major, minor);
-	r = mknod(path_rtn, S_IFBLK | S_IRUSR | S_IWUSR, MKDEV(major, minor));
+	r = mknod(path_rtn, S_IFBLK | DM_DEVICE_MODE, MKDEV(major, minor));
+
+	if (r != -1)
+		r = chown(path_rtn, DM_DEVICE_UID, DM_DEVICE_GID);
 
 	/*
 	 * If we have to make the path, we unlink it after we open it

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c:1.1.1.3 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c:1.2
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c:1.1.1.3	Tue Dec  1 19:26:11 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c	Thu Dec 23 12:46:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdm-iface.c,v 1.1.1.3 2009/12/02 00:26:11 haad Exp $	*/
+/*	$NetBSD: libdm-iface.c,v 1.2 2010/12/23 17:46:54 christos Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -245,11 +245,15 @@
 
 	log_verbose(Creating device %s (%u, %u), control, major, minor);
 
-	if (mknod(control, S_IFCHR | S_IRUSR | S_IWUSR,
+	if (mknod(control, S_IFCHR | DM_DEVICE_MODE,
 		  MKDEV(major, minor))  0)  {
 		log_sys_error(mknod, control);
 		return 0;
 	}
+	if (chown(control, DM_DEVICE_UID, DM_DEVICE_GID) == -1) {
+		log_sys_error(cbown, control);
+		return 0;
+	}
 
 #ifdef HAVE_SELINUX
 	if (!dm_set_selinux_context(control, S_IFCHR)) {

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.7 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.8
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.7	Fri Mar 12 11:24:40 2010
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Thu Dec 23 12:46:54 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.7 2010/03/12 16:24:40 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.8 2010/12/23 17:46:54 christos Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -162,11 +162,15 @@
 
 	log_verbose(Creating device %s (%u, %u), control, major, 

CVS commit: src/external/gpl2/lvm2/dist/lib/device

2010-12-23 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Thu Dec 23 21:39:09 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-io.c

Log Message:
Change way how we get device size from device. Do not use LSEEK but
DIOCGWEDGEINFO and DIOCGDINFO. This should fix problem with raidframe + lvm
reported by

Toby Karyadi on current-us...@.

Thanks for reporting this issue.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/lvm2/dist/lib/device/dev-io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.7 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.8
--- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.7	Thu Dec 23 14:46:25 2010
+++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c	Thu Dec 23 21:39:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-io.c,v 1.7 2010/12/23 14:46:25 mlelstv Exp $	*/
+/*	$NetBSD: dev-io.c,v 1.8 2010/12/23 21:39:08 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -275,26 +275,20 @@
 		log_sys_error(open, name);
 #endif		
 		return 0;
-		}
-
-#ifdef __NetBSD__
-	if ((*size = lseek (fd, 0, SEEK_END))  0) {
-		log_sys_error(lseek SEEK_END, name);
-		close(fd);
-		return 0;
 	}
 
-	if (ioctl(fd, DIOCGDINFO, lab)  0) {
-		if (ioctl(fd, DIOCGWEDGEINFO, dkw)  0) {
-			log_debug(ioctl DIOCGWEDGEINFO, name);
+#ifdef __NetBSD__
+/* Get info about partition/wedge */
+	if (ioctl(fd, DIOCGWEDGEINFO, dkw) == -1) {
+		if (ioctl(fd, DIOCGDINFO, lab) == -1) {
+			log_debug(Please implement DIOCGWEDGEINFO or 
+			DIOCGDINFO for disk device %s, name);
 			close(fd);
 			return 0;
 		} else
-			if (dkw.dkw_size)
-*size = dkw.dkw_size;
-	} else 
-		if (lab.d_secsize)
 			*size /= lab.d_secsize;
+	} else
+		*size = dkw.dkw_size;
 #else
 	if (ioctl(fd, BLKGETSIZE64, size)  0) {
 		log_sys_error(ioctl BLKGETSIZE64, name);



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2010-03-12 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Fri Mar 12 16:24:40 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Fix /var/run/dev.db dependency by adding new get_dev_name routine which
converts raw device major:minor number to block device path. By reading
/dev and using stat to find block device major:minor numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.6 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.7
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.6	Wed Dec  9 00:15:51 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Fri Mar 12 16:24:40 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.6 2009/12/09 00:15:51 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.7 2010/03/12 16:24:40 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -358,6 +358,45 @@
 	return 1;
 }
 
+static char *
+get_dev_name(char *d_name, uint32_t d_major, uint32_t d_minor)
+{
+	static char d_buf[MAXPATHLEN];
+	struct dirent *dire;
+	struct stat st;
+	DIR *dev_dir;
+
+	int err;
+	char *name;
+
+	dev_dir = opendir(/dev);
+
+	while ((dire = readdir(dev_dir)) != NULL) {
+
+		if (strstr(dire-d_name, d_name) == NULL)
+			continue;
+
+		snprintf(d_buf, MAXPATHLEN, /dev/%s, dire-d_name);
+
+		if ((err = stat(d_buf, st))  0)
+			printf(stat failed with %d, err);
+
+		if (st.st_mode  S_IFBLK){
+			if ((major(st.st_rdev) == d_major)  (minor(st.st_rdev) == d_minor)) {
+strncpy(d_buf, dire-d_name, strlen(dire-d_name) + 1);
+name = d_buf;
+break;
+			}
+		}
+
+		memset(d_buf, '0', sizeof(d_buf));
+	}
+
+	(void)closedir(dev_dir);
+
+	return name;
+}
+
 /*
  * @dev_major is major number of char device
  *
@@ -409,16 +448,17 @@
 	dev = MKDEV(major,dev_minor);
 
 	mode |= S_IFBLK;
-	
-	name = devname(dev,mode);
+
+	if ((name = devname(dev,mode)) == NULL)
+		name = get_dev_name(kd[i].d_name, major, dev_minor);
 
 	r = snprintf(buf, (size_t) bufsize, /dev/%s,name);
 
 	free(kd);
-	
+
 	if (r  0 || r  bufsize - 1 || name == NULL)
 		return 0;
-	
+
 	return 1;
 }
 



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2009-12-08 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec  9 00:15:51 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Add support for building RUMP_ACTION libdevmapper which will build and link
libdevmapper with RUMP kernel and libdm(RUMP based device-mapper library).
This enables testing of dmsetup and libdevmapper with RUMP.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.5 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.6
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.5	Sat Dec  5 11:42:24 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Wed Dec  9 00:15:51 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.5 2009/12/05 11:42:24 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.6 2009/12/09 00:15:51 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -32,6 +32,11 @@
 
 #include dm-ioctl.h
 
+#ifdef RUMP_ACTION
+#include rump/rump.h
+#include rump/rump_syscalls.h
+#endif
+
 /*
  * Ensure build compatibility.  
  * The hard-coded versions here are the highest present 
@@ -189,6 +194,9 @@
 	if (_control_fd != -1)
 		return 1;
 
+#ifdef RUMP_ACTION	
+	rump_init();
+#endif
 	snprintf(control, sizeof(control), %s/control, dm_dir());
 
 	if (!_control_device_number(major, minor))
@@ -1018,9 +1026,18 @@
 	//printf(name %s, major %d minor %d\n uuid %s\n, 
 //dm_task_get_name(dmt), dmt-minor, dmt-major, dm_task_get_uuid(dmt));
 	/* Send dictionary to kernel and wait for reply. */
+#ifdef RUMP_ACTION
+	struct plistref prefp;
+	int err;
+	prop_dictionary_externalize_to_pref(dm_dict_in, prefp);
+
+	if (rump_sys_ioctl(_control_fd, NETBSD_DM_IOCTL, prefp) != 0) {
+
+		dm_dict_out = prop_dictionary_internalize(prefp.pref_plist);
+#else	
 	if (prop_dictionary_sendrecv_ioctl(dm_dict_in,_control_fd,
 		NETBSD_DM_IOCTL,dm_dict_out) != 0) {
-
+#endif
 		if (errno == ENOENT 
 		((dmt-type == DM_DEVICE_INFO) ||
 			(dmt-type == DM_DEVICE_MKNODES) ||
@@ -1051,6 +1068,9 @@
 		}
 	}
 
+#ifdef RUMP_ACTION
+	dm_dict_out = prop_dictionary_internalize(prefp.pref_plist);
+#endif	
 	prop_dictionary_externalize_to_file(dm_dict_out,/tmp/test_out);
 
 	/* Parse kernel dictionary to dmi structure and return it to libdevmapper. */



CVS commit: src/external/gpl2/lvm2/lib/libdevmapper

2009-12-08 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec  9 00:17:23 UTC 2009

Modified Files:
src/external/gpl2/lvm2/lib/libdevmapper: Makefile

Log Message:
Add support for building libdevmapper against RUMP.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/lvm2/lib/libdevmapper/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/libdevmapper/Makefile
diff -u src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.3 src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.4
--- src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.3	Tue Dec  1 23:12:51 2009
+++ src/external/gpl2/lvm2/lib/libdevmapper/Makefile	Wed Dec  9 00:17:23 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2009/12/01 23:12:51 haad Exp $
+#	$NetBSD: Makefile,v 1.4 2009/12/09 00:17:23 haad Exp $
 
 USE_SHLIBDIR=	yes
 USE_FORT?=	no
@@ -23,6 +23,13 @@
 		dbg_malloc.c pool.c matcher.c parse_rx.c ttree.c \
 		libdm-nbsd-iface.c libdm_netbsd.c
 
+.ifdef RUMP_ACTION
+CPPFLAGS+=  -DRUMP_ACTION -DRUMP_SYS_IOCTL -DRUMP_SYS_CLOSE -DRUMP_SYS_OPEN
+LDADD+= -lrumpdev_disk -lrumpdev_dm -lrumpdev
+LDADD+= -lrumpvfs -lrump -lrumpuser -lpthread
+DBG=-g
+.endif
+
 .PATH: ${LIBDM_DISTDIR}/
 .PATH: ${LIBDM_DISTDIR}/datastruct
 .PATH: ${LIBDM_DISTDIR}/mm



CVS commit: src/external/gpl2/lvm2/dist/libdm

2009-12-05 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Sat Dec  5 11:42:24 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/libdm: libdm-common.c
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c
libdm_netbsd.c

Log Message:
Addapt libdevmapper library to new header file changes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/lvm2/dist/libdm/libdm-common.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/libdm-common.c
diff -u src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.4 src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.5
--- src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.4	Wed Dec  2 00:58:03 2009
+++ src/external/gpl2/lvm2/dist/libdm/libdm-common.c	Sat Dec  5 11:42:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdm-common.c,v 1.4 2009/12/02 00:58:03 haad Exp $	*/
+/*	$NetBSD: libdm-common.c,v 1.5 2009/12/05 11:42:24 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -48,7 +48,7 @@
 #endif
 
 #ifdef __NetBSD__
-#include netbsd-dm.h
+#include libdm-netbsd.h
 #endif
 
 #define DEV_DIR /dev/

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.4 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.5
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.4	Wed Dec  2 01:53:25 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Sat Dec  5 11:42:24 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.4 2009/12/02 01:53:25 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.5 2009/12/05 11:42:24 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -19,6 +19,7 @@
 #include dmlib.h
 #include libdm-targets.h
 #include libdm-common.h
+#include libdm-netbsd.h
 
 #include sys/ioctl.h
 #include sys/sysctl.h
@@ -27,7 +28,7 @@
 #include dirent.h
 #include limits.h
 
-#include netbsd-dm.h
+#include dev/dm/netbsd-dm.h
 
 #include dm-ioctl.h
 
Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.4 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.5
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.4	Tue Dec  1 23:11:17 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Sat Dec  5 11:42:24 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.4 2009/12/01 23:11:17 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.5 2009/12/05 11:42:24 haad Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -41,11 +41,12 @@
 #include stdlib.h
 #include unistd.h
 
-#include netbsd-dm.h
+#include dev/dm/netbsd-dm.h
 
 #include dm-ioctl.h
 
 #include lib.h
+#include libdm-netbsd.h
 
 #define DMI_SIZE 16 * 1024
 



CVS commit: src/external/gpl2/lvm2/dist/lib/commands

2009-12-04 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Sat Dec  5 01:52:44 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/lib/commands: toolcontext.c

Log Message:
Try to fix amd64 build.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c
diff -u src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.6 src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.7
--- src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.6	Wed Dec  2 01:53:25 2009
+++ src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c	Sat Dec  5 01:52:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: toolcontext.c,v 1.6 2009/12/02 01:53:25 haad Exp $	*/
+/*	$NetBSD: toolcontext.c,v 1.7 2009/12/05 01:52:44 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -845,13 +845,17 @@
 	return 1;
 }
 
+#ifdef __NetBSD__
+#include dlfcn.h
+#endif
+
 static int _init_single_segtype(struct cmd_context *cmd,
 struct segtype_library *seglib)
 {
 	struct segment_type *(*init_segtype_fn) (struct cmd_context *);
 	struct segment_type *segtype;
 
-	if (!(init_segtype_fn = (void *) dlsym(seglib-lib, init_segtype))) {
+	if (!(init_segtype_fn = dlsym(seglib-lib, init_segtype))) {
 		log_error(Shared library %s does not contain segment type 
 			  functions, seglib-libname);
 		return 0;



CVS commit: src/external/gpl2/lvm2/dist

2009-12-01 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Tue Dec  1 23:11:17 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/include: dm-ioctl.h
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c
libdm_netbsd.c

Log Message:
Revert my commit which added knowledge about dm targets to libdevmapper,
this breaks abstraction. Because only lvmtools/lvmlib and device-mapper can
have knowledge about target mapping and libdevmapper only passes requests
from lvmtools to kernel and back. Bump major library and driver version.

Requested by: yamt@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/include/dm-ioctl.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/dm-ioctl.h
diff -u src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.2 src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.3
--- src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.2	Fri Jun  5 20:11:21 2009
+++ src/external/gpl2/lvm2/dist/include/dm-ioctl.h	Tue Dec  1 23:11:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm-ioctl.h,v 1.2 2009/06/05 20:11:21 haad Exp $	*/
+/*	$NetBSD: dm-ioctl.h,v 1.3 2009/12/01 23:11:17 haad Exp $	*/
 
 /*
  * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
@@ -259,7 +259,7 @@
 #define DM_TARGET_MSG	 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
 #define DM_DEV_SET_GEOMETRY	_IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
 
-#define DM_VERSION_MAJOR	4
+#define DM_VERSION_MAJOR	6
 #define DM_VERSION_MINOR	15
 #define DM_VERSION_PATCHLEVEL	0
 #define DM_VERSION_EXTRA	-ioctl (2008-04-23)

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.2 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.3
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.2	Fri Jun  5 19:57:25 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Tue Dec  1 23:11:17 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.2 2009/06/05 19:57:25 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.3 2009/12/01 23:11:17 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -367,8 +367,6 @@
 	
 	nbsd_get_dm_major(dm_major, DM_BLOCK_MAJOR);
 
-	log_error(format_dev %d--%d %d, dev_major, dev_minor, bufsize);
-
 	if (bufsize  8)
 		return 0;
 	
@@ -595,7 +593,6 @@
 {
 	prop_array_t cmd_array;
 	prop_dictionary_t target_spec;
-	prop_dictionary_t target_param;
 	
 	struct target *t;
 	
@@ -620,10 +617,7 @@
 		strlcpy(type,t-type,DM_MAX_TYPE_NAME);
 
 		prop_dictionary_set_cstring(target_spec,DM_TABLE_TYPE,type);
-		
-		target_param = nbsd_dm_parse_param(type, t-params);
-		prop_dictionary_set(target_spec, DM_TABLE_PARAMS, target_param);
-		prop_object_release(target_param);
+		prop_dictionary_set_cstring(target_spec,DM_TABLE_PARAMS,t-params);
 
 		prop_array_set(cmd_array,count,target_spec);
 

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.3 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.4
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.3	Tue Jun  9 18:29:09 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Tue Dec  1 23:11:17 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.3 2009/06/09 18:29:09 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.4 2009/12/01 23:11:17 haad Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,6 @@
 
 #include stdio.h
 #include stdlib.h
-#include string.h
 #include unistd.h
 
 #include netbsd-dm.h
@@ -48,11 +47,6 @@
 
 #include lib.h
 
-struct nbsd_dm_target_param {
-	char *name;
-	prop_dictionary_t (*parse)(char *);
-};
-
 #define DMI_SIZE 16 * 1024
 
 static int dm_list_versions(prop_dictionary_t, struct dm_ioctl *);
@@ -60,206 +54,6 @@
 static int dm_dev_deps(prop_dictionary_t, struct dm_ioctl *);
 static int dm_table_status(prop_dictionary_t, struct dm_ioctl *);
 
-static prop_dictionary_t dm_parse_linear(char *);
-static prop_dictionary_t dm_parse_stripe(char *);
-static prop_dictionary_t dm_parse_mirror(char *);
-static prop_dictionary_t dm_parse_snapshot(char *);
-static prop_dictionary_t dm_parse_snapshot_origin(char *);
-static prop_dictionary_t dm_parse_default(char *);
-
-static struct nbsd_dm_target_param dmt_parse[] = {
-	{linear, dm_parse_linear},
-	{striped, dm_parse_stripe},
-	{mirror, dm_parse_mirror},
-	{snapshot, dm_parse_snapshot},
-	{snapshot-origin, dm_parse_snapshot_origin},
-	{NULL, NULL},
-};
-
-/*
- * Parse params string to target specific proplib dictionary.

CVS commit: src/external/gpl2/lvm2

2009-12-01 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Tue Dec  1 23:12:51 UTC 2009

Modified Files:
src/external/gpl2/lvm2/lib/libdevmapper: Makefile
src/external/gpl2/lvm2/sbin/lvm: Makefile

Log Message:
Remove not needed debugging CFLAGS.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/lib/libdevmapper/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/sbin/lvm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/libdevmapper/Makefile
diff -u src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.2 src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.3
--- src/external/gpl2/lvm2/lib/libdevmapper/Makefile:1.2	Mon Dec 22 01:48:10 2008
+++ src/external/gpl2/lvm2/lib/libdevmapper/Makefile	Tue Dec  1 23:12:51 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2008/12/22 01:48:10 haad Exp $
+#	$NetBSD: Makefile,v 1.3 2009/12/01 23:12:51 haad Exp $
 
 USE_SHLIBDIR=	yes
 USE_FORT?=	no
@@ -8,8 +8,6 @@
 
 LIB=		devmapper
 
-CFLAGS+= -fno-inline
-
 CPPFLAGS+=	-I${LIBDM_DISTDIR} -I${LIBDM_DISTDIR}/misc -I${LIBDM_DISTDIR}/mm \
 		-I${LIBDM_DISTDIR}/datastruct -I${LIBDM_DISTDIR}/ioctl \
 		-I${LVM2_DISTDIR}/include -I${LIBDM_SRCDIR} -D__NetBSD__

Index: src/external/gpl2/lvm2/sbin/lvm/Makefile
diff -u src/external/gpl2/lvm2/sbin/lvm/Makefile:1.6 src/external/gpl2/lvm2/sbin/lvm/Makefile:1.7
--- src/external/gpl2/lvm2/sbin/lvm/Makefile:1.6	Tue Jan 13 22:38:00 2009
+++ src/external/gpl2/lvm2/sbin/lvm/Makefile	Tue Dec  1 23:12:51 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2009/01/13 22:38:00 haad Exp $
+#	$NetBSD: Makefile,v 1.7 2009/12/01 23:12:51 haad Exp $
 
 USE_FORT?=	no
 NOLINT=		#defined
@@ -22,7 +22,6 @@
 		vgmknodes.c vgreduce.c vgremove.c vgrename.c vgscan.c \
 		vgsplit.c lvm.c
 
-CFLAGS+= 	-fno-inline
 
 CPPFLAGS+=	-I${LVM2_DISTDIR}/lib -I${LVM2_DISTDIR}/include \
 		-I. -I${LIBDM_INCLUDE} -I${LVM2_DISTDIR}/tools \



CVS commit: src/external/gpl2/lvm2/dist

2009-12-01 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec  2 00:59:19 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist: lvm2netbsd

Log Message:
Fix comment about running ./configure script.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl2/lvm2/dist/lvm2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lvm2netbsd
diff -u src/external/gpl2/lvm2/dist/lvm2netbsd:1.1.1.3 src/external/gpl2/lvm2/dist/lvm2netbsd:1.2
--- src/external/gpl2/lvm2/dist/lvm2netbsd:1.1.1.3	Wed Dec  2 00:25:39 2009
+++ src/external/gpl2/lvm2/dist/lvm2netbsd	Wed Dec  2 00:59:19 2009
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: lvm2netbsd,v 1.1.1.3 2009/12/02 00:25:39 haad Exp $
+#	$NetBSD: lvm2netbsd,v 1.2 2009/12/02 00:59:19 haad Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -34,7 +34,7 @@
 #
 # ./configure --with-cluster=none --with-snapshots=internal --with-clvmd=none 
 #   --with-lvm1=none --with-cluster=none --disable-readline --enable-o_direct 
-#   --enable-devmapper
+#   --disable-udev_sync --enable-devmapper
 #
 # based on texinfo2netbsd
 #



CVS commit: src/external/gpl2/lvm2/dist

2009-12-01 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec  2 01:53:25 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/include: configure.h dm-ioctl.h
src/external/gpl2/lvm2/dist/lib/commands: toolcontext.c
src/external/gpl2/lvm2/dist/lib/device: dev-io.c dev-swap.c
src/external/gpl2/lvm2/dist/lib/filters: filter_netbsd.c
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Fix build, add missing symbols, remove unknown ioctls etc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/lvm2/dist/include/configure.h
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/lvm2/dist/include/dm-ioctl.h
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/lvm2/dist/lib/device/dev-io.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl2/lvm2/dist/lib/device/dev-swap.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/configure.h
diff -u src/external/gpl2/lvm2/dist/include/configure.h:1.3 src/external/gpl2/lvm2/dist/include/configure.h:1.4
--- src/external/gpl2/lvm2/dist/include/configure.h:1.3	Wed Feb 18 12:16:13 2009
+++ src/external/gpl2/lvm2/dist/include/configure.h	Wed Dec  2 01:53:25 2009
@@ -1,3 +1,5 @@
+/*	$NetBSD: configure.h,v 1.4 2009/12/02 01:53:25 haad Exp $	*/
+
 /* lib/misc/configure.h.  Generated from configure.h.in by configure.  */
 /* lib/misc/configure.h.in.  Generated from configure.in by autoheader.  */
 
@@ -7,6 +9,9 @@
 /* Define to 1 to include built-in support for clustered LVM locking. */
 /* #undef CLUSTER_LOCKING_INTERNAL */
 
+/* Path to cmirrord pidfile. */
+/* #undef CMIRRORD_PIDFILE */
+
 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
@@ -15,6 +20,9 @@
 /* Define to 1 if using `alloca.c'. */
 /* #undef C_ALLOCA */
 
+/* Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes. */
+/* #undef DEFAULT_SI_UNIT_CONSISTENCY */
+
 /* Define to 1 to enable LVM2 device-mapper interaction. */
 #define DEVMAPPER_SUPPORT 1
 
@@ -28,7 +36,7 @@
 /* #undef DMEVENTD_PIDFILE */
 
 /* Library version */
-#define DM_LIB_VERSION 1.02.30 (2009-01-26)
+#define DM_LIB_VERSION 1.02.40 (2009-11-24)
 
 /* Define to 1 if you have `alloca', as a function or macro. */
 #define HAVE_ALLOCA 1
@@ -46,6 +54,12 @@
 /* Define to 1 if canonicalize_file_name is available. */
 /* #undef HAVE_CANONICALIZE_FILE_NAME */
 
+/* Define to 1 if you have the ccs.h header file. */
+/* #undef HAVE_CCS_H */
+
+/* Define to 1 if you have the corosync/confdb.h header file. */
+/* #undef HAVE_COROSYNC_CONFDB_H */
+
 /* Define to 1 if you have the ctype.h header file. */
 #define HAVE_CTYPE_H 1
 
@@ -91,12 +105,21 @@
 /* Define to 1 if you have the inttypes.h header file. */
 #define HAVE_INTTYPES_H 1
 
+/* Define to 1 if you have the libcman.h header file. */
+/* #undef HAVE_LIBCMAN_H */
+
 /* Define to 1 if dynamic libraries are available. */
 /* #undef HAVE_LIBDL */
 
+/* Define to 1 if you have the libdlm.h header file. */
+/* #undef HAVE_LIBDLM_H */
+
 /* Define to 1 if you have the libgen.h header file. */
 #define HAVE_LIBGEN_H 1
 
+/* Define to 1 if you have the libgulm.h header file. */
+/* #undef HAVE_LIBGULM_H */
+
 /* Define to 1 if you have the libintl.h header file. */
 /* #undef HAVE_LIBINTL_H */
 
@@ -192,6 +215,9 @@
 /* Define to 1 if you have the `setlocale' function. */
 #define HAVE_SETLOCALE 1
 
+/* Define to 1 if you have the `siginterrupt' function. */
+#define HAVE_SIGINTERRUPT 1
+
 /* Define to 1 if you have the signal.h header file. */
 #define HAVE_SIGNAL_H 1
 
@@ -269,6 +295,9 @@
 /* Define to 1 if you have the sys/ioctl.h header file. */
 #define HAVE_SYS_IOCTL_H 1
 
+/* Define to 1 if you have the sys/ipc.h header file. */
+/* #undef HAVE_SYS_IPC_H */
+
 /* Define to 1 if you have the sys/mman.h header file. */
 #define HAVE_SYS_MMAN_H 1
 
@@ -288,6 +317,9 @@
 /* Define to 1 if you have the sys/select.h header file. */
 /* #undef HAVE_SYS_SELECT_H */
 
+/* Define to 1 if you have the sys/sem.h header file. */
+/* #undef HAVE_SYS_SEM_H */
+
 /* Define to 1 if you have the sys/socket.h header file. */
 /* #undef HAVE_SYS_SOCKET_H */
 
@@ -321,6 +353,10 @@
 /* Define to 1 if you have the time.h header file. */
 #define HAVE_TIME_H 1
 
+/* Define to 1 if libudev's udev_queue_get_udev_is_active function is
+   available. */
+/* #undef HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE */
+
 /* Define to 1 if you have the `uname' function. */
 #define HAVE_UNAME 1
 
@@ -418,6 +454,9 @@
 /* Define to 1 if your sys/time.h declares `struct tm'. */
 /* 

CVS commit: src/external/gpl2/lvm2/lib/liblvm

2009-12-01 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec  2 01:54:20 UTC 2009

Modified Files:
src/external/gpl2/lvm2/lib/liblvm: Makefile

Log Message:
Add two more needed files dev-swap.c and unknown.c.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/lvm2/lib/liblvm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/liblvm/Makefile
diff -u src/external/gpl2/lvm2/lib/liblvm/Makefile:1.3 src/external/gpl2/lvm2/lib/liblvm/Makefile:1.4
--- src/external/gpl2/lvm2/lib/liblvm/Makefile:1.3	Tue Jan 13 22:33:05 2009
+++ src/external/gpl2/lvm2/lib/liblvm/Makefile	Wed Dec  2 01:54:20 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2009/01/13 22:33:05 ahoka Exp $
+#	$NetBSD: Makefile,v 1.4 2009/12/02 01:54:20 haad Exp $
 
 LIBISPRIVATE=	yes
 
@@ -22,7 +22,7 @@
 CPPFLAGS.imLcLkup.c=-Wno-error
 
 SRCS+=		activate.c lvmcache.c toolcontext.c config.c btree.c \
-		str_list.c dev-cache.c dev-io.c dev-md.c device.c \
+		str_list.c dev-cache.c dev-io.c dev-md.c device.c dev-swap.c \
 		display.c errseg.c filter-composite.c \
 		filter-persistent.c \
 		filter-regex.c filter-sysfs.c filter-md.c archive.c \
@@ -32,7 +32,8 @@
 		merge.c metadata.c mirror.c pv_manip.c pv_map.c segtype.c \
 		snapshot_manip.c crc.c lvm-exec.c lvm-file.c lvm-string.c \
 		lvm-wrappers.c timestamp.c util.c memlock.c report.c \
-		striped.c uuid.c zero.c disk-rep.c format1.c import-export.c \
+		striped.c unknown.c uuid.c zero.c disk-rep.c format1.c \
+		import-export.c \
 		import-extents.c layout.c lvm1-label.c vg_number.c \
 		disk_rep.c format_pool.c import_export.c pool_label.c \
 		filter_netbsd.c snapshot.c mirrored.c dev_manager.c fs.c dev.c \
@@ -64,6 +65,7 @@
 .PATH:	${LVM2_DISTDIR}/lib/report
 .PATH:	${LVM2_DISTDIR}/lib/snapshot
 .PATH:	${LVM2_DISTDIR}/lib/striped
+.PATH:	${LVM2_DISTDIR}/lib/unknown
 .PATH:	${LVM2_DISTDIR}/lib/uuid
 .PATH:	${LVM2_DISTDIR}/lib/zero
 .PATH:	${LVM2_DISTDIR}/lib/netbsd



CVS commit: src/external/gpl2/lvm2/dist/lib

2009-10-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Oct 16 21:00:41 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-cache.c
src/external/gpl2/lvm2/dist/lib/netbsd: dev.c

Log Message:
Only match raw devices. Only match against the char major as extracted
from the kernel. Prevents aliasing nwt0 and rwd0e. OK haad@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/lib/device/dev-cache.c
cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-cache.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-cache.c:1.2 src/external/gpl2/lvm2/dist/lib/device/dev-cache.c:1.3
--- src/external/gpl2/lvm2/dist/lib/device/dev-cache.c:1.2	Mon Dec 22 00:56:58 2008
+++ src/external/gpl2/lvm2/dist/lib/device/dev-cache.c	Fri Oct 16 21:00:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-cache.c,v 1.2 2008/12/22 00:56:58 haad Exp $	*/
+/*	$NetBSD: dev-cache.c,v 1.3 2009/10/16 21:00:41 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -435,11 +435,14 @@
 		 * raw and block. I can insert only  existing
 		 * raw and block device.
 		 */
+		if (S_ISBLK(info.st_mode)) {
+			log_debug(%s: Not a raw device, path);
+			return_0;
+		}
 		if (nbsd_check_dev(MAJOR(info.st_rdev),path)  0) {
-			log_debug(%s: Not a block device., path);
+			log_debug(%s: Not a known raw device, path);
 			return_0;
 		}
-
 #else
 		if (!S_ISBLK(info.st_mode))
 			log_debug(%s: Not a block device, path);

Index: src/external/gpl2/lvm2/dist/lib/netbsd/dev.c
diff -u src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.1 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.2
--- src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.1	Mon Dec 22 00:56:59 2008
+++ src/external/gpl2/lvm2/dist/lib/netbsd/dev.c	Fri Oct 16 21:00:41 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: dev.c,v 1.1 2008/12/22 00:56:59 haad Exp $*/
+/*  $NetBSD: dev.c,v 1.2 2009/10/16 21:00:41 joerg Exp $*/
 
 /*
  * NetBSD specific device routines are added to this file.
@@ -61,11 +61,7 @@
 		if (kd[i].d_cmajor != -1  kd[i].d_bmajor != -1) {
 			
 			if (kd[i].d_cmajor == major)
-return kd[i].d_bmajor;
-			
-			if (kd[i].d_bmajor == major)
-return kd[i].d_cmajor;
-			
+return 0;
 		}
 	
 	return LVM_FAILURE;



CVS commit: src/external/gpl2/lvm2/dist/man

2009-10-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Oct 15 00:59:01 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/man: vgrename.8

Log Message:
Fix markup.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/man/vgrename.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/man/vgrename.8
diff -u src/external/gpl2/lvm2/dist/man/vgrename.8:1.2 src/external/gpl2/lvm2/dist/man/vgrename.8:1.3
--- src/external/gpl2/lvm2/dist/man/vgrename.8:1.2	Wed Feb 18 12:16:13 2009
+++ src/external/gpl2/lvm2/dist/man/vgrename.8	Thu Oct 15 00:59:01 2009
@@ -1,4 +1,4 @@
-.\$NetBSD: vgrename.8,v 1.2 2009/02/18 12:16:13 haad Exp $
+.\$NetBSD: vgrename.8,v 1.3 2009/10/15 00:59:01 joerg Exp $
 .\
 .TH VGRENAME 8 LVM TOOLS 2.02.44-cvs (02-17-09) Sistina Software UK \ -*- nroff -*-
 .SH NAME
@@ -24,18 +24,18 @@
 .SH Examples
 vgrename /dev/vg02 /dev/my_volume_group renames existing
 volume group vg02 to my_volume_group.
-.TP
+.PP
 vgrename vg02 my_volume_group does the same.
-.TP
+.PP
 vgrename Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 VolGroup00_tmp
 changes the name of the Volume Group with UUID
 Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 to 
 VolGroup00_tmp.
-
+.PP
 All the Volume Groups visible to a system need to have different
 names.  Otherwise many LVM2 commands will refuse to run or give
 warning messages.
-
+.PP
 This situation could arise when disks are moved between machines.  If
 a disk is connected and it contains a Volume Group with the same name
 as the Volume Group containing your root filesystem the machine might
@@ -43,7 +43,6 @@
 different UUIDs (unless the disk was cloned) so you can rename
 one of the conflicting Volume Groups with
 \fBvgrename\fP.
-.TP
 .SH SEE ALSO
 .BR lvm (8),
 .BR vgchange (8),



CVS commit: src/external/gpl2/lvm2/lib/libdevmapper

2009-06-09 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Tue Jun  9 18:24:02 UTC 2009

Modified Files:
src/external/gpl2/lvm2/lib/libdevmapper: netbsd-dm.h

Log Message:
Add const to second argument of nbsd_dm_parse_param, too.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h
diff -u src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h:1.2 src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h:1.3
--- src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h:1.2	Fri Jun  5 20:03:58 2009
+++ src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h	Tue Jun  9 18:24:02 2009
@@ -1,4 +1,4 @@
-/*$NetBSD: netbsd-dm.h,v 1.2 2009/06/05 20:03:58 haad Exp $  */
+/*$NetBSD: netbsd-dm.h,v 1.3 2009/06/09 18:24:02 haad Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -287,7 +287,7 @@
 int nbsd_dm_add_uint(const char *, uint64_t, prop_dictionary_t);
 int nbsd_dm_add_str(const char *, char *, prop_dictionary_t );
 
-prop_dictionary_t nbsd_dm_parse_param(const char *, char *);
+prop_dictionary_t nbsd_dm_parse_param(const char *, const char *);
 
 struct dm_ioctl* nbsd_dm_dict_to_dmi(prop_dictionary_t, const int);
 



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2009-06-05 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Fri Jun  5 19:57:25 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c
libdm_netbsd.c

Log Message:
Parse dm param string in libdevmapper and not in a dm target init function.
Create proplib param dictionary entry in libdevmapper and pass it to dm in
dm_ioctl dict.
Param target is then passed to target init function, where is parse. I like
this aproach much better than passing char **argv and trusting to user input.

XXX. Add more sanity checks in kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.1 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.2
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.1	Mon Dec 22 00:56:59 2008
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Fri Jun  5 19:57:25 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.1 2008/12/22 00:56:59 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.2 2009/06/05 19:57:25 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -595,6 +595,7 @@
 {
 	prop_array_t cmd_array;
 	prop_dictionary_t target_spec;
+	prop_dictionary_t target_param;
 	
 	struct target *t;
 	
@@ -619,7 +620,10 @@
 		strlcpy(type,t-type,DM_MAX_TYPE_NAME);
 
 		prop_dictionary_set_cstring(target_spec,DM_TABLE_TYPE,type);
-		prop_dictionary_set_cstring(target_spec,DM_TABLE_PARAMS,t-params);
+		
+		target_param = nbsd_dm_parse_param(type, t-params);
+		prop_dictionary_set(target_spec, DM_TABLE_PARAMS, target_param);
+		prop_object_release(target_param);
 
 		prop_array_set(cmd_array,count,target_spec);
 
Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.1 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.2
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.1	Mon Dec 22 00:56:59 2008
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Fri Jun  5 19:57:25 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.1 2008/12/22 00:56:59 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.2 2009/06/05 19:57:25 haad Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -39,6 +39,7 @@
 
 #include stdio.h
 #include stdlib.h
+#include string.h
 #include unistd.h
 
 #include netbsd-dm.h
@@ -47,6 +48,11 @@
 
 #include lib.h
 
+struct nbsd_dm_target_param {
+	char *name;
+	prop_dictionary_t (*parse)(char *);
+};
+
 #define DMI_SIZE 16 * 1024
 
 static int dm_list_versions(prop_dictionary_t, struct dm_ioctl *);
@@ -54,6 +60,199 @@
 static int dm_dev_deps(prop_dictionary_t, struct dm_ioctl *);
 static int dm_table_status(prop_dictionary_t, struct dm_ioctl *);
 
+static prop_dictionary_t dm_parse_linear(char *);
+static prop_dictionary_t dm_parse_stripe(char *);
+static prop_dictionary_t dm_parse_mirror(char *);
+static prop_dictionary_t dm_parse_snapshot(char *);
+static prop_dictionary_t dm_parse_snapshot_origin(char *);
+
+static struct nbsd_dm_target_param dmt_parse[] = {
+	{linear, dm_parse_linear},
+	{striped, dm_parse_stripe},
+	{mirror, dm_parse_mirror},
+	{snapshot, dm_parse_snapshot},
+	{snapshot-origin, dm_parse_snapshot_origin},
+	{NULL, NULL},
+};
+
+/*
+ * Parse params string to target specific proplib dictionary.
+ *
+ * keyparams/key
+ * dict
+ * keydevice/key
+ * array
+ *  dict
+ *  keydevice/key
+ *  string/dev/wd1a/string
+ *  keyoffset/key
+ *  integer0x384/integer
+ *  /dict
+ * /array
+ * !-- Other target config stuff --
+ * /dict
+ *
+ */
+prop_dictionary_t 
+nbsd_dm_parse_param(const char *target, const char *params)
+{
+	int i;
+	size_t slen, dlen;
+	prop_dictionary_t dict;
+	char *param;
+	
+	dict = NULL;
+	slen = strlen(target);
+
+	printf(Parsing target %s, string %s\n, target, params);
+
+	/* copy parameter string to new buffer */
+	param = dm_malloc(strlen(params) * sizeof(char));
+	strlcpy(param, params, strlen(params)+1);
+
+for(i = 0; dmt_parse[i].name != NULL; i++) {
+		dlen = strlen(dmt_parse[i].name);
+		
+		if (slen != dlen)
+			continue;
+			
+		if (strncmp(target, dmt_parse[i].name, slen) == 0)
+			break;
+	}
+	
+if (dmt_parse[i].name == NULL)
+return NULL;
+
+	printf(target found %s, params %s\n, dmt_parse[i].name, params);
+	
+	dict = dmt_parse[i].parse(param);
+	
+	dm_free(param);
+	
+	return dict;
+}
+
+/*
+ * Example line sent to dm from lvm tools when using linear 

CVS commit: src/external/gpl2/lvm2/lib/libdevmapper

2009-06-05 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Fri Jun  5 20:03:59 UTC 2009

Modified Files:
src/external/gpl2/lvm2/lib/libdevmapper: netbsd-dm.h

Log Message:
Parse dm param string in libdevmapper and not in a dm target init function.
Create proplib param dictionary entry in libdevmapper and pass it to dm in
dm_ioctl dict.
Param target is then passed to target init function, where is parse. I like
this aproach much better than passing char **argv and trusting to user input.

XXX. Add more sanity checks in kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h
diff -u src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h:1.1 src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h:1.2
--- src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h:1.1	Mon Dec 22 01:48:10 2008
+++ src/external/gpl2/lvm2/lib/libdevmapper/netbsd-dm.h	Fri Jun  5 20:03:58 2009
@@ -1,4 +1,4 @@
-/*$NetBSD: netbsd-dm.h,v 1.1 2008/12/22 01:48:10 haad Exp $  */
+/*$NetBSD: netbsd-dm.h,v 1.2 2009/06/05 20:03:58 haad Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -208,6 +208,17 @@
 #define DM_TABLE_STAT status
 #define DM_TABLE_LENGTH   length
 #define DM_TABLE_PARAMS   params
+
+#define DM_TARGET_LINEAR_DEVICE device
+#define DM_TARGET_LINEAR_OFFSET offset
+
+#define DM_TARGET_STRIPE_DEVARRAY  device_array
+#define DM_TARGET_STRIPE_DEVICEdevice
+#define DM_TARGET_STRIPE_OFFSEToffset
+#define DM_TARGET_STRIPE_STRIPES   stripes
+#define DM_TARGET_STRIPE_CHUNKSIZE chunk_size
+
+
 //#ifndef __LIB_DEVMAPPER__
 //#define DM_TABLE_DEPS deps
 //#endif
@@ -266,7 +277,7 @@
 
 /* Types for nbsd_get_dm_major */
 #define DM_CHAR_MAJOR 1
-#define DM_BLOCK_MAJOR 2	
+#define DM_BLOCK_MAJOR 2
 
 /* libdm_netbsd.c */
 int nbsd_get_dm_major(uint32_t *, int); /* Get dm device major numbers */
@@ -276,6 +287,8 @@
 int nbsd_dm_add_uint(const char *, uint64_t, prop_dictionary_t);
 int nbsd_dm_add_str(const char *, char *, prop_dictionary_t );
 
+prop_dictionary_t nbsd_dm_parse_param(const char *, char *);
+
 struct dm_ioctl* nbsd_dm_dict_to_dmi(prop_dictionary_t, const int);
 
 #endif /* __LIB_DEVMAPPER__ */



CVS commit: src/external/gpl2/lvm2/dist/include

2009-06-05 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Fri Jun  5 20:11:21 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/include: dm-ioctl.h

Log Message:
Bump libdevmapper minor number, because of ioctl protocol change.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/lvm2/dist/include/dm-ioctl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/dm-ioctl.h
diff -u src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.1.1.1 src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.2
--- src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.1.1.1	Mon Dec 22 00:18:43 2008
+++ src/external/gpl2/lvm2/dist/include/dm-ioctl.h	Fri Jun  5 20:11:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm-ioctl.h,v 1.1.1.1 2008/12/22 00:18:43 haad Exp $	*/
+/*	$NetBSD: dm-ioctl.h,v 1.2 2009/06/05 20:11:21 haad Exp $	*/
 
 /*
  * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
@@ -260,7 +260,7 @@
 #define DM_DEV_SET_GEOMETRY	_IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
 
 #define DM_VERSION_MAJOR	4
-#define DM_VERSION_MINOR	14
+#define DM_VERSION_MINOR	15
 #define DM_VERSION_PATCHLEVEL	0
 #define DM_VERSION_EXTRA	-ioctl (2008-04-23)