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_DEVICE "device"
+#define DM_TARGET_STRIPE_OFFSET "offset"
+#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__ */