From: jamal <hadi@cyberus.ca>
To: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH][IPSEC]: Aggregate make_jiffies
Date: Tue, 15 Aug 2006 21:58:19 -0400 [thread overview]
Message-ID: <1155693500.5122.39.camel@jzny2> (raw)
[-- Attachment #1: Type: text/plain, Size: 196 bytes --]
make_jiffies definition is repeated in xfrm_state and xfrm_policy.
Aggregate in header instead. Against Dave's last perf improvement
patches.
signed-off-by: Jamal Hadi Salim<hadi@cyberus.ca>
[-- Attachment #2: ipsec-p111 --]
[-- Type: text/x-patch, Size: 1533 bytes --]
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 8123d49..05444dd 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -619,6 +619,14 @@ xfrm_state_addr_cmp(struct xfrm_tmpl *tm
return !0;
}
+static inline unsigned long make_jiffies(long secs)
+{
+ if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
+ return MAX_SCHEDULE_TIMEOUT-1;
+ else
+ return secs*HZ;
+}
+
#ifdef CONFIG_XFRM
extern int __xfrm_policy_check(struct sock *, int dir, struct sk_buff *skb, unsigned short family);
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index a378812..cd785be 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -220,14 +220,6 @@ void xfrm_put_mode(struct xfrm_mode *mod
module_put(mode->owner);
}
-static inline unsigned long make_jiffies(long secs)
-{
- if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
- return MAX_SCHEDULE_TIMEOUT-1;
- else
- return secs*HZ;
-}
-
static void xfrm_policy_timer(unsigned long data)
{
struct xfrm_policy *xp = (struct xfrm_policy*)data;
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index b1c0ae7..00ae0f8 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -264,14 +264,6 @@ static void xfrm_state_gc_task(void *dat
wake_up(&km_waitq);
}
-static inline unsigned long make_jiffies(long secs)
-{
- if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
- return MAX_SCHEDULE_TIMEOUT-1;
- else
- return secs*HZ;
-}
-
static void xfrm_timer_handler(unsigned long data)
{
struct xfrm_state *x = (struct xfrm_state*)data;
next reply other threads:[~2006-08-16 1:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-16 1:58 jamal [this message]
2006-08-16 2:33 ` [PATCH][IPSEC]: Aggregate make_jiffies Herbert Xu
2006-08-16 2:59 ` jamal
2006-08-16 13:13 ` jamal
2006-08-16 13:24 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1155693500.5122.39.camel@jzny2 \
--to=hadi@cyberus.ca \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox