Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95a5afca authored by Johannes Berg's avatar Johannes Berg Committed by David S. Miller
Browse files

net: Remove CONFIG_KMOD from net/ (towards removing CONFIG_KMOD entirely)



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.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 00269b54
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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 *net, struct socket *sock, int proto)
	if (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;

+3 −12
Original line number Diff line number Diff line
@@ -305,23 +305,14 @@ find_inlist_lock_noload(struct list_head *head, const char *name, int *error,
	return 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)
+2 −2
Original line number Diff line number Diff line
@@ -128,8 +128,8 @@ static int can_create(struct net *net, struct socket *sock, int protocol)
	if (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);

+0 −2
Original line number Diff line number Diff line
@@ -4956,8 +4956,6 @@ EXPORT_SYMBOL(br_fdb_get_hook);
EXPORT_SYMBOL(br_fdb_put_hook);
#endif

#ifdef CONFIG_KMOD
EXPORT_SYMBOL(dev_load);
#endif

EXPORT_PER_CPU_SYMBOL(softnet_data);
+2 −2
Original line number Diff line number Diff line
@@ -1040,7 +1040,7 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
	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);
@@ -1129,7 +1129,7 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
			return -EOPNOTSUPP;

		if (!ops) {
#ifdef CONFIG_KMOD
#ifdef CONFIG_MODULES
			if (kind[0]) {
				__rtnl_unlock();
				request_module("rtnl-link-%s", kind);
Loading