Remove CONFIG_KMOD from net/ (towards removing CONFIG_KMOD entirely)
Subsystems (12)
PATCH 1/1 Remove CONFIG_KMOD from net/ (towards removing CONFIG_KMOD entirely)
Date: Wed, 09 Jul 2008 10:28:42 +0200
From: Johannes Berg <[email protected]>
Some code here depends on CONFIG_KMOD to not try to load protocol modules or similar, replace by CONFIG_MODULES where more than just request_module depends on CONFIG_KMOD and and also use try_then_request_module in ebtables.
--- net/bluetooth/af_bluetooth.c | 8 +------- net/bridge/netfilter/ebtables.c | 15 +++------------ net/can/af_can.c | 4 ++-- net/core/dev.c | 2 -- net/core/rtnetlink.c | 4 ++-- net/dccp/ccid.c | 2 +- net/decnet/dn_dev.c | 2 -- net/ipv4/devinet.c | 2 -- net/ipv4/inet_diag.c | 2 -- net/ipv4/tcp_cong.c | 4 ++-- net/netfilter/nfnetlink.c | 2 +- net/netlink/af_netlink.c | 2 +- net/sched/act_api.c | 2 +- net/sched/cls_api.c | 2 +- net/sched/ematch.c | 2 +- net/sched/sch_api.c | 2 +- net/socket.c | 2 +- net/sunrpc/auth.c | 2 -- 18 files changed, 18 insertions(+), 43 deletions(-)
net/bluetooth/af_bluetooth.c +1 -7
@@ -37,10 +37,7 @@#include <linux/poll.h> #include <net/sock.h> #include <asm/ioctls.h> - -#if defined(CONFIG_KMOD )#include <linux/kmod.h> -#endif #include <net/bluetooth/bluetooth.h>
@@ -145,11 +142,8 @@ static int bt_sock_create(struct net *neif (proto <0 || proto >=BT_MAX_PROTO )return -EINVAL ; -#if defined(CONFIG_KMOD ) -if (!bt_proto[proto]) { +if (!bt_proto[proto])request_module ("bt-proto-%d" , proto); - } -#endif err = -EPROTONOSUPPORT ;
net/bridge/netfilter/ebtables.c +3 -12
@@ -288,23 +288,14 @@ find_inlist_lock_noload(struct list_headreturn NULL ; } -#ifndef CONFIG_KMOD -#define find_inlist_lock (h,n,p,e,m) find_inlist_lock_noload((h),(n),(e),(m)) -#else static void *find_inlist_lock (struct list_head *head,const char *name,const char *prefix,int *error,struct mutex *mutex) { -void *ret; - - ret =find_inlist_lock_noload (head, name, error, mutex); -if (!ret) { -request_module ("%s%s" , prefix, name); - ret =find_inlist_lock_noload (head, name, error, mutex); - } -return ret; +return try_then_request_module ( +find_inlist_lock_noload (head, name, error, mutex), +"%s%s" , prefix, name); } -#endif static inline struct ebt_table *find_table_lock (const char *name,int *error,struct mutex *mutex)
net/can/af_can.c +2 -2
@@ -128,8 +128,8 @@ static int can_create(struct net *net, sif (net != &init_net)return -EAFNOSUPPORT ; -#ifdef CONFIG_KMOD -/* try to load protocol module, when CONFIG_KMOD is defined */ +#ifdef CONFIG_MODULES +/* try to load protocol module kernel is modular */ if (!proto_tab[protocol]) { err =request_module ("can-proto-%d" , protocol);
net/core/dev.c +0 -2
@@ -4882,8 +4882,6 @@ EXPORT_SYMBOL(br_fdb_put_hook);EXPORT_SYMBOL (br_fdb_put_hook);#endif -#ifdef CONFIG_KMOD EXPORT_SYMBOL (dev_load); -#endif EXPORT_PER_CPU_SYMBOL (softnet_data);
net/core/rtnetlink.c +2 -2
@@ -1027,7 +1027,7 @@ static int rtnl_newlink(struct sk_buff *struct nlattr *linkinfo[IFLA_INFO_MAX +1 ];int err; -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES replay:#endif err =nlmsg_parse (nlh,sizeof (*ifm), tb,IFLA_MAX , ifla_policy);
@@ -1116,7 +1116,7 @@ replay:return -EOPNOTSUPP ;if (!ops) { -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES if (kind[0 ]) {__rtnl_unlock ();request_module ("rtnl-link-%s" , kind);
net/dccp/ccid.c +1 -1
@@ -154,7 +154,7 @@ struct ccid *ccid_new(unsigned char id,struct ccid *ccid =NULL ;ccids_read_lock (); -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES if (ccids[id] ==NULL ) {/* We only try to load if in process context */ ccids_read_unlock ();
net/decnet/dn_dev.c +0 -2
@@ -490,9 +490,7 @@ int dn_dev_ioctl(unsigned int cmd, voidreturn -EFAULT ; ifr->ifr_name[IFNAMSIZ -1 ] =0 ; -#ifdef CONFIG_KMOD dev_load (&init_net, ifr->ifr_name); -#endif switch (cmd) {case SIOCGIFADDR :
net/ipv4/devinet.c +0 -2
@@ -613,9 +613,7 @@ int devinet_ioctl(struct net *net, unsigif (colon) *colon =0 ; -#ifdef CONFIG_KMOD dev_load (net, ifr.ifr_name); -#endif switch (cmd) {case SIOCGIFADDR :/* Get interface address */
net/ipv4/inet_diag.c +0 -2
@@ -53,11 +53,9 @@ static DEFINE_MUTEX(inet_diag_table_mutestatic const struct inet_diag_handler *inet_diag_lock_handler (int type) { -#ifdef CONFIG_KMOD if (!inet_diag_table[type])request_module ("net-pf-%d-proto-%d-type-%d" ,PF_NETLINK ,NETLINK_INET_DIAG , type); -#endif mutex_lock (&inet_diag_table_mutex);if (!inet_diag_table[type])
net/ipv4/tcp_cong.c +2 -2
@@ -115,7 +115,7 @@ int tcp_set_default_congestion_control(cspin_lock (&tcp_cong_list_lock); ca =tcp_ca_find (name); -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES if (!ca &&capable (CAP_SYS_MODULE )) {spin_unlock (&tcp_cong_list_lock);
@@ -244,7 +244,7 @@ int tcp_set_congestion_control(struct soif (ca == icsk->icsk_ca_ops) goto out; -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES /* not found attempt to autoload module */ if (!ca &&capable (CAP_SYS_MODULE )) {rcu_read_unlock ();
net/netfilter/nfnetlink.c +1 -1
@@ -134,7 +134,7 @@ static int nfnetlink_rcv_msg(struct sk_b type = nlh->nlmsg_type; ss =nfnetlink_get_subsys (type);if (!ss) { -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES nfnl_unlock ();request_module ("nfnetlink-subsys-%d" ,NFNL_SUBSYS_ID (type));nfnl_lock ();
net/netlink/af_netlink.c +1 -1
@@ -435,7 +435,7 @@ static int netlink_create(struct net *nereturn -EPROTONOSUPPORT ;netlink_lock_table (); -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES if (!nl_table[protocol].registered) {netlink_unlock_table ();request_module ("net-pf-%d-proto-%d" ,PF_NETLINK , protocol);
net/sched/act_api.c +1 -1
@@ -494,7 +494,7 @@ struct tc_action *tcf_action_init_1(stru a_o =tc_lookup_action_n (act_name);if (a_o ==NULL ) { -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES rtnl_unlock ();request_module ("act_%s" , act_name);rtnl_lock ();
net/sched/cls_api.c +1 -1
@@ -227,7 +227,7 @@ replay: err = -ENOENT ; tp_ops =tcf_proto_lookup_ops (tca[TCA_KIND ]);if (tp_ops ==NULL ) { -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES struct nlattr *kind = tca[TCA_KIND ];char name[IFNAMSIZ ];
net/sched/ematch.c +1 -1
@@ -224,7 +224,7 @@ static int tcf_em_validate(struct tcf_prif (em->ops ==NULL ) { err = -ENOENT ; -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES __rtnl_unlock ();request_module ("ematch-kind-%u" , em_hdr->kind);rtnl_lock ();
net/sched/sch_api.c +1 -1
@@ -764,7 +764,7 @@ qdisc_create(struct net_device *dev, strstruct qdisc_size_table *stab; ops =qdisc_lookup_ops (kind); -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES if (ops ==NULL && kind !=NULL ) {char name[IFNAMSIZ ];if (nla_strlcpy (name, kind,IFNAMSIZ ) <IFNAMSIZ ) {
net/socket.c +1 -1
@@ -1142,7 +1142,7 @@ static int __sock_create(struct net *net sock->type = type; -#if defined(CONFIG_KMOD ) +#ifdef CONFIG_MODULES /* Attempt to load a protocol module if the find failed. * * 12/09/1996 Marcin: But! this makes REALLY only sense, if the user
net/sunrpc/auth.c +0 -2
@@ -83,10 +83,8 @@ rpcauth_create(rpc_authflavor_t pseudoflif (flavor >=RPC_AUTH_MAXFLAVOR ) goto out; -#ifdef CONFIG_KMOD if ((ops = auth_flavors[flavor]) ==NULL )request_module ("rpc-auth-%u" , flavor); -#endif spin_lock (&rpc_authflavor_lock); ops = auth_flavors[flavor];if (ops ==NULL || !try_module_get (ops->owner)) {
Quoted 9 lines · Rusty Russell
Date: Wed, 09 Jul 2008 10:28:42 +0200
From: Johannes Berg <[email protected]>Some code here depends on
CONFIG_KMODto not try to load protocol modules or similar, replace byCONFIG_MODULESwhere more than justrequest_moduledepends onCONFIG_KMODand and also usetry_then_request_modulein ebtables.net/netfilter/nfnetlink.c | 2 +-
There's a new one in net/netfilter/nf_conntrack_netlink.c that is so far only in net-2.6.git, but I assume will be merged upstream shortly.
David Miller
maintainerFrom: Patrick McHardy <[email protected]>
Date: Thu, 16 Oct 2008 17:46:10 +0200
Quoted 9 lines
Quoted 7 lines · Rusty Russell
Date: Wed, 09 Jul 2008 10:28:42 +0200
From: Johannes Berg <[email protected]> Some code here depends onCONFIG_KMODto not try to load protocol modules or similar, replace byCONFIG_MODULESwhere more than justrequest_moduledepends onCONFIG_KMODand and also usetry_then_request_modulein ebtables.net/netfilter/nfnetlink.c| 2 +-
Quoted 3 lines
There's a new one in
net/netfilter/nf_conntrack_netlink.cthat is so far only in net-2.6.git, but I assume will be merged upstream shortly.
It has been merged :)
Someone send me a patch to kill it off, it's no big deal.
David Miller
maintainerFrom: David Miller <[email protected]>
Date: Thu, 16 Oct 2008 12:50:46 -0700 (PDT)
Quoted 12 lines
From: Patrick McHardy <[email protected]>
Date: Thu, 16 Oct 2008 17:46:10 +0200Quoted 9 lines
Quoted 7 lines · Rusty Russell
Date: Wed, 09 Jul 2008 10:28:42 +0200
From: Johannes Berg <[email protected]> Some code here depends onCONFIG_KMODto not try to load protocol modules or similar, replace byCONFIG_MODULESwhere more than justrequest_moduledepends onCONFIG_KMODand and also usetry_then_request_modulein ebtables.net/netfilter/nfnetlink.c| 2 +-
Quoted 7 lines
Quoted 3 lines
There's a new one in
net/netfilter/nf_conntrack_netlink.cthat is so far only in net-2.6.git, but I assume will be merged upstream shortly.It has been merged :)
Someone send me a patch to kill it off, it's no big deal.
Never mind, I took care of this myself when applying Rusty's patch to net-2.6 :-)