net: core: move dev_alloc_name_ns a little higher
No functional change. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
51f299dd94
commit
2c88b85598
|
@ -1107,6 +1107,19 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
|
||||||
return -ENFILE;
|
return -ENFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int dev_alloc_name_ns(struct net *net,
|
||||||
|
struct net_device *dev,
|
||||||
|
const char *name)
|
||||||
|
{
|
||||||
|
char buf[IFNAMSIZ];
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = __dev_alloc_name(net, name, buf);
|
||||||
|
if (ret >= 0)
|
||||||
|
strlcpy(dev->name, buf, IFNAMSIZ);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dev_alloc_name - allocate a name for a device
|
* dev_alloc_name - allocate a name for a device
|
||||||
* @dev: device
|
* @dev: device
|
||||||
|
@ -1136,19 +1149,6 @@ int dev_alloc_name(struct net_device *dev, const char *name)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(dev_alloc_name);
|
EXPORT_SYMBOL(dev_alloc_name);
|
||||||
|
|
||||||
static int dev_alloc_name_ns(struct net *net,
|
|
||||||
struct net_device *dev,
|
|
||||||
const char *name)
|
|
||||||
{
|
|
||||||
char buf[IFNAMSIZ];
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = __dev_alloc_name(net, name, buf);
|
|
||||||
if (ret >= 0)
|
|
||||||
strlcpy(dev->name, buf, IFNAMSIZ);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int dev_get_valid_name(struct net *net, struct net_device *dev,
|
int dev_get_valid_name(struct net *net, struct net_device *dev,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue