mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ipv4: Inline inet_blackhole_dev_init() to devinet_init().
Commit 22600596b6 ("ipv4: give an IPv4 dev to blackhole_netdev")
started to allocate in_device for blackhole_netdev.
It used late_initcall() because blackhole_netdev was allocated
at device_initcall().
Now, it is allocated before inet_init(), and we no longer need
to use late_initcall().
Let's inline inet_blackhole_dev_init() to devinet_init().
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Chris J Arges <carges@cloudflare.com>
Link: https://patch.msgid.link/20261001204752.2572265-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
20dff14006
commit
3d51928a88
|
|
@ -340,18 +340,6 @@ static void inetdev_destroy(struct in_device *in_dev)
|
|||
in_dev_put(in_dev);
|
||||
}
|
||||
|
||||
static int __init inet_blackhole_dev_init(void)
|
||||
{
|
||||
struct in_device *in_dev;
|
||||
|
||||
rtnl_lock();
|
||||
in_dev = inetdev_init(blackhole_netdev);
|
||||
rtnl_unlock();
|
||||
|
||||
return PTR_ERR_OR_ZERO(in_dev);
|
||||
}
|
||||
late_initcall(inet_blackhole_dev_init);
|
||||
|
||||
int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b)
|
||||
{
|
||||
const struct in_ifaddr *ifa;
|
||||
|
|
@ -2974,4 +2962,9 @@ void __init devinet_init(void)
|
|||
panic("Unable to register inet_af_ops\n");
|
||||
|
||||
rtnl_register_many(devinet_rtnl_msg_handlers);
|
||||
|
||||
rtnl_lock();
|
||||
if (IS_ERR(inetdev_init(blackhole_netdev)))
|
||||
panic("IP: failed to allocate in_device for blackhole_netdev\n");
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user