]> Gentwo Git Trees - linux/.git/commitdiff
net: export netdev_get_by_index_lock()
authorDavid Wei <dw@davidwei.uk>
Sat, 1 Nov 2025 02:24:48 +0000 (19:24 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 11 Nov 2025 14:53:33 +0000 (07:53 -0700)
Need to call netdev_get_by_index_lock() from io_uring/zcrx.c, but it is
currently private to net. Export the function in linux/netdevice.h.

Signed-off-by: David Wei <dw@davidwei.uk>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/netdevice.h
net/core/dev.h

index d1a687444b275d45d105e336d2ede264fd310f1b..77c46a2823eca126b0ebef3002e030dc3196d80d 100644 (file)
@@ -3401,6 +3401,7 @@ struct net_device *dev_get_by_index(struct net *net, int ifindex);
 struct net_device *__dev_get_by_index(struct net *net, int ifindex);
 struct net_device *netdev_get_by_index(struct net *net, int ifindex,
                                       netdevice_tracker *tracker, gfp_t gfp);
+struct net_device *netdev_get_by_index_lock(struct net *net, int ifindex);
 struct net_device *netdev_get_by_name(struct net *net, const char *name,
                                      netdevice_tracker *tracker, gfp_t gfp);
 struct net_device *netdev_get_by_flags_rcu(struct net *net, netdevice_tracker *tracker,
index 900880e8b5b4b9492eca23a4d9201045e6bf7f74..df8a90fe89f8fc284a2bd904415a23cd00ae0420 100644 (file)
@@ -29,7 +29,6 @@ struct napi_struct *
 netdev_napi_by_id_lock(struct net *net, unsigned int napi_id);
 struct net_device *dev_get_by_napi_id(unsigned int napi_id);
 
-struct net_device *netdev_get_by_index_lock(struct net *net, int ifindex);
 struct net_device *__netdev_put_lock(struct net_device *dev, struct net *net);
 struct net_device *
 netdev_xa_find_lock(struct net *net, struct net_device *dev,