Module Name: src Committed By: tkusumi Date: Thu Dec 5 15:52:39 UTC 2019
Modified Files: src/sys/dev/dm: device-mapper.c dm.h dm_ioctl.c Log Message: dm: Remove unneeded dm_get_version_ioctl() "version" is implemented and handled in userspace, hence dm ioctl doesn't need to support it. taken-from: DragonFlyBSD To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/dev/dm/device-mapper.c cvs rdiff -u -r1.32 -r1.33 src/sys/dev/dm/dm.h cvs rdiff -u -r1.37 -r1.38 src/sys/dev/dm/dm_ioctl.c 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.44 src/sys/dev/dm/device-mapper.c:1.45 --- src/sys/dev/dm/device-mapper.c:1.44 Wed Dec 4 16:55:30 2019 +++ src/sys/dev/dm/device-mapper.c Thu Dec 5 15:52:39 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: device-mapper.c,v 1.44 2019/12/04 16:55:30 tkusumi Exp $ */ +/* $NetBSD: device-mapper.c,v 1.45 2019/12/05 15:52:39 tkusumi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -134,7 +134,7 @@ static const struct cmd_function { int (*fn)(prop_dictionary_t); int allowed; } cmd_fn[] = { - { .cmd = "version", .fn = dm_get_version_ioctl, .allowed = 1 }, + { .cmd = "version", .fn = NULL, .allowed = 1 }, { .cmd = "targets", .fn = dm_list_versions_ioctl, .allowed = 1 }, { .cmd = "create", .fn = dm_dev_create_ioctl, .allowed = 0 }, { .cmd = "info", .fn = dm_dev_status_ioctl, .allowed = 1 }, @@ -413,7 +413,9 @@ dm_cmd_to_fun(prop_dictionary_t dm_dict) if (cmd_fn[i].cmd == NULL) return EINVAL; - aprint_debug("ioctl %s called\n", cmd_fn[i].cmd); + aprint_debug("ioctl %s called %p\n", cmd_fn[i].cmd, cmd_fn[i].fn); + if (cmd_fn[i].fn == NULL) + return 0; r = cmd_fn[i].fn(dm_dict); return r; Index: src/sys/dev/dm/dm.h diff -u src/sys/dev/dm/dm.h:1.32 src/sys/dev/dm/dm.h:1.33 --- src/sys/dev/dm/dm.h:1.32 Wed Dec 4 16:54:03 2019 +++ src/sys/dev/dm/dm.h Thu Dec 5 15:52:39 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dm.h,v 1.32 2019/12/04 16:54:03 tkusumi Exp $ */ +/* $NetBSD: dm.h,v 1.33 2019/12/05 15:52:39 tkusumi Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -251,7 +251,6 @@ int dm_dev_status_ioctl(prop_dictionary_ int dm_dev_suspend_ioctl(prop_dictionary_t); int dm_check_version(prop_dictionary_t); -int dm_get_version_ioctl(prop_dictionary_t); int dm_list_versions_ioctl(prop_dictionary_t); int dm_table_clear_ioctl(prop_dictionary_t); Index: src/sys/dev/dm/dm_ioctl.c diff -u src/sys/dev/dm/dm_ioctl.c:1.37 src/sys/dev/dm/dm_ioctl.c:1.38 --- src/sys/dev/dm/dm_ioctl.c:1.37 Wed Dec 4 15:31:12 2019 +++ src/sys/dev/dm/dm_ioctl.c Thu Dec 5 15:52:39 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dm_ioctl.c,v 1.37 2019/12/04 15:31:12 tkusumi Exp $ */ +/* $NetBSD: dm_ioctl.c,v 1.38 2019/12/05 15:52:39 tkusumi Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.37 2019/12/04 15:31:12 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.38 2019/12/05 15:52:39 tkusumi Exp $"); /* * Locking is used to synchronise between ioctl calls and between dm_table's @@ -161,17 +161,6 @@ dm_dbg_print_flags(int flags) } /* - * Get version ioctl call I do it as default therefore this - * function is unused now. - */ -int -dm_get_version_ioctl(prop_dictionary_t dm_dict) -{ - - return 0; -} - -/* * Get list of all available targets from global * target list and sent them back to libdevmapper. */