sys/dev/disk/dm: Remove dm_get_version_ioctl()
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 18 Oct 2015 15:23:11 +0000 (00:23 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 18 Oct 2015 16:42:40 +0000 (01:42 +0900)
"version" command is done by userspace (Linux lvm2),
so we really don't need to have any handler for this.

sys/dev/disk/dm/device-mapper.c
sys/dev/disk/dm/dm.h
sys/dev/disk/dm/dm_ioctl.c

index de6bea5..5a5979f 100644 (file)
@@ -110,7 +110,7 @@ MODULE_VERSION(dm, 1);
  *
  */
 static struct cmd_function cmd_fn[] = {
-               { .cmd = "version", .fn = dm_get_version_ioctl},
+               { .cmd = "version", .fn = NULL},
                { .cmd = "targets", .fn = dm_list_versions_ioctl},
                { .cmd = "create",  .fn = dm_dev_create_ioctl},
                { .cmd = "info",    .fn = dm_dev_status_ioctl},
@@ -291,7 +291,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;  /* No handler required */
        r = cmd_fn[i].fn(dm_dict);
 
        return r;
index 379e207..9fdaa7a 100644 (file)
@@ -222,7 +222,6 @@ int dm_dev_status_ioctl(prop_dictionary_t);
 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 9e27202..52c3cea 100644 (file)
@@ -139,15 +139,6 @@ dm_dbg_print_flags(int flags)
 
        return 0;
 }
-/*
- * 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.