@@ -232,23 +232,24 @@ static inline int ip_vs_conn_unhash(struct ip_vs_conn *cp)
232
232
static inline bool ip_vs_conn_unlink (struct ip_vs_conn * cp )
233
233
{
234
234
unsigned int hash ;
235
- bool ret ;
235
+ bool ret = false;
236
+
237
+ if (cp -> flags & IP_VS_CONN_F_ONE_PACKET )
238
+ return refcount_dec_if_one (& cp -> refcnt );
236
239
237
240
hash = ip_vs_conn_hashkey_conn (cp );
238
241
239
242
ct_write_lock_bh (hash );
240
243
spin_lock (& cp -> lock );
241
244
242
245
if (cp -> flags & IP_VS_CONN_F_HASHED ) {
243
- ret = false;
244
246
/* Decrease refcnt and unlink conn only if we are last user */
245
247
if (refcount_dec_if_one (& cp -> refcnt )) {
246
248
hlist_del_rcu (& cp -> c_list );
247
249
cp -> flags &= ~IP_VS_CONN_F_HASHED ;
248
250
ret = true;
249
251
}
250
- } else
251
- ret = refcount_read (& cp -> refcnt ) ? false : true;
252
+ }
252
253
253
254
spin_unlock (& cp -> lock );
254
255
ct_write_unlock_bh (hash );
@@ -454,12 +455,6 @@ ip_vs_conn_out_get_proto(struct netns_ipvs *ipvs, int af,
454
455
}
455
456
EXPORT_SYMBOL_GPL (ip_vs_conn_out_get_proto );
456
457
457
- static void __ip_vs_conn_put_notimer (struct ip_vs_conn * cp )
458
- {
459
- __ip_vs_conn_put (cp );
460
- ip_vs_conn_expire (& cp -> timer );
461
- }
462
-
463
458
/*
464
459
* Put back the conn and restart its timer with its timeout
465
460
*/
@@ -478,7 +473,7 @@ void ip_vs_conn_put(struct ip_vs_conn *cp)
478
473
(refcount_read (& cp -> refcnt ) == 1 ) &&
479
474
!timer_pending (& cp -> timer ))
480
475
/* expire connection immediately */
481
- __ip_vs_conn_put_notimer ( cp );
476
+ ip_vs_conn_expire ( & cp -> timer );
482
477
else
483
478
__ip_vs_conn_put_timer (cp );
484
479
}
0 commit comments