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
286 unsigned long numentries, int scale,286 unsigned long numentries, int scale,
287 unsigned long low_limit,287 unsigned long low_limit,
288 unsigned long high_limit);288 unsigned long high_limit);
289int inet_hashinfo2_init_mod(struct inet_hashinfo *h);
290 289
291bool inet_ehash_insert(struct sock *sk, struct sock *osk, bool *found_dup_sk);290bool inet_ehash_insert(struct sock *sk, struct sock *osk, bool *found_dup_sk);
292bool inet_ehash_nolisten(struct sock *sk, struct sock *osk,291bool 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
1246 __inet_check_established);1246 __inet_check_established);
1247}1247}
1248 1248
1249static 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
1260void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,1249void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,
1261 unsigned long numentries, int scale,1250 unsigned long numentries, int scale,
1262 unsigned long low_limit,1251 unsigned long low_limit,
1263 unsigned long high_limit)1252 unsigned long high_limit)
1264{1253{
1254 unsigned int i;
1255
1265 h->lhash2 = alloc_large_system_hash(name,1256 h->lhash2 = alloc_large_system_hash(name,
1266 sizeof(*h->lhash2),1257 sizeof(*h->lhash2),
1267 numentries,1258 numentries,
@@ -1271,7 +1262,12 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name, · 3 unmodified lines
1271 &h->lhash2_mask,1262 &h->lhash2_mask,
1272 low_limit,1263 low_limit,
1273 high_limit);1264 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 }
1275 1271
1276 /* this one is used for source ports of outgoing connections */1272 /* this one is used for source ports of outgoing connections */
1277 table_perturb = alloc_large_system_hash("Table-perturb",1273 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
1282 INET_TABLE_PERTURB_SIZE);1278 INET_TABLE_PERTURB_SIZE);
1283}1279}
1284 1280
1285int 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
1299int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo)1281int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo)
1300{1282{
1301 unsigned int locksz = sizeof(spinlock_t);1283 unsigned int locksz = sizeof(spinlock_t);