Skip to content

Commit 93893a5

Browse files
Stanislav Fomichevkuba-moo
authored andcommitted
net: s/dev_get_flags/netif_get_flags/
Commit cc34acd ("docs: net: document new locking reality") introduced netif_ vs dev_ function semantics: the former expects locked netdev, the latter takes care of the locking. We don't strictly follow this semantics on either side, but there are more dev_xxx handlers now that don't fit. Rename them to netif_xxx where appropriate. Signed-off-by: Stanislav Fomichev <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 303a848 commit 93893a5

File tree

14 files changed

+21
-21
lines changed

14 files changed

+21
-21
lines changed

drivers/infiniband/sw/rxe/rxe_verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static int rxe_query_port(struct ib_device *ibdev,
6565
attr->state = ib_get_curr_port_state(ndev);
6666
if (attr->state == IB_PORT_ACTIVE)
6767
attr->phys_state = IB_PORT_PHYS_STATE_LINK_UP;
68-
else if (dev_get_flags(ndev) & IFF_UP)
68+
else if (netif_get_flags(ndev) & IFF_UP)
6969
attr->phys_state = IB_PORT_PHYS_STATE_POLLING;
7070
else
7171
attr->phys_state = IB_PORT_PHYS_STATE_DISABLED;

fs/smb/server/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7847,7 +7847,7 @@ static int fsctl_query_iface_info_ioctl(struct ksmbd_conn *conn,
78477847
if (!ksmbd_find_netdev_name_iface_list(netdev->name))
78487848
continue;
78497849

7850-
flags = dev_get_flags(netdev);
7850+
flags = netif_get_flags(netdev);
78517851
if (!(flags & IFF_RUNNING))
78527852
continue;
78537853
ipv6_retry:

include/linux/netdevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4196,7 +4196,7 @@ int generic_hwtstamp_set_lower(struct net_device *dev,
41964196
struct kernel_hwtstamp_config *kernel_cfg,
41974197
struct netlink_ext_ack *extack);
41984198
int dev_ethtool(struct net *net, struct ifreq *ifr, void __user *userdata);
4199-
unsigned int dev_get_flags(const struct net_device *);
4199+
unsigned int netif_get_flags(const struct net_device *dev);
42004200
int __dev_change_flags(struct net_device *dev, unsigned int flags,
42014201
struct netlink_ext_ack *extack);
42024202
int netif_change_flags(struct net_device *dev, unsigned int flags,

net/8021q/vlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
483483
case NETDEV_UP:
484484
/* Put all VLANs for this dev in the up state too. */
485485
vlan_group_for_each_dev(grp, i, vlandev) {
486-
flgs = dev_get_flags(vlandev);
486+
flgs = netif_get_flags(vlandev);
487487
if (flgs & IFF_UP)
488488
continue;
489489

net/bridge/br_netlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ static int br_fill_ifinfo(struct sk_buff *skb,
479479
hdr->__ifi_pad = 0;
480480
hdr->ifi_type = dev->type;
481481
hdr->ifi_index = dev->ifindex;
482-
hdr->ifi_flags = dev_get_flags(dev);
482+
hdr->ifi_flags = netif_get_flags(dev);
483483
hdr->ifi_change = 0;
484484

485485
if (nla_put_string(skb, IFLA_IFNAME, dev->name) ||

net/core/dev.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9454,12 +9454,12 @@ void dev_set_rx_mode(struct net_device *dev)
94549454
}
94559455

94569456
/**
9457-
* dev_get_flags - get flags reported to userspace
9458-
* @dev: device
9457+
* netif_get_flags() - get flags reported to userspace
9458+
* @dev: device
94599459
*
9460-
* Get the combination of flag bits exported through APIs to userspace.
9460+
* Get the combination of flag bits exported through APIs to userspace.
94619461
*/
9462-
unsigned int dev_get_flags(const struct net_device *dev)
9462+
unsigned int netif_get_flags(const struct net_device *dev)
94639463
{
94649464
unsigned int flags;
94659465

@@ -9482,7 +9482,7 @@ unsigned int dev_get_flags(const struct net_device *dev)
94829482

94839483
return flags;
94849484
}
9485-
EXPORT_SYMBOL(dev_get_flags);
9485+
EXPORT_SYMBOL(netif_get_flags);
94869486

94879487
int __dev_change_flags(struct net_device *dev, unsigned int flags,
94889488
struct netlink_ext_ack *extack)

net/core/dev_ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cm
147147

148148
switch (cmd) {
149149
case SIOCGIFFLAGS: /* Get interface flags */
150-
ifr->ifr_flags = (short) dev_get_flags(dev);
150+
ifr->ifr_flags = (short)netif_get_flags(dev);
151151
return 0;
152152

153153
case SIOCGIFMETRIC: /* Get the metric on the interface

net/core/rtnetlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb,
20382038
ifm->__ifi_pad = 0;
20392039
ifm->ifi_type = READ_ONCE(dev->type);
20402040
ifm->ifi_index = READ_ONCE(dev->ifindex);
2041-
ifm->ifi_flags = dev_get_flags(dev);
2041+
ifm->ifi_flags = netif_get_flags(dev);
20422042
ifm->ifi_change = change;
20432043

20442044
if (tgt_netnsid >= 0 && nla_put_s32(skb, IFLA_TARGET_NETNSID, tgt_netnsid))
@@ -5227,7 +5227,7 @@ int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
52275227
ifm->__ifi_pad = 0;
52285228
ifm->ifi_type = dev->type;
52295229
ifm->ifi_index = dev->ifindex;
5230-
ifm->ifi_flags = dev_get_flags(dev);
5230+
ifm->ifi_flags = netif_get_flags(dev);
52315231
ifm->ifi_change = 0;
52325232

52335233

net/ipv4/fib_frontend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
15241524
fib_disable_ip(dev, event, false);
15251525
break;
15261526
case NETDEV_CHANGE:
1527-
flags = dev_get_flags(dev);
1527+
flags = netif_get_flags(dev);
15281528
if (flags & (IFF_RUNNING | IFF_LOWER_UP))
15291529
fib_sync_up(dev, RTNH_F_LINKDOWN);
15301530
else

net/ipv4/fib_semantics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ int fib_sync_up(struct net_device *dev, unsigned char nh_flags)
20872087
return 0;
20882088

20892089
if (nh_flags & RTNH_F_DEAD) {
2090-
unsigned int flags = dev_get_flags(dev);
2090+
unsigned int flags = netif_get_flags(dev);
20912091

20922092
if (flags & (IFF_RUNNING | IFF_LOWER_UP))
20932093
nh_flags |= RTNH_F_LINKDOWN;

0 commit comments

Comments
 (0)