net: devlink: export devlink net getter
Allow drivers to get net struct for devlink instance. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b7a595577e
commit
471f894f10
@ -771,6 +771,7 @@ static inline struct devlink *netdev_to_devlink(struct net_device *dev)
|
||||
|
||||
struct ib_device;
|
||||
|
||||
struct net *devlink_net(const struct devlink *devlink);
|
||||
struct devlink *devlink_alloc(const struct devlink_ops *ops, size_t priv_size);
|
||||
int devlink_register(struct devlink *devlink, struct device *dev);
|
||||
void devlink_unregister(struct devlink *devlink);
|
||||
|
@ -95,10 +95,11 @@ static LIST_HEAD(devlink_list);
|
||||
*/
|
||||
static DEFINE_MUTEX(devlink_mutex);
|
||||
|
||||
static struct net *devlink_net(const struct devlink *devlink)
|
||||
struct net *devlink_net(const struct devlink *devlink)
|
||||
{
|
||||
return read_pnet(&devlink->_net);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devlink_net);
|
||||
|
||||
static void devlink_net_set(struct devlink *devlink, struct net *net)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user