2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

db-ctl-base: remove ctl_get_all_commands() function

all_commands currently is some times accessed directly, some times via
a function call. Change to always access it directly.

Signed-off-by: Andy Zhou <azhou@nicira.com>
This commit is contained in:
Andy Zhou
2015-07-13 22:18:35 -07:00
parent 21a93e08a5
commit a35da174c8
2 changed files with 4 additions and 11 deletions

View File

@@ -1762,7 +1762,7 @@ ctl_add_cmd_options(struct option **options_p, size_t *n_options_p,
const struct shash_node *node;
size_t n_existing_options = *n_options_p;
SHASH_FOR_EACH (node, ctl_get_all_commands()) {
SHASH_FOR_EACH (node, &all_commands) {
const struct ctl_command_syntax *p = node->data;
if (p->options[0]) {
@@ -1852,7 +1852,7 @@ ctl_print_commands(void)
{
const struct shash_node *node;
SHASH_FOR_EACH (node, ctl_get_all_commands()) {
SHASH_FOR_EACH (node, &all_commands) {
const struct ctl_command_syntax *p = node->data;
char *options = xstrdup(p->options);
char *options_begin = options;
@@ -1908,7 +1908,8 @@ bool
ctl_might_write_to_db(char **argv)
{
for (; *argv; argv++) {
const struct ctl_command_syntax *p = shash_find_data(&all_commands, *argv);
const struct ctl_command_syntax *p = shash_find_data(&all_commands,
*argv);
if (p && p->mode == RW) {
return true;
}
@@ -1997,13 +1998,6 @@ ctl_init(const struct ctl_table_class tables_[])
ctl_register_commands(db_ctl_commands);
}
/* Returns 'all_commands'. */
const struct shash *
ctl_get_all_commands(void)
{
return &all_commands;
}
/* Returns the text for the database commands usage. */
const char *
ctl_get_db_cmd_usage(void)