diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-03 13:18:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-03 13:18:21 -0400 |
commit | 4f9faaace217b854ae1e1746ee4ac44688ddadbd (patch) | |
tree | 34122d9e84349a394988d6bfc480115e4809776a /net | |
parent | bf640be423d60d954b9673527e106a461a129eb8 (diff) | |
parent | f37f2c62a28e848e06399ea2f9be1e098212625c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits)
rose: Wrong list_lock argument in rose_node seqops
netns: Fix reassembly timer to use the right namespace
netns: Fix device renaming for sysfs
bnx2: Update version to 1.7.5.
bnx2: Update RV2P firmware for 5709.
bnx2: Zero out context memory for 5709.
bnx2: Fix register test on 5709.
bnx2: Fix remote PHY initial link state.
bnx2: Refine remote PHY locking.
bridge: forwarding table information for >256 devices
tg3: Update version to 3.92
tg3: Add link state reporting to UMP firmware
tg3: Fix ethtool loopback test for 5761 BX devices
tg3: Fix 5761 NVRAM sizes
tg3: Use constant 500KHz MI clock on adapters with a CPMU
hci_usb.h: fix hard-to-trigger race
dccp: ccid2.c, ccid3.c use clamp(), clamp_t()
net: remove NR_CPUS arrays in net/core/dev.c
net: use get/put_unaligned_* helpers
bluetooth: use get/put_unaligned_* helpers
...
Diffstat (limited to 'net')
42 files changed, 171 insertions, 166 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index daad0064e2c2..08b54b593d56 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -176,12 +176,11 @@ int vlan_proc_add_dev(struct net_device *vlandev) | |||
176 | struct vlan_dev_info *dev_info = vlan_dev_info(vlandev); | 176 | struct vlan_dev_info *dev_info = vlan_dev_info(vlandev); |
177 | struct vlan_net *vn = net_generic(dev_net(vlandev), vlan_net_id); | 177 | struct vlan_net *vn = net_generic(dev_net(vlandev), vlan_net_id); |
178 | 178 | ||
179 | dev_info->dent = proc_create(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR, | 179 | dev_info->dent = |
180 | vn->proc_vlan_dir, &vlandev_fops); | 180 | proc_create_data(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR, |
181 | vn->proc_vlan_dir, &vlandev_fops, vlandev); | ||
181 | if (!dev_info->dent) | 182 | if (!dev_info->dent) |
182 | return -ENOBUFS; | 183 | return -ENOBUFS; |
183 | |||
184 | dev_info->dent->data = vlandev; | ||
185 | return 0; | 184 | return 0; |
186 | } | 185 | } |
187 | 186 | ||
diff --git a/net/atm/proc.c b/net/atm/proc.c index 5c9f3d148135..49487b313f22 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c | |||
@@ -417,12 +417,10 @@ int atm_proc_dev_register(struct atm_dev *dev) | |||
417 | goto err_out; | 417 | goto err_out; |
418 | sprintf(dev->proc_name,"%s:%d",dev->type, dev->number); | 418 | sprintf(dev->proc_name,"%s:%d",dev->type, dev->number); |
419 | 419 | ||
420 | dev->proc_entry = proc_create(dev->proc_name, 0, atm_proc_root, | 420 | dev->proc_entry = proc_create_data(dev->proc_name, 0, atm_proc_root, |
421 | &proc_atm_dev_ops); | 421 | &proc_atm_dev_ops, dev); |
422 | if (!dev->proc_entry) | 422 | if (!dev->proc_entry) |
423 | goto err_free_name; | 423 | goto err_free_name; |
424 | dev->proc_entry->data = dev; | ||
425 | dev->proc_entry->owner = THIS_MODULE; | ||
426 | return 0; | 424 | return 0; |
427 | err_free_name: | 425 | err_free_name: |
428 | kfree(dev->proc_name); | 426 | kfree(dev->proc_name); |
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index 347e935faaf0..f85d94643aaf 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c | |||
@@ -135,7 +135,7 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, __be16 *data, int len | |||
135 | if (len < 2) | 135 | if (len < 2) |
136 | return -EILSEQ; | 136 | return -EILSEQ; |
137 | 137 | ||
138 | n = ntohs(get_unaligned(data)); | 138 | n = get_unaligned_be16(data); |
139 | data++; len -= 2; | 139 | data++; len -= 2; |
140 | 140 | ||
141 | if (len < n) | 141 | if (len < n) |
@@ -150,8 +150,8 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, __be16 *data, int len | |||
150 | int i; | 150 | int i; |
151 | 151 | ||
152 | for (i = 0; i < n; i++) { | 152 | for (i = 0; i < n; i++) { |
153 | f[i].start = ntohs(get_unaligned(data++)); | 153 | f[i].start = get_unaligned_be16(data++); |
154 | f[i].end = ntohs(get_unaligned(data++)); | 154 | f[i].end = get_unaligned_be16(data++); |
155 | 155 | ||
156 | BT_DBG("proto filter start %d end %d", | 156 | BT_DBG("proto filter start %d end %d", |
157 | f[i].start, f[i].end); | 157 | f[i].start, f[i].end); |
@@ -180,7 +180,7 @@ static int bnep_ctrl_set_mcfilter(struct bnep_session *s, u8 *data, int len) | |||
180 | if (len < 2) | 180 | if (len < 2) |
181 | return -EILSEQ; | 181 | return -EILSEQ; |
182 | 182 | ||
183 | n = ntohs(get_unaligned((__be16 *) data)); | 183 | n = get_unaligned_be16(data); |
184 | data += 2; len -= 2; | 184 | data += 2; len -= 2; |
185 | 185 | ||
186 | if (len < n) | 186 | if (len < n) |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 46df2e403df8..6aef8f24e581 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -129,8 +129,7 @@ static void hci_cc_write_link_policy(struct hci_dev *hdev, struct sk_buff *skb) | |||
129 | 129 | ||
130 | conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); | 130 | conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); |
131 | if (conn) { | 131 | if (conn) { |
132 | __le16 policy = get_unaligned((__le16 *) (sent + 2)); | 132 | conn->link_policy = get_unaligned_le16(sent + 2); |
133 | conn->link_policy = __le16_to_cpu(policy); | ||
134 | } | 133 | } |
135 | 134 | ||
136 | hci_dev_unlock(hdev); | 135 | hci_dev_unlock(hdev); |
@@ -313,7 +312,7 @@ static void hci_cc_write_voice_setting(struct hci_dev *hdev, struct sk_buff *skb | |||
313 | return; | 312 | return; |
314 | 313 | ||
315 | if (!status) { | 314 | if (!status) { |
316 | __u16 setting = __le16_to_cpu(get_unaligned((__le16 *) sent)); | 315 | __u16 setting = get_unaligned_le16(sent); |
317 | 316 | ||
318 | if (hdev->voice_setting != setting) { | 317 | if (hdev->voice_setting != setting) { |
319 | hdev->voice_setting = setting; | 318 | hdev->voice_setting = setting; |
@@ -1152,8 +1151,8 @@ static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *s | |||
1152 | struct hci_conn *conn; | 1151 | struct hci_conn *conn; |
1153 | __u16 handle, count; | 1152 | __u16 handle, count; |
1154 | 1153 | ||
1155 | handle = __le16_to_cpu(get_unaligned(ptr++)); | 1154 | handle = get_unaligned_le16(ptr++); |
1156 | count = __le16_to_cpu(get_unaligned(ptr++)); | 1155 | count = get_unaligned_le16(ptr++); |
1157 | 1156 | ||
1158 | conn = hci_conn_hash_lookup_handle(hdev, handle); | 1157 | conn = hci_conn_hash_lookup_handle(hdev, handle); |
1159 | if (conn) { | 1158 | if (conn) { |
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 1d36c093523b..747fabd735d2 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -440,7 +440,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
440 | skb->dev = (void *) hdev; | 440 | skb->dev = (void *) hdev; |
441 | 441 | ||
442 | if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) { | 442 | if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) { |
443 | u16 opcode = __le16_to_cpu(get_unaligned((__le16 *) skb->data)); | 443 | u16 opcode = get_unaligned_le16(skb->data); |
444 | u16 ogf = hci_opcode_ogf(opcode); | 444 | u16 ogf = hci_opcode_ogf(opcode); |
445 | u16 ocf = hci_opcode_ocf(opcode); | 445 | u16 ocf = hci_opcode_ocf(opcode); |
446 | 446 | ||
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index a4849f2c1d81..6e180d255505 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -1827,7 +1827,7 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm | |||
1827 | del_timer(&conn->info_timer); | 1827 | del_timer(&conn->info_timer); |
1828 | 1828 | ||
1829 | if (type == L2CAP_IT_FEAT_MASK) | 1829 | if (type == L2CAP_IT_FEAT_MASK) |
1830 | conn->feat_mask = __le32_to_cpu(get_unaligned((__le32 *) rsp->data)); | 1830 | conn->feat_mask = get_unaligned_le32(rsp->data); |
1831 | 1831 | ||
1832 | l2cap_conn_start(conn); | 1832 | l2cap_conn_start(conn); |
1833 | 1833 | ||
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 9326c377822e..72c5976a5ce3 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -285,7 +285,11 @@ int br_fdb_fillbuf(struct net_bridge *br, void *buf, | |||
285 | 285 | ||
286 | /* convert from internal format to API */ | 286 | /* convert from internal format to API */ |
287 | memcpy(fe->mac_addr, f->addr.addr, ETH_ALEN); | 287 | memcpy(fe->mac_addr, f->addr.addr, ETH_ALEN); |
288 | |||
289 | /* due to ABI compat need to split into hi/lo */ | ||
288 | fe->port_no = f->dst->port_no; | 290 | fe->port_no = f->dst->port_no; |
291 | fe->port_hi = f->dst->port_no >> 8; | ||
292 | |||
289 | fe->is_local = f->is_local; | 293 | fe->is_local = f->is_local; |
290 | if (!f->is_static) | 294 | if (!f->is_static) |
291 | fe->ageing_timer_value = jiffies_to_clock_t(jiffies - f->ageing_timer); | 295 | fe->ageing_timer_value = jiffies_to_clock_t(jiffies - f->ageing_timer); |
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c index 8deab645ef75..ddeb6e5d45d6 100644 --- a/net/bridge/br_stp_bpdu.c +++ b/net/bridge/br_stp_bpdu.c | |||
@@ -58,12 +58,12 @@ static inline void br_set_ticks(unsigned char *dest, int j) | |||
58 | { | 58 | { |
59 | unsigned long ticks = (STP_HZ * j)/ HZ; | 59 | unsigned long ticks = (STP_HZ * j)/ HZ; |
60 | 60 | ||
61 | put_unaligned(htons(ticks), (__be16 *)dest); | 61 | put_unaligned_be16(ticks, dest); |
62 | } | 62 | } |
63 | 63 | ||
64 | static inline int br_get_ticks(const unsigned char *src) | 64 | static inline int br_get_ticks(const unsigned char *src) |
65 | { | 65 | { |
66 | unsigned long ticks = ntohs(get_unaligned((__be16 *)src)); | 66 | unsigned long ticks = get_unaligned_be16(src); |
67 | 67 | ||
68 | return DIV_ROUND_UP(ticks * HZ, STP_HZ); | 68 | return DIV_ROUND_UP(ticks * HZ, STP_HZ); |
69 | } | 69 | } |
diff --git a/net/core/dev.c b/net/core/dev.c index ed49da592051..d334446a8eaf 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -162,7 +162,7 @@ struct net_dma { | |||
162 | struct dma_client client; | 162 | struct dma_client client; |
163 | spinlock_t lock; | 163 | spinlock_t lock; |
164 | cpumask_t channel_mask; | 164 | cpumask_t channel_mask; |
165 | struct dma_chan *channels[NR_CPUS]; | 165 | struct dma_chan **channels; |
166 | }; | 166 | }; |
167 | 167 | ||
168 | static enum dma_state_client | 168 | static enum dma_state_client |
@@ -2444,7 +2444,7 @@ static struct netif_rx_stats *softnet_get_online(loff_t *pos) | |||
2444 | { | 2444 | { |
2445 | struct netif_rx_stats *rc = NULL; | 2445 | struct netif_rx_stats *rc = NULL; |
2446 | 2446 | ||
2447 | while (*pos < NR_CPUS) | 2447 | while (*pos < nr_cpu_ids) |
2448 | if (cpu_online(*pos)) { | 2448 | if (cpu_online(*pos)) { |
2449 | rc = &per_cpu(netdev_rx_stat, *pos); | 2449 | rc = &per_cpu(netdev_rx_stat, *pos); |
2450 | break; | 2450 | break; |
@@ -3776,6 +3776,7 @@ int register_netdevice(struct net_device *dev) | |||
3776 | } | 3776 | } |
3777 | } | 3777 | } |
3778 | 3778 | ||
3779 | netdev_initialize_kobject(dev); | ||
3779 | ret = netdev_register_kobject(dev); | 3780 | ret = netdev_register_kobject(dev); |
3780 | if (ret) | 3781 | if (ret) |
3781 | goto err_uninit; | 3782 | goto err_uninit; |
@@ -4208,7 +4209,8 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char | |||
4208 | } | 4209 | } |
4209 | 4210 | ||
4210 | /* Fixup kobjects */ | 4211 | /* Fixup kobjects */ |
4211 | err = device_rename(&dev->dev, dev->name); | 4212 | netdev_unregister_kobject(dev); |
4213 | err = netdev_register_kobject(dev); | ||
4212 | WARN_ON(err); | 4214 | WARN_ON(err); |
4213 | 4215 | ||
4214 | /* Add the device back in the hashes */ | 4216 | /* Add the device back in the hashes */ |
@@ -4324,7 +4326,7 @@ netdev_dma_event(struct dma_client *client, struct dma_chan *chan, | |||
4324 | spin_lock(&net_dma->lock); | 4326 | spin_lock(&net_dma->lock); |
4325 | switch (state) { | 4327 | switch (state) { |
4326 | case DMA_RESOURCE_AVAILABLE: | 4328 | case DMA_RESOURCE_AVAILABLE: |
4327 | for (i = 0; i < NR_CPUS; i++) | 4329 | for (i = 0; i < nr_cpu_ids; i++) |
4328 | if (net_dma->channels[i] == chan) { | 4330 | if (net_dma->channels[i] == chan) { |
4329 | found = 1; | 4331 | found = 1; |
4330 | break; | 4332 | break; |
@@ -4339,7 +4341,7 @@ netdev_dma_event(struct dma_client *client, struct dma_chan *chan, | |||
4339 | } | 4341 | } |
4340 | break; | 4342 | break; |
4341 | case DMA_RESOURCE_REMOVED: | 4343 | case DMA_RESOURCE_REMOVED: |
4342 | for (i = 0; i < NR_CPUS; i++) | 4344 | for (i = 0; i < nr_cpu_ids; i++) |
4343 | if (net_dma->channels[i] == chan) { | 4345 | if (net_dma->channels[i] == chan) { |
4344 | found = 1; | 4346 | found = 1; |
4345 | pos = i; | 4347 | pos = i; |
@@ -4366,6 +4368,13 @@ netdev_dma_event(struct dma_client *client, struct dma_chan *chan, | |||
4366 | */ | 4368 | */ |
4367 | static int __init netdev_dma_register(void) | 4369 | static int __init netdev_dma_register(void) |
4368 | { | 4370 | { |
4371 | net_dma.channels = kzalloc(nr_cpu_ids * sizeof(struct net_dma), | ||
4372 | GFP_KERNEL); | ||
4373 | if (unlikely(!net_dma.channels)) { | ||
4374 | printk(KERN_NOTICE | ||
4375 | "netdev_dma: no memory for net_dma.channels\n"); | ||
4376 | return -ENOMEM; | ||
4377 | } | ||
4369 | spin_lock_init(&net_dma.lock); | 4378 | spin_lock_init(&net_dma.lock); |
4370 | dma_cap_set(DMA_MEMCPY, net_dma.client.cap_mask); | 4379 | dma_cap_set(DMA_MEMCPY, net_dma.client.cap_mask); |
4371 | dma_async_client_register(&net_dma.client); | 4380 | dma_async_client_register(&net_dma.client); |
diff --git a/net/core/filter.c b/net/core/filter.c index f5f3cf603064..4f8369729a4e 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
@@ -213,7 +213,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int | |||
213 | load_w: | 213 | load_w: |
214 | ptr = load_pointer(skb, k, 4, &tmp); | 214 | ptr = load_pointer(skb, k, 4, &tmp); |
215 | if (ptr != NULL) { | 215 | if (ptr != NULL) { |
216 | A = ntohl(get_unaligned((__be32 *)ptr)); | 216 | A = get_unaligned_be32(ptr); |
217 | continue; | 217 | continue; |
218 | } | 218 | } |
219 | break; | 219 | break; |
@@ -222,7 +222,7 @@ load_w: | |||
222 | load_h: | 222 | load_h: |
223 | ptr = load_pointer(skb, k, 2, &tmp); | 223 | ptr = load_pointer(skb, k, 2, &tmp); |
224 | if (ptr != NULL) { | 224 | if (ptr != NULL) { |
225 | A = ntohs(get_unaligned((__be16 *)ptr)); | 225 | A = get_unaligned_be16(ptr); |
226 | continue; | 226 | continue; |
227 | } | 227 | } |
228 | break; | 228 | break; |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 75075c303c44..5d9d7130bd6e 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1430,11 +1430,10 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl) | |||
1430 | panic("cannot create neighbour cache statistics"); | 1430 | panic("cannot create neighbour cache statistics"); |
1431 | 1431 | ||
1432 | #ifdef CONFIG_PROC_FS | 1432 | #ifdef CONFIG_PROC_FS |
1433 | tbl->pde = proc_create(tbl->id, 0, init_net.proc_net_stat, | 1433 | tbl->pde = proc_create_data(tbl->id, 0, init_net.proc_net_stat, |
1434 | &neigh_stat_seq_fops); | 1434 | &neigh_stat_seq_fops, tbl); |
1435 | if (!tbl->pde) | 1435 | if (!tbl->pde) |
1436 | panic("cannot create neighbour proc dir entry"); | 1436 | panic("cannot create neighbour proc dir entry"); |
1437 | tbl->pde->data = tbl; | ||
1438 | #endif | 1437 | #endif |
1439 | 1438 | ||
1440 | tbl->hash_mask = 1; | 1439 | tbl->hash_mask = 1; |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 4e7b847347f7..90e2177af081 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -449,7 +449,6 @@ int netdev_register_kobject(struct net_device *net) | |||
449 | struct device *dev = &(net->dev); | 449 | struct device *dev = &(net->dev); |
450 | struct attribute_group **groups = net->sysfs_groups; | 450 | struct attribute_group **groups = net->sysfs_groups; |
451 | 451 | ||
452 | device_initialize(dev); | ||
453 | dev->class = &net_class; | 452 | dev->class = &net_class; |
454 | dev->platform_data = net; | 453 | dev->platform_data = net; |
455 | dev->groups = groups; | 454 | dev->groups = groups; |
@@ -470,6 +469,12 @@ int netdev_register_kobject(struct net_device *net) | |||
470 | return device_add(dev); | 469 | return device_add(dev); |
471 | } | 470 | } |
472 | 471 | ||
472 | void netdev_initialize_kobject(struct net_device *net) | ||
473 | { | ||
474 | struct device *device = &(net->dev); | ||
475 | device_initialize(device); | ||
476 | } | ||
477 | |||
473 | int netdev_kobject_init(void) | 478 | int netdev_kobject_init(void) |
474 | { | 479 | { |
475 | return class_register(&net_class); | 480 | return class_register(&net_class); |
diff --git a/net/core/net-sysfs.h b/net/core/net-sysfs.h index f5f108db3924..14e7524260b3 100644 --- a/net/core/net-sysfs.h +++ b/net/core/net-sysfs.h | |||
@@ -4,5 +4,5 @@ | |||
4 | int netdev_kobject_init(void); | 4 | int netdev_kobject_init(void); |
5 | int netdev_register_kobject(struct net_device *); | 5 | int netdev_register_kobject(struct net_device *); |
6 | void netdev_unregister_kobject(struct net_device *); | 6 | void netdev_unregister_kobject(struct net_device *); |
7 | 7 | void netdev_initialize_kobject(struct net_device *); | |
8 | #endif | 8 | #endif |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index a803b442234c..8dca21110493 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -3570,15 +3570,14 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname) | |||
3570 | if (err) | 3570 | if (err) |
3571 | goto out1; | 3571 | goto out1; |
3572 | 3572 | ||
3573 | pkt_dev->entry = proc_create(ifname, 0600, | 3573 | pkt_dev->entry = proc_create_data(ifname, 0600, pg_proc_dir, |
3574 | pg_proc_dir, &pktgen_if_fops); | 3574 | &pktgen_if_fops, pkt_dev); |
3575 | if (!pkt_dev->entry) { | 3575 | if (!pkt_dev->entry) { |
3576 | printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", | 3576 | printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", |
3577 | PG_PROC_DIR, ifname); | 3577 | PG_PROC_DIR, ifname); |
3578 | err = -EINVAL; | 3578 | err = -EINVAL; |
3579 | goto out2; | 3579 | goto out2; |
3580 | } | 3580 | } |
3581 | pkt_dev->entry->data = pkt_dev; | ||
3582 | #ifdef CONFIG_XFRM | 3581 | #ifdef CONFIG_XFRM |
3583 | pkt_dev->ipsmode = XFRM_MODE_TRANSPORT; | 3582 | pkt_dev->ipsmode = XFRM_MODE_TRANSPORT; |
3584 | pkt_dev->ipsproto = IPPROTO_ESP; | 3583 | pkt_dev->ipsproto = IPPROTO_ESP; |
@@ -3628,7 +3627,8 @@ static int __init pktgen_create_thread(int cpu) | |||
3628 | kthread_bind(p, cpu); | 3627 | kthread_bind(p, cpu); |
3629 | t->tsk = p; | 3628 | t->tsk = p; |
3630 | 3629 | ||
3631 | pe = proc_create(t->tsk->comm, 0600, pg_proc_dir, &pktgen_thread_fops); | 3630 | pe = proc_create_data(t->tsk->comm, 0600, pg_proc_dir, |
3631 | &pktgen_thread_fops, t); | ||
3632 | if (!pe) { | 3632 | if (!pe) { |
3633 | printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", | 3633 | printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", |
3634 | PG_PROC_DIR, t->tsk->comm); | 3634 | PG_PROC_DIR, t->tsk->comm); |
@@ -3638,8 +3638,6 @@ static int __init pktgen_create_thread(int cpu) | |||
3638 | return -EINVAL; | 3638 | return -EINVAL; |
3639 | } | 3639 | } |
3640 | 3640 | ||
3641 | pe->data = t; | ||
3642 | |||
3643 | wake_up_process(p); | 3641 | wake_up_process(p); |
3644 | 3642 | ||
3645 | return 0; | 3643 | return 0; |
@@ -3716,8 +3714,6 @@ static int __init pg_init(void) | |||
3716 | return -EINVAL; | 3714 | return -EINVAL; |
3717 | } | 3715 | } |
3718 | 3716 | ||
3719 | pe->data = NULL; | ||
3720 | |||
3721 | /* Register us to receive netdevice events */ | 3717 | /* Register us to receive netdevice events */ |
3722 | register_netdevice_notifier(&pktgen_notifier_block); | 3718 | register_netdevice_notifier(&pktgen_notifier_block); |
3723 | 3719 | ||
diff --git a/net/core/sock.c b/net/core/sock.c index 5dbb81bc9673..fa76f04fa9c6 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -228,11 +228,12 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen) | |||
228 | static int warned __read_mostly; | 228 | static int warned __read_mostly; |
229 | 229 | ||
230 | *timeo_p = 0; | 230 | *timeo_p = 0; |
231 | if (warned < 10 && net_ratelimit()) | 231 | if (warned < 10 && net_ratelimit()) { |
232 | warned++; | 232 | warned++; |
233 | printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) " | 233 | printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) " |
234 | "tries to set negative timeout\n", | 234 | "tries to set negative timeout\n", |
235 | current->comm, task_pid_nr(current)); | 235 | current->comm, task_pid_nr(current)); |
236 | } | ||
236 | return 0; | 237 | return 0; |
237 | } | 238 | } |
238 | *timeo_p = MAX_SCHEDULE_TIMEOUT; | 239 | *timeo_p = MAX_SCHEDULE_TIMEOUT; |
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index b5b52ebb2693..8e9580874216 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
@@ -716,7 +716,7 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk) | |||
716 | * packets for new connections, following the rules from [RFC3390]". | 716 | * packets for new connections, following the rules from [RFC3390]". |
717 | * We need to convert the bytes of RFC3390 into the packets of RFC 4341. | 717 | * We need to convert the bytes of RFC3390 into the packets of RFC 4341. |
718 | */ | 718 | */ |
719 | hctx->ccid2hctx_cwnd = min(4U, max(2U, 4380U / dp->dccps_mss_cache)); | 719 | hctx->ccid2hctx_cwnd = clamp(4380U / dp->dccps_mss_cache, 2U, 4U); |
720 | 720 | ||
721 | /* Make sure that Ack Ratio is enabled and within bounds. */ | 721 | /* Make sure that Ack Ratio is enabled and within bounds. */ |
722 | max_ratio = DIV_ROUND_UP(hctx->ccid2hctx_cwnd, 2); | 722 | max_ratio = DIV_ROUND_UP(hctx->ccid2hctx_cwnd, 2); |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index e76f460af0ea..cd61dea2eea1 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -88,8 +88,8 @@ static void ccid3_hc_tx_set_state(struct sock *sk, | |||
88 | static inline u64 rfc3390_initial_rate(struct sock *sk) | 88 | static inline u64 rfc3390_initial_rate(struct sock *sk) |
89 | { | 89 | { |
90 | const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); | 90 | const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); |
91 | const __u32 w_init = min_t(__u32, 4 * hctx->ccid3hctx_s, | 91 | const __u32 w_init = clamp_t(__u32, 4380U, |
92 | max_t(__u32, 2 * hctx->ccid3hctx_s, 4380)); | 92 | 2 * hctx->ccid3hctx_s, 4 * hctx->ccid3hctx_s); |
93 | 93 | ||
94 | return scaled_div(w_init << 6, hctx->ccid3hctx_rtt); | 94 | return scaled_div(w_init << 6, hctx->ccid3hctx_rtt); |
95 | } | 95 | } |
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index 4637ded3dba8..05afb576d935 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
@@ -983,7 +983,7 @@ static int cipso_v4_map_cat_enum_valid(const struct cipso_v4_doi *doi_def, | |||
983 | return -EFAULT; | 983 | return -EFAULT; |
984 | 984 | ||
985 | for (iter = 0; iter < enumcat_len; iter += 2) { | 985 | for (iter = 0; iter < enumcat_len; iter += 2) { |
986 | cat = ntohs(get_unaligned((__be16 *)&enumcat[iter])); | 986 | cat = get_unaligned_be16(&enumcat[iter]); |
987 | if (cat <= cat_prev) | 987 | if (cat <= cat_prev) |
988 | return -EFAULT; | 988 | return -EFAULT; |
989 | cat_prev = cat; | 989 | cat_prev = cat; |
@@ -1052,7 +1052,7 @@ static int cipso_v4_map_cat_enum_ntoh(const struct cipso_v4_doi *doi_def, | |||
1052 | 1052 | ||
1053 | for (iter = 0; iter < net_cat_len; iter += 2) { | 1053 | for (iter = 0; iter < net_cat_len; iter += 2) { |
1054 | ret_val = netlbl_secattr_catmap_setbit(secattr->attr.mls.cat, | 1054 | ret_val = netlbl_secattr_catmap_setbit(secattr->attr.mls.cat, |
1055 | ntohs(get_unaligned((__be16 *)&net_cat[iter])), | 1055 | get_unaligned_be16(&net_cat[iter]), |
1056 | GFP_ATOMIC); | 1056 | GFP_ATOMIC); |
1057 | if (ret_val != 0) | 1057 | if (ret_val != 0) |
1058 | return ret_val; | 1058 | return ret_val; |
@@ -1086,10 +1086,9 @@ static int cipso_v4_map_cat_rng_valid(const struct cipso_v4_doi *doi_def, | |||
1086 | return -EFAULT; | 1086 | return -EFAULT; |
1087 | 1087 | ||
1088 | for (iter = 0; iter < rngcat_len; iter += 4) { | 1088 | for (iter = 0; iter < rngcat_len; iter += 4) { |
1089 | cat_high = ntohs(get_unaligned((__be16 *)&rngcat[iter])); | 1089 | cat_high = get_unaligned_be16(&rngcat[iter]); |
1090 | if ((iter + 4) <= rngcat_len) | 1090 | if ((iter + 4) <= rngcat_len) |
1091 | cat_low = ntohs( | 1091 | cat_low = get_unaligned_be16(&rngcat[iter + 2]); |
1092 | get_unaligned((__be16 *)&rngcat[iter + 2])); | ||
1093 | else | 1092 | else |
1094 | cat_low = 0; | 1093 | cat_low = 0; |
1095 | 1094 | ||
@@ -1188,10 +1187,9 @@ static int cipso_v4_map_cat_rng_ntoh(const struct cipso_v4_doi *doi_def, | |||
1188 | u16 cat_high; | 1187 | u16 cat_high; |
1189 | 1188 | ||
1190 | for (net_iter = 0; net_iter < net_cat_len; net_iter += 4) { | 1189 | for (net_iter = 0; net_iter < net_cat_len; net_iter += 4) { |
1191 | cat_high = ntohs(get_unaligned((__be16 *)&net_cat[net_iter])); | 1190 | cat_high = get_unaligned_be16(&net_cat[net_iter]); |
1192 | if ((net_iter + 4) <= net_cat_len) | 1191 | if ((net_iter + 4) <= net_cat_len) |
1193 | cat_low = ntohs( | 1192 | cat_low = get_unaligned_be16(&net_cat[net_iter + 2]); |
1194 | get_unaligned((__be16 *)&net_cat[net_iter + 2])); | ||
1195 | else | 1193 | else |
1196 | cat_low = 0; | 1194 | cat_low = 0; |
1197 | 1195 | ||
@@ -1562,7 +1560,7 @@ int cipso_v4_validate(unsigned char **option) | |||
1562 | } | 1560 | } |
1563 | 1561 | ||
1564 | rcu_read_lock(); | 1562 | rcu_read_lock(); |
1565 | doi_def = cipso_v4_doi_search(ntohl(get_unaligned((__be32 *)&opt[2]))); | 1563 | doi_def = cipso_v4_doi_search(get_unaligned_be32(&opt[2])); |
1566 | if (doi_def == NULL) { | 1564 | if (doi_def == NULL) { |
1567 | err_offset = 2; | 1565 | err_offset = 2; |
1568 | goto validate_return_locked; | 1566 | goto validate_return_locked; |
@@ -1843,7 +1841,7 @@ static int cipso_v4_getattr(const unsigned char *cipso, | |||
1843 | if (cipso_v4_cache_check(cipso, cipso[1], secattr) == 0) | 1841 | if (cipso_v4_cache_check(cipso, cipso[1], secattr) == 0) |
1844 | return 0; | 1842 | return 0; |
1845 | 1843 | ||
1846 | doi = ntohl(get_unaligned((__be32 *)&cipso[2])); | 1844 | doi = get_unaligned_be32(&cipso[2]); |
1847 | rcu_read_lock(); | 1845 | rcu_read_lock(); |
1848 | doi_def = cipso_v4_doi_search(doi); | 1846 | doi_def = cipso_v4_doi_search(doi); |
1849 | if (doi_def == NULL) | 1847 | if (doi_def == NULL) |
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 22d8e7cd9197..1819ad7ab910 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -169,14 +169,14 @@ clusterip_config_init(const struct ipt_clusterip_tgt_info *i, __be32 ip, | |||
169 | 169 | ||
170 | /* create proc dir entry */ | 170 | /* create proc dir entry */ |
171 | sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); | 171 | sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); |
172 | c->pde = proc_create(buffer, S_IWUSR|S_IRUSR, | 172 | c->pde = proc_create_data(buffer, S_IWUSR|S_IRUSR, |
173 | clusterip_procdir, &clusterip_proc_fops); | 173 | clusterip_procdir, |
174 | &clusterip_proc_fops, c); | ||
174 | if (!c->pde) { | 175 | if (!c->pde) { |
175 | kfree(c); | 176 | kfree(c); |
176 | return NULL; | 177 | return NULL; |
177 | } | 178 | } |
178 | } | 179 | } |
179 | c->pde->data = c; | ||
180 | #endif | 180 | #endif |
181 | 181 | ||
182 | write_lock_bh(&clusterip_lock); | 182 | write_lock_bh(&clusterip_lock); |
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c index 44618b675916..bfcbd148a89d 100644 --- a/net/ipv4/tcp_hybla.c +++ b/net/ipv4/tcp_hybla.c | |||
@@ -101,8 +101,10 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight) | |||
101 | if (!tcp_is_cwnd_limited(sk, in_flight)) | 101 | if (!tcp_is_cwnd_limited(sk, in_flight)) |
102 | return; | 102 | return; |
103 | 103 | ||
104 | if (!ca->hybla_en) | 104 | if (!ca->hybla_en) { |
105 | return tcp_reno_cong_avoid(sk, ack, in_flight); | 105 | tcp_reno_cong_avoid(sk, ack, in_flight); |
106 | return; | ||
107 | } | ||
106 | 108 | ||
107 | if (ca->rho == 0) | 109 | if (ca->rho == 0) |
108 | hybla_recalc_param(sk); | 110 | hybla_recalc_param(sk); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 0298f80681f2..eda4f4a233f3 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -1172,8 +1172,8 @@ static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb, | |||
1172 | struct tcp_sack_block_wire *sp, int num_sacks, | 1172 | struct tcp_sack_block_wire *sp, int num_sacks, |
1173 | u32 prior_snd_una) | 1173 | u32 prior_snd_una) |
1174 | { | 1174 | { |
1175 | u32 start_seq_0 = ntohl(get_unaligned(&sp[0].start_seq)); | 1175 | u32 start_seq_0 = get_unaligned_be32(&sp[0].start_seq); |
1176 | u32 end_seq_0 = ntohl(get_unaligned(&sp[0].end_seq)); | 1176 | u32 end_seq_0 = get_unaligned_be32(&sp[0].end_seq); |
1177 | int dup_sack = 0; | 1177 | int dup_sack = 0; |
1178 | 1178 | ||
1179 | if (before(start_seq_0, TCP_SKB_CB(ack_skb)->ack_seq)) { | 1179 | if (before(start_seq_0, TCP_SKB_CB(ack_skb)->ack_seq)) { |
@@ -1181,8 +1181,8 @@ static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb, | |||
1181 | tcp_dsack_seen(tp); | 1181 | tcp_dsack_seen(tp); |
1182 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); | 1182 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); |
1183 | } else if (num_sacks > 1) { | 1183 | } else if (num_sacks > 1) { |
1184 | u32 end_seq_1 = ntohl(get_unaligned(&sp[1].end_seq)); | 1184 | u32 end_seq_1 = get_unaligned_be32(&sp[1].end_seq); |
1185 | u32 start_seq_1 = ntohl(get_unaligned(&sp[1].start_seq)); | 1185 | u32 start_seq_1 = get_unaligned_be32(&sp[1].start_seq); |
1186 | 1186 | ||
1187 | if (!after(end_seq_0, end_seq_1) && | 1187 | if (!after(end_seq_0, end_seq_1) && |
1188 | !before(start_seq_0, start_seq_1)) { | 1188 | !before(start_seq_0, start_seq_1)) { |
@@ -1453,8 +1453,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, | |||
1453 | for (i = 0; i < num_sacks; i++) { | 1453 | for (i = 0; i < num_sacks; i++) { |
1454 | int dup_sack = !i && found_dup_sack; | 1454 | int dup_sack = !i && found_dup_sack; |
1455 | 1455 | ||
1456 | sp[used_sacks].start_seq = ntohl(get_unaligned(&sp_wire[i].start_seq)); | 1456 | sp[used_sacks].start_seq = get_unaligned_be32(&sp_wire[i].start_seq); |
1457 | sp[used_sacks].end_seq = ntohl(get_unaligned(&sp_wire[i].end_seq)); | 1457 | sp[used_sacks].end_seq = get_unaligned_be32(&sp_wire[i].end_seq); |
1458 | 1458 | ||
1459 | if (!tcp_is_sackblock_valid(tp, dup_sack, | 1459 | if (!tcp_is_sackblock_valid(tp, dup_sack, |
1460 | sp[used_sacks].start_seq, | 1460 | sp[used_sacks].start_seq, |
@@ -3340,7 +3340,7 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, | |||
3340 | switch (opcode) { | 3340 | switch (opcode) { |
3341 | case TCPOPT_MSS: | 3341 | case TCPOPT_MSS: |
3342 | if (opsize == TCPOLEN_MSS && th->syn && !estab) { | 3342 | if (opsize == TCPOLEN_MSS && th->syn && !estab) { |
3343 | u16 in_mss = ntohs(get_unaligned((__be16 *)ptr)); | 3343 | u16 in_mss = get_unaligned_be16(ptr); |
3344 | if (in_mss) { | 3344 | if (in_mss) { |
3345 | if (opt_rx->user_mss && | 3345 | if (opt_rx->user_mss && |
3346 | opt_rx->user_mss < in_mss) | 3346 | opt_rx->user_mss < in_mss) |
@@ -3369,8 +3369,8 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, | |||
3369 | ((estab && opt_rx->tstamp_ok) || | 3369 | ((estab && opt_rx->tstamp_ok) || |
3370 | (!estab && sysctl_tcp_timestamps))) { | 3370 | (!estab && sysctl_tcp_timestamps))) { |
3371 | opt_rx->saw_tstamp = 1; | 3371 | opt_rx->saw_tstamp = 1; |
3372 | opt_rx->rcv_tsval = ntohl(get_unaligned((__be32 *)ptr)); | 3372 | opt_rx->rcv_tsval = get_unaligned_be32(ptr); |
3373 | opt_rx->rcv_tsecr = ntohl(get_unaligned((__be32 *)(ptr+4))); | 3373 | opt_rx->rcv_tsecr = get_unaligned_be32(ptr + 4); |
3374 | } | 3374 | } |
3375 | break; | 3375 | break; |
3376 | case TCPOPT_SACK_PERM: | 3376 | case TCPOPT_SACK_PERM: |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 0e9bc120707d..cd601a866c2f 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -2214,9 +2214,6 @@ static int tcp_seq_open(struct inode *inode, struct file *file) | |||
2214 | struct tcp_iter_state *s; | 2214 | struct tcp_iter_state *s; |
2215 | int err; | 2215 | int err; |
2216 | 2216 | ||
2217 | if (unlikely(afinfo == NULL)) | ||
2218 | return -EINVAL; | ||
2219 | |||
2220 | err = seq_open_net(inode, file, &afinfo->seq_ops, | 2217 | err = seq_open_net(inode, file, &afinfo->seq_ops, |
2221 | sizeof(struct tcp_iter_state)); | 2218 | sizeof(struct tcp_iter_state)); |
2222 | if (err < 0) | 2219 | if (err < 0) |
@@ -2241,10 +2238,9 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo) | |||
2241 | afinfo->seq_ops.next = tcp_seq_next; | 2238 | afinfo->seq_ops.next = tcp_seq_next; |
2242 | afinfo->seq_ops.stop = tcp_seq_stop; | 2239 | afinfo->seq_ops.stop = tcp_seq_stop; |
2243 | 2240 | ||
2244 | p = proc_net_fops_create(net, afinfo->name, S_IRUGO, &afinfo->seq_fops); | 2241 | p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net, |
2245 | if (p) | 2242 | &afinfo->seq_fops, afinfo); |
2246 | p->data = afinfo; | 2243 | if (!p) |
2247 | else | ||
2248 | rc = -ENOMEM; | 2244 | rc = -ENOMEM; |
2249 | return rc; | 2245 | return rc; |
2250 | } | 2246 | } |
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c index 0e1a8c91f78e..14504dada116 100644 --- a/net/ipv4/tcp_vegas.c +++ b/net/ipv4/tcp_vegas.c | |||
@@ -167,8 +167,10 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight) | |||
167 | struct tcp_sock *tp = tcp_sk(sk); | 167 | struct tcp_sock *tp = tcp_sk(sk); |
168 | struct vegas *vegas = inet_csk_ca(sk); | 168 | struct vegas *vegas = inet_csk_ca(sk); |
169 | 169 | ||
170 | if (!vegas->doing_vegas_now) | 170 | if (!vegas->doing_vegas_now) { |
171 | return tcp_reno_cong_avoid(sk, ack, in_flight); | 171 | tcp_reno_cong_avoid(sk, ack, in_flight); |
172 | return; | ||
173 | } | ||
172 | 174 | ||
173 | /* The key players are v_beg_snd_una and v_beg_snd_nxt. | 175 | /* The key players are v_beg_snd_una and v_beg_snd_nxt. |
174 | * | 176 | * |
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c index 2bf618a3b00b..d08b2e855c22 100644 --- a/net/ipv4/tcp_veno.c +++ b/net/ipv4/tcp_veno.c | |||
@@ -119,8 +119,10 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight) | |||
119 | struct tcp_sock *tp = tcp_sk(sk); | 119 | struct tcp_sock *tp = tcp_sk(sk); |
120 | struct veno *veno = inet_csk_ca(sk); | 120 | struct veno *veno = inet_csk_ca(sk); |
121 | 121 | ||
122 | if (!veno->doing_veno_now) | 122 | if (!veno->doing_veno_now) { |
123 | return tcp_reno_cong_avoid(sk, ack, in_flight); | 123 | tcp_reno_cong_avoid(sk, ack, in_flight); |
124 | return; | ||
125 | } | ||
124 | 126 | ||
125 | /* limited by applications */ | 127 | /* limited by applications */ |
126 | if (!tcp_is_cwnd_limited(sk, in_flight)) | 128 | if (!tcp_is_cwnd_limited(sk, in_flight)) |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 1f535e315188..db1cb7c96d63 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1605,10 +1605,9 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo) | |||
1605 | afinfo->seq_ops.next = udp_seq_next; | 1605 | afinfo->seq_ops.next = udp_seq_next; |
1606 | afinfo->seq_ops.stop = udp_seq_stop; | 1606 | afinfo->seq_ops.stop = udp_seq_stop; |
1607 | 1607 | ||
1608 | p = proc_net_fops_create(net, afinfo->name, S_IRUGO, &afinfo->seq_fops); | 1608 | p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net, |
1609 | if (p) | 1609 | &afinfo->seq_fops, afinfo); |
1610 | p->data = afinfo; | 1610 | if (!p) |
1611 | else | ||
1612 | rc = -ENOMEM; | 1611 | rc = -ENOMEM; |
1613 | return rc; | 1612 | return rc; |
1614 | } | 1613 | } |
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index ca8b82f96fe5..df0736a4cafa 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -247,13 +247,11 @@ int snmp6_register_dev(struct inet6_dev *idev) | |||
247 | if (!proc_net_devsnmp6) | 247 | if (!proc_net_devsnmp6) |
248 | return -ENOENT; | 248 | return -ENOENT; |
249 | 249 | ||
250 | p = proc_create(idev->dev->name, S_IRUGO, | 250 | p = proc_create_data(idev->dev->name, S_IRUGO, |
251 | proc_net_devsnmp6, &snmp6_seq_fops); | 251 | proc_net_devsnmp6, &snmp6_seq_fops, idev); |
252 | if (!p) | 252 | if (!p) |
253 | return -ENOMEM; | 253 | return -ENOMEM; |
254 | 254 | ||
255 | p->data = idev; | ||
256 | |||
257 | idev->stats.proc_dir_entry = p; | 255 | idev->stats.proc_dir_entry = p; |
258 | return 0; | 256 | return 0; |
259 | } | 257 | } |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 7b247e3a16fe..798cabc7535b 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -197,6 +197,7 @@ static void ip6_frag_expire(unsigned long data) | |||
197 | { | 197 | { |
198 | struct frag_queue *fq; | 198 | struct frag_queue *fq; |
199 | struct net_device *dev = NULL; | 199 | struct net_device *dev = NULL; |
200 | struct net *net; | ||
200 | 201 | ||
201 | fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q); | 202 | fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q); |
202 | 203 | ||
@@ -207,7 +208,8 @@ static void ip6_frag_expire(unsigned long data) | |||
207 | 208 | ||
208 | fq_kill(fq); | 209 | fq_kill(fq); |
209 | 210 | ||
210 | dev = dev_get_by_index(&init_net, fq->iif); | 211 | net = container_of(fq->q.net, struct net, ipv6.frags); |
212 | dev = dev_get_by_index(net, fq->iif); | ||
211 | if (!dev) | 213 | if (!dev) |
212 | goto out; | 214 | goto out; |
213 | 215 | ||
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 9e15c82960fe..4a105dc32dcd 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
@@ -451,12 +451,14 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self, | |||
451 | n = 2; | 451 | n = 2; |
452 | 452 | ||
453 | /* Get length, MSB first */ | 453 | /* Get length, MSB first */ |
454 | len = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2; | 454 | len = get_unaligned_be16(fp + n); |
455 | n += 2; | ||
455 | 456 | ||
456 | IRDA_DEBUG(4, "%s(), len=%d\n", __func__, len); | 457 | IRDA_DEBUG(4, "%s(), len=%d\n", __func__, len); |
457 | 458 | ||
458 | /* Get object ID, MSB first */ | 459 | /* Get object ID, MSB first */ |
459 | obj_id = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2; | 460 | obj_id = get_unaligned_be16(fp + n); |
461 | n += 2; | ||
460 | 462 | ||
461 | type = fp[n++]; | 463 | type = fp[n++]; |
462 | IRDA_DEBUG(4, "%s(), Value type = %d\n", __func__, type); | 464 | IRDA_DEBUG(4, "%s(), Value type = %d\n", __func__, type); |
@@ -506,7 +508,7 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self, | |||
506 | value = irias_new_string_value(fp+n); | 508 | value = irias_new_string_value(fp+n); |
507 | break; | 509 | break; |
508 | case IAS_OCT_SEQ: | 510 | case IAS_OCT_SEQ: |
509 | value_len = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); | 511 | value_len = get_unaligned_be16(fp + n); |
510 | n += 2; | 512 | n += 2; |
511 | 513 | ||
512 | /* Will truncate to IAS_MAX_OCTET_STRING bytes */ | 514 | /* Will truncate to IAS_MAX_OCTET_STRING bytes */ |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 8e53ce7ed444..c7314bf4bec2 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -354,7 +354,7 @@ struct ieee80211_if_sta { | |||
354 | int preq_queue_len; | 354 | int preq_queue_len; |
355 | struct mesh_stats mshstats; | 355 | struct mesh_stats mshstats; |
356 | struct mesh_config mshcfg; | 356 | struct mesh_config mshcfg; |
357 | u8 mesh_seqnum[3]; | 357 | u32 mesh_seqnum; |
358 | bool accepting_plinks; | 358 | bool accepting_plinks; |
359 | #endif | 359 | #endif |
360 | u16 aid; | 360 | u16 aid; |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index e9a978979d38..9ad4e3631b6b 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -255,22 +255,8 @@ static int ieee80211_open(struct net_device *dev) | |||
255 | 255 | ||
256 | switch (sdata->vif.type) { | 256 | switch (sdata->vif.type) { |
257 | case IEEE80211_IF_TYPE_WDS: | 257 | case IEEE80211_IF_TYPE_WDS: |
258 | if (is_zero_ether_addr(sdata->u.wds.remote_addr)) | 258 | if (!is_valid_ether_addr(sdata->u.wds.remote_addr)) |
259 | return -ENOLINK; | 259 | return -ENOLINK; |
260 | |||
261 | /* Create STA entry for the WDS peer */ | ||
262 | sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr, | ||
263 | GFP_KERNEL); | ||
264 | if (!sta) | ||
265 | return -ENOMEM; | ||
266 | |||
267 | sta->flags |= WLAN_STA_AUTHORIZED; | ||
268 | |||
269 | res = sta_info_insert(sta); | ||
270 | if (res) { | ||
271 | /* STA has been freed */ | ||
272 | return res; | ||
273 | } | ||
274 | break; | 260 | break; |
275 | case IEEE80211_IF_TYPE_VLAN: | 261 | case IEEE80211_IF_TYPE_VLAN: |
276 | if (!sdata->u.vlan.ap) | 262 | if (!sdata->u.vlan.ap) |
@@ -337,10 +323,8 @@ static int ieee80211_open(struct net_device *dev) | |||
337 | conf.type = sdata->vif.type; | 323 | conf.type = sdata->vif.type; |
338 | conf.mac_addr = dev->dev_addr; | 324 | conf.mac_addr = dev->dev_addr; |
339 | res = local->ops->add_interface(local_to_hw(local), &conf); | 325 | res = local->ops->add_interface(local_to_hw(local), &conf); |
340 | if (res && !local->open_count && local->ops->stop) | ||
341 | local->ops->stop(local_to_hw(local)); | ||
342 | if (res) | 326 | if (res) |
343 | return res; | 327 | goto err_stop; |
344 | 328 | ||
345 | ieee80211_if_config(dev); | 329 | ieee80211_if_config(dev); |
346 | ieee80211_reset_erp_info(dev); | 330 | ieee80211_reset_erp_info(dev); |
@@ -353,9 +337,29 @@ static int ieee80211_open(struct net_device *dev) | |||
353 | netif_carrier_on(dev); | 337 | netif_carrier_on(dev); |
354 | } | 338 | } |
355 | 339 | ||
340 | if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { | ||
341 | /* Create STA entry for the WDS peer */ | ||
342 | sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr, | ||
343 | GFP_KERNEL); | ||
344 | if (!sta) { | ||
345 | res = -ENOMEM; | ||
346 | goto err_del_interface; | ||
347 | } | ||
348 | |||
349 | sta->flags |= WLAN_STA_AUTHORIZED; | ||
350 | |||
351 | res = sta_info_insert(sta); | ||
352 | if (res) { | ||
353 | /* STA has been freed */ | ||
354 | goto err_del_interface; | ||
355 | } | ||
356 | } | ||
357 | |||
356 | if (local->open_count == 0) { | 358 | if (local->open_count == 0) { |
357 | res = dev_open(local->mdev); | 359 | res = dev_open(local->mdev); |
358 | WARN_ON(res); | 360 | WARN_ON(res); |
361 | if (res) | ||
362 | goto err_del_interface; | ||
359 | tasklet_enable(&local->tx_pending_tasklet); | 363 | tasklet_enable(&local->tx_pending_tasklet); |
360 | tasklet_enable(&local->tasklet); | 364 | tasklet_enable(&local->tasklet); |
361 | } | 365 | } |
@@ -390,6 +394,12 @@ static int ieee80211_open(struct net_device *dev) | |||
390 | netif_start_queue(dev); | 394 | netif_start_queue(dev); |
391 | 395 | ||
392 | return 0; | 396 | return 0; |
397 | err_del_interface: | ||
398 | local->ops->remove_interface(local_to_hw(local), &conf); | ||
399 | err_stop: | ||
400 | if (!local->open_count && local->ops->stop) | ||
401 | local->ops->stop(local_to_hw(local)); | ||
402 | return res; | ||
393 | } | 403 | } |
394 | 404 | ||
395 | static int ieee80211_stop(struct net_device *dev) | 405 | static int ieee80211_stop(struct net_device *dev) |
@@ -975,6 +985,7 @@ static int __ieee80211_if_config(struct net_device *dev, | |||
975 | conf.ssid_len = sdata->u.sta.ssid_len; | 985 | conf.ssid_len = sdata->u.sta.ssid_len; |
976 | } else if (ieee80211_vif_is_mesh(&sdata->vif)) { | 986 | } else if (ieee80211_vif_is_mesh(&sdata->vif)) { |
977 | conf.beacon = beacon; | 987 | conf.beacon = beacon; |
988 | conf.beacon_control = control; | ||
978 | ieee80211_start_mesh(dev); | 989 | ieee80211_start_mesh(dev); |
979 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { | 990 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { |
980 | conf.ssid = sdata->u.ap.ssid; | 991 | conf.ssid = sdata->u.ap.ssid; |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 594a3356a508..f76bc26ae4d2 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <asm/unaligned.h> | ||
11 | #include "ieee80211_i.h" | 12 | #include "ieee80211_i.h" |
12 | #include "mesh.h" | 13 | #include "mesh.h" |
13 | 14 | ||
@@ -167,8 +168,8 @@ int mesh_rmc_check(u8 *sa, struct ieee80211s_hdr *mesh_hdr, | |||
167 | struct rmc_entry *p, *n; | 168 | struct rmc_entry *p, *n; |
168 | 169 | ||
169 | /* Don't care about endianness since only match matters */ | 170 | /* Don't care about endianness since only match matters */ |
170 | memcpy(&seqnum, mesh_hdr->seqnum, sizeof(mesh_hdr->seqnum)); | 171 | memcpy(&seqnum, &mesh_hdr->seqnum, sizeof(mesh_hdr->seqnum)); |
171 | idx = mesh_hdr->seqnum[0] & rmc->idx_mask; | 172 | idx = le32_to_cpu(mesh_hdr->seqnum) & rmc->idx_mask; |
172 | list_for_each_entry_safe(p, n, &rmc->bucket[idx].list, list) { | 173 | list_for_each_entry_safe(p, n, &rmc->bucket[idx].list, list) { |
173 | ++entries; | 174 | ++entries; |
174 | if (time_after(jiffies, p->exp_time) || | 175 | if (time_after(jiffies, p->exp_time) || |
@@ -393,16 +394,8 @@ int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr, | |||
393 | { | 394 | { |
394 | meshhdr->flags = 0; | 395 | meshhdr->flags = 0; |
395 | meshhdr->ttl = sdata->u.sta.mshcfg.dot11MeshTTL; | 396 | meshhdr->ttl = sdata->u.sta.mshcfg.dot11MeshTTL; |
396 | 397 | put_unaligned(cpu_to_le32(sdata->u.sta.mesh_seqnum), &meshhdr->seqnum); | |
397 | meshhdr->seqnum[0] = sdata->u.sta.mesh_seqnum[0]++; | 398 | sdata->u.sta.mesh_seqnum++; |
398 | meshhdr->seqnum[1] = sdata->u.sta.mesh_seqnum[1]; | ||
399 | meshhdr->seqnum[2] = sdata->u.sta.mesh_seqnum[2]; | ||
400 | |||
401 | if (sdata->u.sta.mesh_seqnum[0] == 0) { | ||
402 | sdata->u.sta.mesh_seqnum[1]++; | ||
403 | if (sdata->u.sta.mesh_seqnum[1] == 0) | ||
404 | sdata->u.sta.mesh_seqnum[2]++; | ||
405 | } | ||
406 | 399 | ||
407 | return 5; | 400 | return 5; |
408 | } | 401 | } |
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 9ee3affab346..2e161f6d8288 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h | |||
@@ -140,7 +140,7 @@ struct rmc_entry { | |||
140 | 140 | ||
141 | struct mesh_rmc { | 141 | struct mesh_rmc { |
142 | struct rmc_entry bucket[RMC_BUCKETS]; | 142 | struct rmc_entry bucket[RMC_BUCKETS]; |
143 | u8 idx_mask; | 143 | u32 idx_mask; |
144 | }; | 144 | }; |
145 | 145 | ||
146 | 146 | ||
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c index dddbfd60f351..09093da24af6 100644 --- a/net/mac80211/tkip.c +++ b/net/mac80211/tkip.c | |||
@@ -230,10 +230,8 @@ void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, | |||
230 | 230 | ||
231 | iv16 = data[hdr_len] << 8; | 231 | iv16 = data[hdr_len] << 8; |
232 | iv16 += data[hdr_len + 2]; | 232 | iv16 += data[hdr_len + 2]; |
233 | iv32 = data[hdr_len + 4] + | 233 | iv32 = data[hdr_len + 4] | (data[hdr_len + 5] << 8) | |
234 | (data[hdr_len + 5] >> 8) + | 234 | (data[hdr_len + 6] << 16) | (data[hdr_len + 7] << 24); |
235 | (data[hdr_len + 6] >> 16) + | ||
236 | (data[hdr_len + 7] >> 24); | ||
237 | 235 | ||
238 | #ifdef CONFIG_TKIP_DEBUG | 236 | #ifdef CONFIG_TKIP_DEBUG |
239 | printk(KERN_DEBUG "TKIP encrypt: iv16 = 0x%04x, iv32 = 0x%08x\n", | 237 | printk(KERN_DEBUG "TKIP encrypt: iv16 = 0x%04x, iv32 = 0x%08x\n", |
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index b59871f6bdda..46ea542d0df9 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c | |||
@@ -296,11 +296,11 @@ static int nf_conntrack_standalone_init_proc(void) | |||
296 | pde = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops); | 296 | pde = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops); |
297 | if (!pde) | 297 | if (!pde) |
298 | goto out_nf_conntrack; | 298 | goto out_nf_conntrack; |
299 | pde = create_proc_entry("nf_conntrack", S_IRUGO, init_net.proc_net_stat); | 299 | |
300 | pde = proc_create("nf_conntrack", S_IRUGO, init_net.proc_net_stat, | ||
301 | &ct_cpu_seq_fops); | ||
300 | if (!pde) | 302 | if (!pde) |
301 | goto out_stat_nf_conntrack; | 303 | goto out_stat_nf_conntrack; |
302 | pde->proc_fops = &ct_cpu_seq_fops; | ||
303 | pde->owner = THIS_MODULE; | ||
304 | return 0; | 304 | return 0; |
305 | 305 | ||
306 | out_stat_nf_conntrack: | 306 | out_stat_nf_conntrack: |
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 11b22abc2b70..5d75cd86ebb3 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -936,25 +936,24 @@ int xt_proto_init(struct net *net, int af) | |||
936 | #ifdef CONFIG_PROC_FS | 936 | #ifdef CONFIG_PROC_FS |
937 | strlcpy(buf, xt_prefix[af], sizeof(buf)); | 937 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
938 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); | 938 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); |
939 | proc = proc_net_fops_create(net, buf, 0440, &xt_table_ops); | 939 | proc = proc_create_data(buf, 0440, net->proc_net, &xt_table_ops, |
940 | (void *)(unsigned long)af); | ||
940 | if (!proc) | 941 | if (!proc) |
941 | goto out; | 942 | goto out; |
942 | proc->data = (void *)(unsigned long)af; | ||
943 | |||
944 | 943 | ||
945 | strlcpy(buf, xt_prefix[af], sizeof(buf)); | 944 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
946 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); | 945 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); |
947 | proc = proc_net_fops_create(net, buf, 0440, &xt_match_ops); | 946 | proc = proc_create_data(buf, 0440, net->proc_net, &xt_match_ops, |
947 | (void *)(unsigned long)af); | ||
948 | if (!proc) | 948 | if (!proc) |
949 | goto out_remove_tables; | 949 | goto out_remove_tables; |
950 | proc->data = (void *)(unsigned long)af; | ||
951 | 950 | ||
952 | strlcpy(buf, xt_prefix[af], sizeof(buf)); | 951 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
953 | strlcat(buf, FORMAT_TARGETS, sizeof(buf)); | 952 | strlcat(buf, FORMAT_TARGETS, sizeof(buf)); |
954 | proc = proc_net_fops_create(net, buf, 0440, &xt_target_ops); | 953 | proc = proc_create_data(buf, 0440, net->proc_net, &xt_target_ops, |
954 | (void *)(unsigned long)af); | ||
955 | if (!proc) | 955 | if (!proc) |
956 | goto out_remove_matches; | 956 | goto out_remove_matches; |
957 | proc->data = (void *)(unsigned long)af; | ||
958 | #endif | 957 | #endif |
959 | 958 | ||
960 | return 0; | 959 | return 0; |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 40d344b21453..6809af542a2c 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -237,15 +237,15 @@ static int htable_create_v0(struct xt_hashlimit_info *minfo, int family) | |||
237 | hinfo->family = family; | 237 | hinfo->family = family; |
238 | hinfo->rnd_initialized = 0; | 238 | hinfo->rnd_initialized = 0; |
239 | spin_lock_init(&hinfo->lock); | 239 | spin_lock_init(&hinfo->lock); |
240 | hinfo->pde = proc_create(minfo->name, 0, | 240 | hinfo->pde = |
241 | proc_create_data(minfo->name, 0, | ||
241 | family == AF_INET ? hashlimit_procdir4 : | 242 | family == AF_INET ? hashlimit_procdir4 : |
242 | hashlimit_procdir6, | 243 | hashlimit_procdir6, |
243 | &dl_file_ops); | 244 | &dl_file_ops, hinfo); |
244 | if (!hinfo->pde) { | 245 | if (!hinfo->pde) { |
245 | vfree(hinfo); | 246 | vfree(hinfo); |
246 | return -1; | 247 | return -1; |
247 | } | 248 | } |
248 | hinfo->pde->data = hinfo; | ||
249 | 249 | ||
250 | setup_timer(&hinfo->timer, htable_gc, (unsigned long )hinfo); | 250 | setup_timer(&hinfo->timer, htable_gc, (unsigned long )hinfo); |
251 | hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); | 251 | hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); |
@@ -301,15 +301,15 @@ static int htable_create(struct xt_hashlimit_mtinfo1 *minfo, | |||
301 | hinfo->rnd_initialized = 0; | 301 | hinfo->rnd_initialized = 0; |
302 | spin_lock_init(&hinfo->lock); | 302 | spin_lock_init(&hinfo->lock); |
303 | 303 | ||
304 | hinfo->pde = proc_create(minfo->name, 0, | 304 | hinfo->pde = |
305 | proc_create_data(minfo->name, 0, | ||
305 | family == AF_INET ? hashlimit_procdir4 : | 306 | family == AF_INET ? hashlimit_procdir4 : |
306 | hashlimit_procdir6, | 307 | hashlimit_procdir6, |
307 | &dl_file_ops); | 308 | &dl_file_ops, hinfo); |
308 | if (hinfo->pde == NULL) { | 309 | if (hinfo->pde == NULL) { |
309 | vfree(hinfo); | 310 | vfree(hinfo); |
310 | return -1; | 311 | return -1; |
311 | } | 312 | } |
312 | hinfo->pde->data = hinfo; | ||
313 | 313 | ||
314 | setup_timer(&hinfo->timer, htable_gc, (unsigned long)hinfo); | 314 | setup_timer(&hinfo->timer, htable_gc, (unsigned long)hinfo); |
315 | hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); | 315 | hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); |
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c index 5053a53ba24f..bd593871c81e 100644 --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c | |||
@@ -1066,12 +1066,12 @@ out: | |||
1066 | #ifdef CONFIG_PROC_FS | 1066 | #ifdef CONFIG_PROC_FS |
1067 | 1067 | ||
1068 | static void *rose_node_start(struct seq_file *seq, loff_t *pos) | 1068 | static void *rose_node_start(struct seq_file *seq, loff_t *pos) |
1069 | __acquires(rose_neigh_list_lock) | 1069 | __acquires(rose_node_list_lock) |
1070 | { | 1070 | { |
1071 | struct rose_node *rose_node; | 1071 | struct rose_node *rose_node; |
1072 | int i = 1; | 1072 | int i = 1; |
1073 | 1073 | ||
1074 | spin_lock_bh(&rose_neigh_list_lock); | 1074 | spin_lock_bh(&rose_node_list_lock); |
1075 | if (*pos == 0) | 1075 | if (*pos == 0) |
1076 | return SEQ_START_TOKEN; | 1076 | return SEQ_START_TOKEN; |
1077 | 1077 | ||
@@ -1090,9 +1090,9 @@ static void *rose_node_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | static void rose_node_stop(struct seq_file *seq, void *v) | 1092 | static void rose_node_stop(struct seq_file *seq, void *v) |
1093 | __releases(rose_neigh_list_lock) | 1093 | __releases(rose_node_list_lock) |
1094 | { | 1094 | { |
1095 | spin_unlock_bh(&rose_neigh_list_lock); | 1095 | spin_unlock_bh(&rose_node_list_lock); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | static int rose_node_show(struct seq_file *seq, void *v) | 1098 | static int rose_node_show(struct seq_file *seq, void *v) |
diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c index bb282a6a19f0..64069c8769a5 100644 --- a/net/rxrpc/ar-transport.c +++ b/net/rxrpc/ar-transport.c | |||
@@ -184,12 +184,13 @@ void rxrpc_put_transport(struct rxrpc_transport *trans) | |||
184 | ASSERTCMP(atomic_read(&trans->usage), >, 0); | 184 | ASSERTCMP(atomic_read(&trans->usage), >, 0); |
185 | 185 | ||
186 | trans->put_time = get_seconds(); | 186 | trans->put_time = get_seconds(); |
187 | if (unlikely(atomic_dec_and_test(&trans->usage))) | 187 | if (unlikely(atomic_dec_and_test(&trans->usage))) { |
188 | _debug("zombie"); | 188 | _debug("zombie"); |
189 | /* let the reaper determine the timeout to avoid a race with | 189 | /* let the reaper determine the timeout to avoid a race with |
190 | * overextending the timeout if the reaper is running at the | 190 | * overextending the timeout if the reaper is running at the |
191 | * same time */ | 191 | * same time */ |
192 | rxrpc_queue_delayed_work(&rxrpc_transport_reap, 0); | 192 | rxrpc_queue_delayed_work(&rxrpc_transport_reap, 0); |
193 | } | ||
193 | _leave(""); | 194 | _leave(""); |
194 | } | 195 | } |
195 | 196 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index b741618e4d54..d355e5e47fe3 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -219,6 +219,7 @@ static void dev_watchdog(unsigned long arg) | |||
219 | printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n", | 219 | printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n", |
220 | dev->name); | 220 | dev->name); |
221 | dev->tx_timeout(dev); | 221 | dev->tx_timeout(dev); |
222 | WARN_ON_ONCE(1); | ||
222 | } | 223 | } |
223 | if (!mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + dev->watchdog_timeo))) | 224 | if (!mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + dev->watchdog_timeo))) |
224 | dev_hold(dev); | 225 | dev_hold(dev); |
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index d75530ff2a6d..c9966713282a 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
@@ -316,31 +316,28 @@ static int create_cache_proc_entries(struct cache_detail *cd) | |||
316 | cd->proc_ent->owner = cd->owner; | 316 | cd->proc_ent->owner = cd->owner; |
317 | cd->channel_ent = cd->content_ent = NULL; | 317 | cd->channel_ent = cd->content_ent = NULL; |
318 | 318 | ||
319 | p = proc_create("flush", S_IFREG|S_IRUSR|S_IWUSR, | 319 | p = proc_create_data("flush", S_IFREG|S_IRUSR|S_IWUSR, |
320 | cd->proc_ent, &cache_flush_operations); | 320 | cd->proc_ent, &cache_flush_operations, cd); |
321 | cd->flush_ent = p; | 321 | cd->flush_ent = p; |
322 | if (p == NULL) | 322 | if (p == NULL) |
323 | goto out_nomem; | 323 | goto out_nomem; |
324 | p->owner = cd->owner; | 324 | p->owner = cd->owner; |
325 | p->data = cd; | ||
326 | 325 | ||
327 | if (cd->cache_request || cd->cache_parse) { | 326 | if (cd->cache_request || cd->cache_parse) { |
328 | p = proc_create("channel", S_IFREG|S_IRUSR|S_IWUSR, | 327 | p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR, |
329 | cd->proc_ent, &cache_file_operations); | 328 | cd->proc_ent, &cache_file_operations, cd); |
330 | cd->channel_ent = p; | 329 | cd->channel_ent = p; |
331 | if (p == NULL) | 330 | if (p == NULL) |
332 | goto out_nomem; | 331 | goto out_nomem; |
333 | p->owner = cd->owner; | 332 | p->owner = cd->owner; |
334 | p->data = cd; | ||
335 | } | 333 | } |
336 | if (cd->cache_show) { | 334 | if (cd->cache_show) { |
337 | p = proc_create("content", S_IFREG|S_IRUSR|S_IWUSR, | 335 | p = proc_create_data("content", S_IFREG|S_IRUSR|S_IWUSR, |
338 | cd->proc_ent, &content_file_operations); | 336 | cd->proc_ent, &content_file_operations, cd); |
339 | cd->content_ent = p; | 337 | cd->content_ent = p; |
340 | if (p == NULL) | 338 | if (p == NULL) |
341 | goto out_nomem; | 339 | goto out_nomem; |
342 | p->owner = cd->owner; | 340 | p->owner = cd->owner; |
343 | p->data = cd; | ||
344 | } | 341 | } |
345 | return 0; | 342 | return 0; |
346 | out_nomem: | 343 | out_nomem: |
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index c6061a4346c8..50b049c6598a 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
@@ -224,16 +224,10 @@ EXPORT_SYMBOL_GPL(rpc_print_iostats); | |||
224 | static inline struct proc_dir_entry * | 224 | static inline struct proc_dir_entry * |
225 | do_register(const char *name, void *data, const struct file_operations *fops) | 225 | do_register(const char *name, void *data, const struct file_operations *fops) |
226 | { | 226 | { |
227 | struct proc_dir_entry *ent; | ||
228 | |||
229 | rpc_proc_init(); | 227 | rpc_proc_init(); |
230 | dprintk("RPC: registering /proc/net/rpc/%s\n", name); | 228 | dprintk("RPC: registering /proc/net/rpc/%s\n", name); |
231 | 229 | ||
232 | ent = proc_create(name, 0, proc_net_rpc, fops); | 230 | return proc_create_data(name, 0, proc_net_rpc, fops, data); |
233 | if (ent) { | ||
234 | ent->data = data; | ||
235 | } | ||
236 | return ent; | ||
237 | } | 231 | } |
238 | 232 | ||
239 | struct proc_dir_entry * | 233 | struct proc_dir_entry * |
diff --git a/net/sysctl_net.c b/net/sysctl_net.c index 665e856675a4..b4f0525f91af 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c | |||
@@ -82,6 +82,6 @@ EXPORT_SYMBOL_GPL(register_net_sysctl_table); | |||
82 | 82 | ||
83 | void unregister_net_sysctl_table(struct ctl_table_header *header) | 83 | void unregister_net_sysctl_table(struct ctl_table_header *header) |
84 | { | 84 | { |
85 | return unregister_sysctl_table(header); | 85 | unregister_sysctl_table(header); |
86 | } | 86 | } |
87 | EXPORT_SYMBOL_GPL(unregister_net_sysctl_table); | 87 | EXPORT_SYMBOL_GPL(unregister_net_sysctl_table); |