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