diff options
-rw-r--r-- | include/linux/netdevice.h | 2 | ||||
-rw-r--r-- | net/core/dev.c | 18 | ||||
-rw-r--r-- | net/core/sock.c | 4 |
3 files changed, 12 insertions, 12 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 02e0f6b156c..c599e4782d4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1576,7 +1576,7 @@ extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | |||
1576 | 1576 | ||
1577 | extern rwlock_t dev_base_lock; /* Device list lock */ | 1577 | extern rwlock_t dev_base_lock; /* Device list lock */ |
1578 | 1578 | ||
1579 | extern seqlock_t devnet_rename_seq; /* Device rename lock */ | 1579 | extern seqcount_t devnet_rename_seq; /* Device rename seq */ |
1580 | 1580 | ||
1581 | 1581 | ||
1582 | #define for_each_netdev(net, d) \ | 1582 | #define for_each_netdev(net, d) \ |
diff --git a/net/core/dev.c b/net/core/dev.c index d0cbc93fcf3..515473ee52c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -203,7 +203,7 @@ static struct list_head offload_base __read_mostly; | |||
203 | DEFINE_RWLOCK(dev_base_lock); | 203 | DEFINE_RWLOCK(dev_base_lock); |
204 | EXPORT_SYMBOL(dev_base_lock); | 204 | EXPORT_SYMBOL(dev_base_lock); |
205 | 205 | ||
206 | DEFINE_SEQLOCK(devnet_rename_seq); | 206 | seqcount_t devnet_rename_seq; |
207 | 207 | ||
208 | static inline void dev_base_seq_inc(struct net *net) | 208 | static inline void dev_base_seq_inc(struct net *net) |
209 | { | 209 | { |
@@ -1093,10 +1093,10 @@ int dev_change_name(struct net_device *dev, const char *newname) | |||
1093 | if (dev->flags & IFF_UP) | 1093 | if (dev->flags & IFF_UP) |
1094 | return -EBUSY; | 1094 | return -EBUSY; |
1095 | 1095 | ||
1096 | write_seqlock(&devnet_rename_seq); | 1096 | write_seqcount_begin(&devnet_rename_seq); |
1097 | 1097 | ||
1098 | if (strncmp(newname, dev->name, IFNAMSIZ) == 0) { | 1098 | if (strncmp(newname, dev->name, IFNAMSIZ) == 0) { |
1099 | write_sequnlock(&devnet_rename_seq); | 1099 | write_seqcount_end(&devnet_rename_seq); |
1100 | return 0; | 1100 | return 0; |
1101 | } | 1101 | } |
1102 | 1102 | ||
@@ -1104,7 +1104,7 @@ int dev_change_name(struct net_device *dev, const char *newname) | |||
1104 | 1104 | ||
1105 | err = dev_get_valid_name(net, dev, newname); | 1105 | err = dev_get_valid_name(net, dev, newname); |
1106 | if (err < 0) { | 1106 | if (err < 0) { |
1107 | write_sequnlock(&devnet_rename_seq); | 1107 | write_seqcount_end(&devnet_rename_seq); |
1108 | return err; | 1108 | return err; |
1109 | } | 1109 | } |
1110 | 1110 | ||
@@ -1112,11 +1112,11 @@ rollback: | |||
1112 | ret = device_rename(&dev->dev, dev->name); | 1112 | ret = device_rename(&dev->dev, dev->name); |
1113 | if (ret) { | 1113 | if (ret) { |
1114 | memcpy(dev->name, oldname, IFNAMSIZ); | 1114 | memcpy(dev->name, oldname, IFNAMSIZ); |
1115 | write_sequnlock(&devnet_rename_seq); | 1115 | write_seqcount_end(&devnet_rename_seq); |
1116 | return ret; | 1116 | return ret; |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | write_sequnlock(&devnet_rename_seq); | 1119 | write_seqcount_end(&devnet_rename_seq); |
1120 | 1120 | ||
1121 | write_lock_bh(&dev_base_lock); | 1121 | write_lock_bh(&dev_base_lock); |
1122 | hlist_del_rcu(&dev->name_hlist); | 1122 | hlist_del_rcu(&dev->name_hlist); |
@@ -1135,7 +1135,7 @@ rollback: | |||
1135 | /* err >= 0 after dev_alloc_name() or stores the first errno */ | 1135 | /* err >= 0 after dev_alloc_name() or stores the first errno */ |
1136 | if (err >= 0) { | 1136 | if (err >= 0) { |
1137 | err = ret; | 1137 | err = ret; |
1138 | write_seqlock(&devnet_rename_seq); | 1138 | write_seqcount_begin(&devnet_rename_seq); |
1139 | memcpy(dev->name, oldname, IFNAMSIZ); | 1139 | memcpy(dev->name, oldname, IFNAMSIZ); |
1140 | goto rollback; | 1140 | goto rollback; |
1141 | } else { | 1141 | } else { |
@@ -4180,7 +4180,7 @@ static int dev_ifname(struct net *net, struct ifreq __user *arg) | |||
4180 | return -EFAULT; | 4180 | return -EFAULT; |
4181 | 4181 | ||
4182 | retry: | 4182 | retry: |
4183 | seq = read_seqbegin(&devnet_rename_seq); | 4183 | seq = read_seqcount_begin(&devnet_rename_seq); |
4184 | rcu_read_lock(); | 4184 | rcu_read_lock(); |
4185 | dev = dev_get_by_index_rcu(net, ifr.ifr_ifindex); | 4185 | dev = dev_get_by_index_rcu(net, ifr.ifr_ifindex); |
4186 | if (!dev) { | 4186 | if (!dev) { |
@@ -4190,7 +4190,7 @@ retry: | |||
4190 | 4190 | ||
4191 | strcpy(ifr.ifr_name, dev->name); | 4191 | strcpy(ifr.ifr_name, dev->name); |
4192 | rcu_read_unlock(); | 4192 | rcu_read_unlock(); |
4193 | if (read_seqretry(&devnet_rename_seq, seq)) | 4193 | if (read_seqcount_retry(&devnet_rename_seq, seq)) |
4194 | goto retry; | 4194 | goto retry; |
4195 | 4195 | ||
4196 | if (copy_to_user(arg, &ifr, sizeof(struct ifreq))) | 4196 | if (copy_to_user(arg, &ifr, sizeof(struct ifreq))) |
diff --git a/net/core/sock.c b/net/core/sock.c index a692ef49c9b..bc131d41968 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -583,7 +583,7 @@ static int sock_getbindtodevice(struct sock *sk, char __user *optval, | |||
583 | goto out; | 583 | goto out; |
584 | 584 | ||
585 | retry: | 585 | retry: |
586 | seq = read_seqbegin(&devnet_rename_seq); | 586 | seq = read_seqcount_begin(&devnet_rename_seq); |
587 | rcu_read_lock(); | 587 | rcu_read_lock(); |
588 | dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if); | 588 | dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if); |
589 | ret = -ENODEV; | 589 | ret = -ENODEV; |
@@ -594,7 +594,7 @@ retry: | |||
594 | 594 | ||
595 | strcpy(devname, dev->name); | 595 | strcpy(devname, dev->name); |
596 | rcu_read_unlock(); | 596 | rcu_read_unlock(); |
597 | if (read_seqretry(&devnet_rename_seq, seq)) | 597 | if (read_seqcount_retry(&devnet_rename_seq, seq)) |
598 | goto retry; | 598 | goto retry; |
599 | 599 | ||
600 | len = strlen(devname) + 1; | 600 | len = strlen(devname) + 1; |