Module Name:    src
Committed By:   tkusumi
Date:           Tue Dec  3 15:36:00 UTC 2019

Modified Files:
        src/sys/dev/dm: device-mapper.c dm.h

Log Message:
dm: Doesn't need to expose struct cmd_function in a header


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/dm/device-mapper.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/dm/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/sys/dev/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.41 src/sys/dev/dm/device-mapper.c:1.42
--- src/sys/dev/dm/device-mapper.c:1.41	Mon Dec  2 15:17:43 2019
+++ src/sys/dev/dm/device-mapper.c	Tue Dec  3 15:36:00 2019
@@ -1,4 +1,4 @@
-/*        $NetBSD: device-mapper.c,v 1.41 2019/12/02 15:17:43 tkusumi Exp $ */
+/*        $NetBSD: device-mapper.c,v 1.42 2019/12/03 15:36:00 tkusumi Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -114,6 +114,13 @@ CFATTACH_DECL3_NEW(dm, 0,
 extern uint32_t dm_dev_counter;
 
 /*
+ * This structure is used to translate command sent to kernel driver in
+ * <key>command</key>
+ * <value></value>
+ * to function which I can call, and if the command is allowed for
+ * non-superusers.
+ */
+/*
  * This array is used to translate cmd to function pointer.
  *
  * Interface between libdevmapper and lvm2tools uses different
@@ -122,7 +129,11 @@ extern uint32_t dm_dev_counter;
  * ioctl to kernel but will do another things in userspace.
  *
  */
-static const struct cmd_function cmd_fn[] = {
+static const struct cmd_function {
+	const char *cmd;
+	int  (*fn)(prop_dictionary_t);
+	int  allowed;
+} cmd_fn[] = {
 	{ .cmd = "version", .fn = dm_get_version_ioctl,	  .allowed = 1 },
 	{ .cmd = "targets", .fn = dm_list_versions_ioctl, .allowed = 1 },
 	{ .cmd = "create",  .fn = dm_dev_create_ioctl,    .allowed = 0 },

Index: src/sys/dev/dm/dm.h
diff -u src/sys/dev/dm/dm.h:1.28 src/sys/dev/dm/dm.h:1.29
--- src/sys/dev/dm/dm.h:1.28	Sun Dec  1 06:53:31 2019
+++ src/sys/dev/dm/dm.h	Tue Dec  3 15:36:00 2019
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm.h,v 1.28 2019/12/01 06:53:31 tkusumi Exp $      */
+/*        $NetBSD: dm.h,v 1.29 2019/12/03 15:36:00 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -242,19 +242,6 @@ typedef struct dm_target {
 
 /* Interface structures */
 
-/*
- * This structure is used to translate command sent to kernel driver in
- * <key>command</key>
- * <value></value>
- * to function which I can call, and if the command is allowed for
- * non-superusers.
- */
-struct cmd_function {
-	const char *cmd;
-	int  (*fn)(prop_dictionary_t);
-	int  allowed;
-};
-
 /* device-mapper */
 void dmgetproperties(struct disk *, dm_table_head_t *);
 

Reply via email to