History

dccp Remove inet_hashinfo2_init_mod().

Commit c92c81df93df ("net: dccp: fix kernel crash on module load") added inet_hashinfo2_init_mod() for DCCP. Commit 22d6c9eebf2e ("net: Unexport shared functions for DCCP.") removed EXPORT_SYMBOL_GPL() it but forgot to remove the function itself. Let's remove inet_hashinfo2_init_mod().

Kuniyuki Iwashima committed 8 months ago

Commit 425e0801 parent cd994652 files · +8 −27Browse files

Unified · Split

2 files
  1. include/net/inet_hashtables.h +0 −1
  2. net/ipv4/inet_hashtables.c +8 −26
include/net/inet_hashtables.h+0−1
@@ -286,7 +286,6 @@ void inet_hashinfo2_init(struct inet_hashinfo *h, const char *name, · 285 unmodified lines
286286 unsigned long numentries, int scale,
287287 unsigned long low_limit,
288288 unsigned long high_limit);
289−int inet_hashinfo2_init_mod(struct inet_hashinfo *h);
290289
291290 bool inet_ehash_insert(struct sock *sk, struct sock *osk, bool *found_dup_sk);
292291 bool inet_ehash_nolisten(struct sock *sk, struct sock *osk,
net/ipv4/inet_hashtables.c+8−26
@@ -1246,22 +1246,13 @@ int inet_hash_connect(struct inet_timewait_death_row *death_row, · 1245 unmodified lines
12461246 __inet_check_established);
12471247 }
12481248
1249−static void init_hashinfo_lhash2(struct inet_hashinfo *h)
1250−{
1251− int i;
1252−
1253− for (i = 0; i <= h->lhash2_mask; i++) {
1254− spin_lock_init(&h->lhash2[i].lock);
1255− INIT_HLIST_NULLS_HEAD(&h->lhash2[i].nulls_head,
1256− i + LISTENING_NULLS_BASE);
1257− }
1258−}
1259−
12601249 void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,
12611250 unsigned long numentries, int scale,
12621251 unsigned long low_limit,
12631252 unsigned long high_limit)
12641253 {
1254+ unsigned int i;
1255+
12651256 h->lhash2 = alloc_large_system_hash(name,
12661257 sizeof(*h->lhash2),
12671258 numentries,
@@ -1271,7 +1262,12 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name, · 3 unmodified lines
12711262 &h->lhash2_mask,
12721263 low_limit,
12731264 high_limit);
1274− init_hashinfo_lhash2(h);
1265+
1266+ for (i = 0; i <= h->lhash2_mask; i++) {
1267+ spin_lock_init(&h->lhash2[i].lock);
1268+ INIT_HLIST_NULLS_HEAD(&h->lhash2[i].nulls_head,
1269+ i + LISTENING_NULLS_BASE);
1270+ }
12751271
12761272 /* this one is used for source ports of outgoing connections */
12771273 table_perturb = alloc_large_system_hash("Table-perturb",
@@ -1282,20 +1278,6 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name, · 4 unmodified lines
12821278 INET_TABLE_PERTURB_SIZE);
12831279 }
12841280
1285−int inet_hashinfo2_init_mod(struct inet_hashinfo *h)
1286−{
1287− h->lhash2 = kmalloc_objs(*h->lhash2, INET_LHTABLE_SIZE);
1288− if (!h->lhash2)
1289− return -ENOMEM;
1290−
1291− h->lhash2_mask = INET_LHTABLE_SIZE - 1;
1292− /* INET_LHTABLE_SIZE must be a power of 2 */
1293− BUG_ON(INET_LHTABLE_SIZE & h->lhash2_mask);
1294−
1295− init_hashinfo_lhash2(h);
1296− return 0;
1297−}
1298−
12991281 int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo)
13001282 {
13011283 unsigned int locksz = sizeof(spinlock_t);