Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dm dm: Doesn't need to expose struct cmd_function in...



details:   https://anonhg.NetBSD.org/src/rev/ea27a90c6fd8
branches:  trunk
changeset: 846891:ea27a90c6fd8
user:      tkusumi <tkusumi%NetBSD.org@localhost>
date:      Tue Dec 03 15:36:00 2019 +0000

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

diffstat:

 sys/dev/dm/device-mapper.c |  15 +++++++++++++--
 sys/dev/dm/dm.h            |  15 +--------------
 2 files changed, 14 insertions(+), 16 deletions(-)

diffs (65 lines):

diff -r dff0f84fd722 -r ea27a90c6fd8 sys/dev/dm/device-mapper.c
--- a/sys/dev/dm/device-mapper.c        Tue Dec 03 15:20:59 2019 +0000
+++ b/sys/dev/dm/device-mapper.c        Tue Dec 03 15:36:00 2019 +0000
@@ -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 @@
 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 @@
  * 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 },
diff -r dff0f84fd722 -r ea27a90c6fd8 sys/dev/dm/dm.h
--- a/sys/dev/dm/dm.h   Tue Dec 03 15:20:59 2019 +0000
+++ b/sys/dev/dm/dm.h   Tue Dec 03 15:36:00 2019 +0000
@@ -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 @@
 
 /* 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 *);
 



Home | Main Index | Thread Index | Old Index