@@ -201,8 +201,6 @@ xfrm_policy_inexact_lookup_rcu(struct net *net,
201
201
static struct xfrm_policy *
202
202
xfrm_policy_insert_list (struct hlist_head * chain , struct xfrm_policy * policy ,
203
203
bool excl );
204
- static void xfrm_policy_insert_inexact_list (struct hlist_head * chain ,
205
- struct xfrm_policy * policy );
206
204
207
205
static bool
208
206
xfrm_policy_find_inexact_candidates (struct xfrm_pol_inexact_candidates * cand ,
@@ -415,7 +413,6 @@ struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp)
415
413
if (policy ) {
416
414
write_pnet (& policy -> xp_net , net );
417
415
INIT_LIST_HEAD (& policy -> walk .all );
418
- INIT_HLIST_NODE (& policy -> bydst_inexact_list );
419
416
INIT_HLIST_NODE (& policy -> bydst );
420
417
INIT_HLIST_NODE (& policy -> byidx );
421
418
rwlock_init (& policy -> lock );
@@ -1233,9 +1230,6 @@ xfrm_policy_inexact_insert(struct xfrm_policy *policy, u8 dir, int excl)
1233
1230
return ERR_PTR (- EEXIST );
1234
1231
}
1235
1232
1236
- chain = & net -> xfrm .policy_inexact [dir ];
1237
- xfrm_policy_insert_inexact_list (chain , policy );
1238
-
1239
1233
if (delpol )
1240
1234
__xfrm_policy_inexact_prune_bin (bin , false);
1241
1235
@@ -1343,7 +1337,6 @@ static void xfrm_hash_rebuild(struct work_struct *work)
1343
1337
continue ;
1344
1338
1345
1339
hlist_del_rcu (& policy -> bydst );
1346
- hlist_del_init (& policy -> bydst_inexact_list );
1347
1340
1348
1341
newpos = NULL ;
1349
1342
dir = xfrm_policy_id2dir (policy -> index );
@@ -1513,36 +1506,6 @@ static const struct rhashtable_params xfrm_pol_inexact_params = {
1513
1506
.automatic_shrinking = true,
1514
1507
};
1515
1508
1516
- static void xfrm_policy_insert_inexact_list (struct hlist_head * chain ,
1517
- struct xfrm_policy * policy )
1518
- {
1519
- struct xfrm_policy * pol , * delpol = NULL ;
1520
- struct hlist_node * newpos = NULL ;
1521
-
1522
- hlist_for_each_entry (pol , chain , bydst_inexact_list ) {
1523
- if (pol -> type == policy -> type &&
1524
- pol -> if_id == policy -> if_id &&
1525
- !selector_cmp (& pol -> selector , & policy -> selector ) &&
1526
- xfrm_policy_mark_match (& policy -> mark , pol ) &&
1527
- xfrm_sec_ctx_match (pol -> security , policy -> security ) &&
1528
- !WARN_ON (delpol )) {
1529
- delpol = pol ;
1530
- if (policy -> priority > pol -> priority )
1531
- continue ;
1532
- } else if (policy -> priority >= pol -> priority ) {
1533
- newpos = & pol -> bydst_inexact_list ;
1534
- continue ;
1535
- }
1536
- if (delpol )
1537
- break ;
1538
- }
1539
-
1540
- if (newpos && policy -> xdo .type != XFRM_DEV_OFFLOAD_PACKET )
1541
- hlist_add_behind_rcu (& policy -> bydst_inexact_list , newpos );
1542
- else
1543
- hlist_add_head_rcu (& policy -> bydst_inexact_list , chain );
1544
- }
1545
-
1546
1509
static struct xfrm_policy * xfrm_policy_insert_list (struct hlist_head * chain ,
1547
1510
struct xfrm_policy * policy ,
1548
1511
bool excl )
@@ -2344,7 +2307,6 @@ static struct xfrm_policy *__xfrm_policy_unlink(struct xfrm_policy *pol,
2344
2307
/* Socket policies are not hashed. */
2345
2308
if (!hlist_unhashed (& pol -> bydst )) {
2346
2309
hlist_del_rcu (& pol -> bydst );
2347
- hlist_del_init (& pol -> bydst_inexact_list );
2348
2310
hlist_del (& pol -> byidx );
2349
2311
}
2350
2312
0 commit comments