diff options
author | James Morris <jmorris@namei.org> | 2007-03-04 19:12:44 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:23:32 -0400 |
commit | 9d729f72dca9406025bcfa9c1f660d71d9ef0ff5 (patch) | |
tree | 69a3ca50c6e266853676a545a113f13f254ae535 /net/xfrm | |
parent | 39df232f1a9ba48d41c68ee7d4046756e709cf91 (diff) |
[NET]: Convert xtime.tv_sec to get_seconds()
Where appropriate, convert references to xtime.tv_sec to the
get_seconds() helper function.
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 12 | ||||
-rw-r--r-- | net/xfrm/xfrm_state.c | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 785c3e39f062..194257554553 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -268,7 +268,7 @@ static inline unsigned long make_jiffies(long secs) | |||
268 | static void xfrm_policy_timer(unsigned long data) | 268 | static void xfrm_policy_timer(unsigned long data) |
269 | { | 269 | { |
270 | struct xfrm_policy *xp = (struct xfrm_policy*)data; | 270 | struct xfrm_policy *xp = (struct xfrm_policy*)data; |
271 | unsigned long now = (unsigned long)xtime.tv_sec; | 271 | unsigned long now = get_seconds(); |
272 | long next = LONG_MAX; | 272 | long next = LONG_MAX; |
273 | int warn = 0; | 273 | int warn = 0; |
274 | int dir; | 274 | int dir; |
@@ -690,7 +690,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) | |||
690 | } | 690 | } |
691 | policy->index = delpol ? delpol->index : xfrm_gen_index(policy->type, dir); | 691 | policy->index = delpol ? delpol->index : xfrm_gen_index(policy->type, dir); |
692 | hlist_add_head(&policy->byidx, xfrm_policy_byidx+idx_hash(policy->index)); | 692 | hlist_add_head(&policy->byidx, xfrm_policy_byidx+idx_hash(policy->index)); |
693 | policy->curlft.add_time = (unsigned long)xtime.tv_sec; | 693 | policy->curlft.add_time = get_seconds(); |
694 | policy->curlft.use_time = 0; | 694 | policy->curlft.use_time = 0; |
695 | if (!mod_timer(&policy->timer, jiffies + HZ)) | 695 | if (!mod_timer(&policy->timer, jiffies + HZ)) |
696 | xfrm_pol_hold(policy); | 696 | xfrm_pol_hold(policy); |
@@ -1133,7 +1133,7 @@ int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol) | |||
1133 | old_pol = sk->sk_policy[dir]; | 1133 | old_pol = sk->sk_policy[dir]; |
1134 | sk->sk_policy[dir] = pol; | 1134 | sk->sk_policy[dir] = pol; |
1135 | if (pol) { | 1135 | if (pol) { |
1136 | pol->curlft.add_time = (unsigned long)xtime.tv_sec; | 1136 | pol->curlft.add_time = get_seconds(); |
1137 | pol->index = xfrm_gen_index(pol->type, XFRM_POLICY_MAX+dir); | 1137 | pol->index = xfrm_gen_index(pol->type, XFRM_POLICY_MAX+dir); |
1138 | __xfrm_policy_link(pol, XFRM_POLICY_MAX+dir); | 1138 | __xfrm_policy_link(pol, XFRM_POLICY_MAX+dir); |
1139 | } | 1139 | } |
@@ -1386,7 +1386,7 @@ restart: | |||
1386 | return 0; | 1386 | return 0; |
1387 | 1387 | ||
1388 | family = dst_orig->ops->family; | 1388 | family = dst_orig->ops->family; |
1389 | policy->curlft.use_time = (unsigned long)xtime.tv_sec; | 1389 | policy->curlft.use_time = get_seconds(); |
1390 | pols[0] = policy; | 1390 | pols[0] = policy; |
1391 | npols ++; | 1391 | npols ++; |
1392 | xfrm_nr += pols[0]->xfrm_nr; | 1392 | xfrm_nr += pols[0]->xfrm_nr; |
@@ -1682,7 +1682,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, | |||
1682 | return 1; | 1682 | return 1; |
1683 | } | 1683 | } |
1684 | 1684 | ||
1685 | pol->curlft.use_time = (unsigned long)xtime.tv_sec; | 1685 | pol->curlft.use_time = get_seconds(); |
1686 | 1686 | ||
1687 | pols[0] = pol; | 1687 | pols[0] = pol; |
1688 | npols ++; | 1688 | npols ++; |
@@ -1694,7 +1694,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, | |||
1694 | if (pols[1]) { | 1694 | if (pols[1]) { |
1695 | if (IS_ERR(pols[1])) | 1695 | if (IS_ERR(pols[1])) |
1696 | return 0; | 1696 | return 0; |
1697 | pols[1]->curlft.use_time = (unsigned long)xtime.tv_sec; | 1697 | pols[1]->curlft.use_time = get_seconds(); |
1698 | npols ++; | 1698 | npols ++; |
1699 | } | 1699 | } |
1700 | } | 1700 | } |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index e3a0bcfa5df1..63a20e818164 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -233,7 +233,7 @@ static inline unsigned long make_jiffies(long secs) | |||
233 | static void xfrm_timer_handler(unsigned long data) | 233 | static void xfrm_timer_handler(unsigned long data) |
234 | { | 234 | { |
235 | struct xfrm_state *x = (struct xfrm_state*)data; | 235 | struct xfrm_state *x = (struct xfrm_state*)data; |
236 | unsigned long now = (unsigned long)xtime.tv_sec; | 236 | unsigned long now = get_seconds(); |
237 | long next = LONG_MAX; | 237 | long next = LONG_MAX; |
238 | int warn = 0; | 238 | int warn = 0; |
239 | int err = 0; | 239 | int err = 0; |
@@ -326,7 +326,7 @@ struct xfrm_state *xfrm_state_alloc(void) | |||
326 | init_timer(&x->rtimer); | 326 | init_timer(&x->rtimer); |
327 | x->rtimer.function = xfrm_replay_timer_handler; | 327 | x->rtimer.function = xfrm_replay_timer_handler; |
328 | x->rtimer.data = (unsigned long)x; | 328 | x->rtimer.data = (unsigned long)x; |
329 | x->curlft.add_time = (unsigned long)xtime.tv_sec; | 329 | x->curlft.add_time = get_seconds(); |
330 | x->lft.soft_byte_limit = XFRM_INF; | 330 | x->lft.soft_byte_limit = XFRM_INF; |
331 | x->lft.soft_packet_limit = XFRM_INF; | 331 | x->lft.soft_packet_limit = XFRM_INF; |
332 | x->lft.hard_byte_limit = XFRM_INF; | 332 | x->lft.hard_byte_limit = XFRM_INF; |
@@ -1051,7 +1051,7 @@ EXPORT_SYMBOL(xfrm_state_update); | |||
1051 | int xfrm_state_check_expire(struct xfrm_state *x) | 1051 | int xfrm_state_check_expire(struct xfrm_state *x) |
1052 | { | 1052 | { |
1053 | if (!x->curlft.use_time) | 1053 | if (!x->curlft.use_time) |
1054 | x->curlft.use_time = (unsigned long)xtime.tv_sec; | 1054 | x->curlft.use_time = get_seconds(); |
1055 | 1055 | ||
1056 | if (x->km.state != XFRM_STATE_VALID) | 1056 | if (x->km.state != XFRM_STATE_VALID) |
1057 | return -EINVAL; | 1057 | return -EINVAL; |