netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [IPSEC] Use add_timer instead of mod_timer in find_acq
@ 2004-05-24 11:53 Herbert Xu
  2004-05-24 17:15 ` David S. Miller
  2004-05-25 12:10 ` Herbert Xu
  0 siblings, 2 replies; 4+ messages in thread
From: Herbert Xu @ 2004-05-24 11:53 UTC (permalink / raw)
  To: David S. Miller, netdev

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

Hi Dave:

Here is a tiny optimisation to use add_timer instead of mod_timer
on the create path in find_acq.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1053 bytes --]

===== xfrm4_state.c 1.7 vs edited =====
--- 1.7/net/ipv4/xfrm4_state.c	2004-05-24 21:49:33 +10:00
+++ edited/xfrm4_state.c	2004-05-24 21:41:13 +10:00
@@ -98,7 +98,8 @@
 		x0->props.family = AF_INET;
 		x0->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES;
 		xfrm_state_hold(x0);
-		mod_timer(&x0->timer, jiffies + XFRM_ACQ_EXPIRES*HZ);
+		x0->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ;
+		add_timer(&x0->timer);
 		xfrm_state_hold(x0);
 		list_add_tail(&x0->bydst, xfrm4_state_afinfo.state_bydst+h);
 		wake_up(&km_waitq);
===== xfrm6_state.c 1.9 vs edited =====
--- 1.9/net/ipv6/xfrm6_state.c	2004-05-24 21:49:33 +10:00
+++ edited/xfrm6_state.c	2004-05-24 21:51:19 +10:00
@@ -108,7 +108,8 @@
 		x0->props.reqid = reqid;
 		x0->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES;
 		xfrm_state_hold(x0);
-		mod_timer(&x0->timer, jiffies + XFRM_ACQ_EXPIRES*HZ);
+		x0->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ;
+		add_timer(&x0->timer);
 		xfrm_state_hold(x0);
 		list_add_tail(&x0->bydst, xfrm6_state_afinfo.state_bydst+h);
 		wake_up(&km_waitq);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-25 18:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-24 11:53 [IPSEC] Use add_timer instead of mod_timer in find_acq Herbert Xu
2004-05-24 17:15 ` David S. Miller
2004-05-25 12:10 ` Herbert Xu
2004-05-25 18:02   ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).