Skip to content

Commit

Permalink
sysctl net: Remove unused binary sysctl code
Browse files Browse the repository at this point in the history
Now that sys_sysctl is a compatiblity wrapper around /proc/sys
all sysctl strategy routines, and all ctl_name and strategy
entries in the sysctl tables are unused, and can be
revmoed.

In addition neigh_sysctl_register has been modified to no longer
take a strategy argument and it's callers have been modified not
to pass one.

Cc: "David Miller" <[email protected]>
Cc: Hideaki YOSHIFUJI <[email protected]>
Cc: [email protected]
Signed-off-by: Eric W. Biederman <[email protected]>
  • Loading branch information
ebiederm committed Nov 12, 2009
1 parent 86b1bc6 commit f8572d8
Show file tree
Hide file tree
Showing 62 changed files with 162 additions and 1,130 deletions.
1 change: 0 additions & 1 deletion include/net/dn_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ struct dn_dev_parms {
unsigned long t3; /* Default value of t3 */
int priority; /* Priority to be a router */
char *name; /* Name for sysctl */
int ctl_name; /* Index for sysctl */
int (*up)(struct net_device *);
void (*down)(struct net_device *);
void (*timer3)(struct net_device *, struct dn_ifaddr *ifa);
Expand Down
3 changes: 1 addition & 2 deletions include/net/neighbour.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ extern int neigh_sysctl_register(struct net_device *dev,
struct neigh_parms *p,
int p_id, int pdev_id,
char *p_name,
proc_handler *proc_handler,
ctl_handler *strategy);
proc_handler *proc_handler);
extern void neigh_sysctl_unregister(struct neigh_parms *p);

static inline void __neigh_parms_put(struct neigh_parms *parms)
Expand Down
7 changes: 3 additions & 4 deletions net/802/tr.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,19 +635,18 @@ struct net_device *alloc_trdev(int sizeof_priv)
#ifdef CONFIG_SYSCTL
static struct ctl_table tr_table[] = {
{
.ctl_name = NET_TR_RIF_TIMEOUT,
.procname = "rif_timeout",
.data = &sysctl_tr_rif_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{ 0 },
{ },
};

static __initdata struct ctl_path tr_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "token-ring", .ctl_name = NET_TR, },
{ .procname = "net", },
{ .procname = "token-ring", },
{ }
};
#endif
Expand Down
13 changes: 3 additions & 10 deletions net/appletalk/sysctl_net_atalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,39 @@

static struct ctl_table atalk_table[] = {
{
.ctl_name = NET_ATALK_AARP_EXPIRY_TIME,
.procname = "aarp-expiry-time",
.data = &sysctl_aarp_expiry_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_ATALK_AARP_TICK_TIME,
.procname = "aarp-tick-time",
.data = &sysctl_aarp_tick_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_ATALK_AARP_RETRANSMIT_LIMIT,
.procname = "aarp-retransmit-limit",
.data = &sysctl_aarp_retransmit_limit,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_ATALK_AARP_RESOLVE_TIME,
.procname = "aarp-resolve-time",
.data = &sysctl_aarp_resolve_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{ 0 },
{ },
};

static struct ctl_path atalk_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "appletalk", .ctl_name = NET_ATALK, },
{ .procname = "net", },
{ .procname = "appletalk", },
{ }
};

Expand Down
38 changes: 4 additions & 34 deletions net/ax25/sysctl_net_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,156 +34,128 @@ static ctl_table *ax25_table;
static int ax25_table_size;

static struct ctl_path ax25_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ax25", .ctl_name = NET_AX25, },
{ .procname = "net", },
{ .procname = "ax25", },
{ }
};

static const ctl_table ax25_param_table[] = {
{
.ctl_name = NET_AX25_IP_DEFAULT_MODE,
.procname = "ip_default_mode",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_ipdefmode,
.extra2 = &max_ipdefmode
},
{
.ctl_name = NET_AX25_DEFAULT_MODE,
.procname = "ax25_default_mode",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_axdefmode,
.extra2 = &max_axdefmode
},
{
.ctl_name = NET_AX25_BACKOFF_TYPE,
.procname = "backoff_type",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_backoff,
.extra2 = &max_backoff
},
{
.ctl_name = NET_AX25_CONNECT_MODE,
.procname = "connect_mode",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_conmode,
.extra2 = &max_conmode
},
{
.ctl_name = NET_AX25_STANDARD_WINDOW,
.procname = "standard_window_size",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_window,
.extra2 = &max_window
},
{
.ctl_name = NET_AX25_EXTENDED_WINDOW,
.procname = "extended_window_size",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_ewindow,
.extra2 = &max_ewindow
},
{
.ctl_name = NET_AX25_T1_TIMEOUT,
.procname = "t1_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t1,
.extra2 = &max_t1
},
{
.ctl_name = NET_AX25_T2_TIMEOUT,
.procname = "t2_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t2,
.extra2 = &max_t2
},
{
.ctl_name = NET_AX25_T3_TIMEOUT,
.procname = "t3_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t3,
.extra2 = &max_t3
},
{
.ctl_name = NET_AX25_IDLE_TIMEOUT,
.procname = "idle_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_idle,
.extra2 = &max_idle
},
{
.ctl_name = NET_AX25_N2,
.procname = "maximum_retry_count",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_n2,
.extra2 = &max_n2
},
{
.ctl_name = NET_AX25_PACLEN,
.procname = "maximum_packet_length",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_paclen,
.extra2 = &max_paclen
},
{
.ctl_name = NET_AX25_PROTOCOL,
.procname = "protocol",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_proto,
.extra2 = &max_proto
},
#ifdef CONFIG_AX25_DAMA_SLAVE
{
.ctl_name = NET_AX25_DAMA_SLAVE_TIMEOUT,
.procname = "dama_slave_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_ds_timeout,
.extra2 = &max_ds_timeout
},
#endif

{ .ctl_name = 0 } /* that's all, folks! */
{ } /* that's all, folks! */
};

void ax25_register_sysctl(void)
Expand Down Expand Up @@ -212,11 +184,9 @@ void ax25_register_sysctl(void)
return;
}
ax25_table[n].child = ax25_dev->systable = child;
ax25_table[n].ctl_name = n + 1;
ax25_table[n].procname = ax25_dev->dev->name;
ax25_table[n].mode = 0555;

child[AX25_MAX_VALUES].ctl_name = 0; /* just in case... */

for (k = 0; k < AX25_MAX_VALUES; k++)
child[k].data = &ax25_dev->values[k];
Expand All @@ -233,7 +203,7 @@ void ax25_unregister_sysctl(void)
ctl_table *p;
unregister_sysctl_table(ax25_table_header);

for (p = ax25_table; p->ctl_name; p++)
for (p = ax25_table; p->procname; p++)
kfree(p->child);
kfree(ax25_table);
}
6 changes: 3 additions & 3 deletions net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,12 +1013,12 @@ static ctl_table brnf_table[] = {
.mode = 0644,
.proc_handler = brnf_sysctl_call_tables,
},
{ .ctl_name = 0 }
{ }
};

static struct ctl_path brnf_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "bridge", .ctl_name = NET_BRIDGE, },
{ .procname = "net", },
{ .procname = "bridge", },
{ }
};
#endif
Expand Down
Loading

0 comments on commit f8572d8

Please sign in to comment.