summaryrefslogtreecommitdiff
path: root/net/batman-adv/bat_v.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2016-07-16 10:31:20 +0300
committerSimon Wunderlich <sw@simonwunderlich.de>2016-08-09 08:54:54 +0300
commitdc1cbd145eecf21209d0322874e1766bcbce3e3f (patch)
tree6b49d9b1b47af18984ff769f7b2d94a98a113521 /net/batman-adv/bat_v.c
parent06d640c9aad6d96713ea2fbe36f5a344428ccd57 (diff)
downloadlinux-dc1cbd145eecf21209d0322874e1766bcbce3e3f.tar.xz
batman-adv: Allow to disable debugfs support
The files provided by batman-adv via debugfs are currently converted to netlink. Tools which are not yet converted to use the netlink interface may still rely on the old debugfs files. But systems which already upgraded their tools can save some space by disabling this feature. The default configuration of batman-adv on amd64 can reduce the size of the module by around 11% when this feature is disabled. $ size net/batman-adv/batman-adv.ko* text data bss dec hex filename 150507 10395 4160 165062 284c6 net/batman-adv/batman-adv.ko.y 137106 7099 2112 146317 23b8d net/batman-adv/batman-adv.ko.n Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/bat_v.c')
-rw-r--r--net/batman-adv/bat_v.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 9e872dcc1260..e79f6f01182e 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -129,6 +129,7 @@ batadv_v_hardif_neigh_init(struct batadv_hardif_neigh_node *hardif_neigh)
batadv_v_elp_throughput_metric_update);
}
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
/**
* batadv_v_orig_print_neigh - print neighbors for the originator table
* @orig_node: the orig_node for which the neighbors are printed
@@ -212,6 +213,7 @@ static void batadv_v_neigh_print(struct batadv_priv *bat_priv,
if (batman_count == 0)
seq_puts(seq, "No batman nodes in range ...\n");
}
+#endif
/**
* batadv_v_neigh_dump_neigh - Dump a neighbour into a message
@@ -345,6 +347,7 @@ batadv_v_neigh_dump(struct sk_buff *msg, struct netlink_callback *cb,
cb->args[1] = idx;
}
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
/**
* batadv_v_orig_print - print the originator table
* @bat_priv: the bat priv with all the soft interface information
@@ -411,6 +414,7 @@ next:
if (batman_count == 0)
seq_puts(seq, "No batman nodes in range ...\n");
}
+#endif
/**
* batadv_v_orig_dump_subentry - Dump an originator subentry into a
@@ -827,6 +831,7 @@ out:
return ret;
}
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
/* fails if orig_node has no router */
static int batadv_v_gw_write_buffer_text(struct batadv_priv *bat_priv,
struct seq_file *seq,
@@ -896,6 +901,7 @@ static void batadv_v_gw_print(struct batadv_priv *bat_priv,
if (gw_count == 0)
seq_puts(seq, "No gateways in range ...\n");
}
+#endif
/**
* batadv_v_gw_dump_entry - Dump a gateway into a message
@@ -1034,11 +1040,15 @@ static struct batadv_algo_ops batadv_batman_v __read_mostly = {
.hardif_init = batadv_v_hardif_neigh_init,
.cmp = batadv_v_neigh_cmp,
.is_similar_or_better = batadv_v_neigh_is_sob,
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
.print = batadv_v_neigh_print,
+#endif
.dump = batadv_v_neigh_dump,
},
.orig = {
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
.print = batadv_v_orig_print,
+#endif
.dump = batadv_v_orig_dump,
},
.gw = {
@@ -1046,7 +1056,9 @@ static struct batadv_algo_ops batadv_batman_v __read_mostly = {
.show_sel_class = batadv_v_show_sel_class,
.get_best_gw_node = batadv_v_gw_get_best_gw_node,
.is_eligible = batadv_v_gw_is_eligible,
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
.print = batadv_v_gw_print,
+#endif
.dump = batadv_v_gw_dump,
},
};