diff options
| -rw-r--r-- | include/linux/rhashtable.h | 8 | ||||
| -rw-r--r-- | lib/rhashtable.c | 2 | ||||
| -rw-r--r-- | lib/test_rhashtable.c | 9 | ||||
| -rw-r--r-- | net/ipv6/ila/ila_xlat.c | 15 | ||||
| -rw-r--r-- | net/netlink/af_netlink.c | 10 |
5 files changed, 7 insertions, 37 deletions
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index 20f9c6af7473..ae9c0f71f311 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h | |||
| @@ -1113,14 +1113,6 @@ static inline int rhashtable_replace_fast( | |||
| 1113 | return err; | 1113 | return err; |
| 1114 | } | 1114 | } |
| 1115 | 1115 | ||
| 1116 | /* Obsolete function, do not use in new code. */ | ||
| 1117 | static inline int rhashtable_walk_init(struct rhashtable *ht, | ||
| 1118 | struct rhashtable_iter *iter, gfp_t gfp) | ||
| 1119 | { | ||
| 1120 | rhashtable_walk_enter(ht, iter); | ||
| 1121 | return 0; | ||
| 1122 | } | ||
| 1123 | |||
| 1124 | /** | 1116 | /** |
| 1125 | * rhltable_walk_enter - Initialise an iterator | 1117 | * rhltable_walk_enter - Initialise an iterator |
| 1126 | * @hlt: Table to walk over | 1118 | * @hlt: Table to walk over |
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 852ffa5160f1..0a105d4af166 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
| @@ -682,7 +682,7 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_enter); | |||
| 682 | * rhashtable_walk_exit - Free an iterator | 682 | * rhashtable_walk_exit - Free an iterator |
| 683 | * @iter: Hash table Iterator | 683 | * @iter: Hash table Iterator |
| 684 | * | 684 | * |
| 685 | * This function frees resources allocated by rhashtable_walk_init. | 685 | * This function frees resources allocated by rhashtable_walk_enter. |
| 686 | */ | 686 | */ |
| 687 | void rhashtable_walk_exit(struct rhashtable_iter *iter) | 687 | void rhashtable_walk_exit(struct rhashtable_iter *iter) |
| 688 | { | 688 | { |
diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c index 2c0c53a99734..3bd2e91bfc29 100644 --- a/lib/test_rhashtable.c +++ b/lib/test_rhashtable.c | |||
| @@ -177,16 +177,11 @@ static int __init test_rht_lookup(struct rhashtable *ht, struct test_obj *array, | |||
| 177 | 177 | ||
| 178 | static void test_bucket_stats(struct rhashtable *ht, unsigned int entries) | 178 | static void test_bucket_stats(struct rhashtable *ht, unsigned int entries) |
| 179 | { | 179 | { |
| 180 | unsigned int err, total = 0, chain_len = 0; | 180 | unsigned int total = 0, chain_len = 0; |
| 181 | struct rhashtable_iter hti; | 181 | struct rhashtable_iter hti; |
| 182 | struct rhash_head *pos; | 182 | struct rhash_head *pos; |
| 183 | 183 | ||
| 184 | err = rhashtable_walk_init(ht, &hti, GFP_KERNEL); | 184 | rhashtable_walk_enter(ht, &hti); |
| 185 | if (err) { | ||
| 186 | pr_warn("Test failed: allocation error"); | ||
| 187 | return; | ||
| 188 | } | ||
| 189 | |||
| 190 | rhashtable_walk_start(&hti); | 185 | rhashtable_walk_start(&hti); |
| 191 | 186 | ||
| 192 | while ((pos = rhashtable_walk_next(&hti))) { | 187 | while ((pos = rhashtable_walk_next(&hti))) { |
diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index 17c455ff69ff..ae6cd4cef8db 100644 --- a/net/ipv6/ila/ila_xlat.c +++ b/net/ipv6/ila/ila_xlat.c | |||
| @@ -385,10 +385,7 @@ int ila_xlat_nl_cmd_flush(struct sk_buff *skb, struct genl_info *info) | |||
| 385 | spinlock_t *lock; | 385 | spinlock_t *lock; |
| 386 | int ret; | 386 | int ret; |
| 387 | 387 | ||
| 388 | ret = rhashtable_walk_init(&ilan->xlat.rhash_table, &iter, GFP_KERNEL); | 388 | rhashtable_walk_enter(&ilan->xlat.rhash_table, &iter); |
| 389 | if (ret) | ||
| 390 | goto done; | ||
| 391 | |||
| 392 | rhashtable_walk_start(&iter); | 389 | rhashtable_walk_start(&iter); |
| 393 | 390 | ||
| 394 | for (;;) { | 391 | for (;;) { |
| @@ -509,23 +506,17 @@ int ila_xlat_nl_dump_start(struct netlink_callback *cb) | |||
| 509 | struct net *net = sock_net(cb->skb->sk); | 506 | struct net *net = sock_net(cb->skb->sk); |
| 510 | struct ila_net *ilan = net_generic(net, ila_net_id); | 507 | struct ila_net *ilan = net_generic(net, ila_net_id); |
| 511 | struct ila_dump_iter *iter; | 508 | struct ila_dump_iter *iter; |
| 512 | int ret; | ||
| 513 | 509 | ||
| 514 | iter = kmalloc(sizeof(*iter), GFP_KERNEL); | 510 | iter = kmalloc(sizeof(*iter), GFP_KERNEL); |
| 515 | if (!iter) | 511 | if (!iter) |
| 516 | return -ENOMEM; | 512 | return -ENOMEM; |
| 517 | 513 | ||
| 518 | ret = rhashtable_walk_init(&ilan->xlat.rhash_table, &iter->rhiter, | 514 | rhashtable_walk_enter(&ilan->xlat.rhash_table, &iter->rhiter); |
| 519 | GFP_KERNEL); | ||
| 520 | if (ret) { | ||
| 521 | kfree(iter); | ||
| 522 | return ret; | ||
| 523 | } | ||
| 524 | 515 | ||
| 525 | iter->skip = 0; | 516 | iter->skip = 0; |
| 526 | cb->args[0] = (long)iter; | 517 | cb->args[0] = (long)iter; |
| 527 | 518 | ||
| 528 | return ret; | 519 | return 0; |
| 529 | } | 520 | } |
| 530 | 521 | ||
| 531 | int ila_xlat_nl_dump_done(struct netlink_callback *cb) | 522 | int ila_xlat_nl_dump_done(struct netlink_callback *cb) |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 8fa35df94c07..f28e937320a3 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
| @@ -2549,15 +2549,7 @@ struct nl_seq_iter { | |||
| 2549 | 2549 | ||
| 2550 | static int netlink_walk_start(struct nl_seq_iter *iter) | 2550 | static int netlink_walk_start(struct nl_seq_iter *iter) |
| 2551 | { | 2551 | { |
| 2552 | int err; | 2552 | rhashtable_walk_enter(&nl_table[iter->link].hash, &iter->hti); |
| 2553 | |||
| 2554 | err = rhashtable_walk_init(&nl_table[iter->link].hash, &iter->hti, | ||
| 2555 | GFP_KERNEL); | ||
| 2556 | if (err) { | ||
| 2557 | iter->link = MAX_LINKS; | ||
| 2558 | return err; | ||
| 2559 | } | ||
| 2560 | |||
| 2561 | rhashtable_walk_start(&iter->hti); | 2553 | rhashtable_walk_start(&iter->hti); |
| 2562 | 2554 | ||
| 2563 | return 0; | 2555 | return 0; |
