diff options
author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2007-08-19 20:17:25 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:48:14 -0400 |
commit | b8bda9d70842dab7902f0681e1297dcf0460fc94 (patch) | |
tree | 346b84f8a182f20de46b569270528e64c1455196 /net/dccp | |
parent | 668348a4232d3dd0ee48b3dc13228b5a7eb57565 (diff) |
[DCCP] ackvec: Convert to ktime_t
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ackvec.c | 11 | ||||
-rw-r--r-- | net/dccp/ackvec.h | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c index 7ac775f9a64b..3f8984b5f6e8 100644 --- a/net/dccp/ackvec.c +++ b/net/dccp/ackvec.c | |||
@@ -73,17 +73,17 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) | |||
73 | DCCP_MAX_ACKVEC_OPT_LEN - 1) / | 73 | DCCP_MAX_ACKVEC_OPT_LEN - 1) / |
74 | DCCP_MAX_ACKVEC_OPT_LEN; | 74 | DCCP_MAX_ACKVEC_OPT_LEN; |
75 | u16 len = av->dccpav_vec_len + 2 * nr_opts, i; | 75 | u16 len = av->dccpav_vec_len + 2 * nr_opts, i; |
76 | struct timeval now; | ||
77 | u32 elapsed_time; | 76 | u32 elapsed_time; |
78 | const unsigned char *tail, *from; | 77 | const unsigned char *tail, *from; |
79 | unsigned char *to; | 78 | unsigned char *to; |
80 | struct dccp_ackvec_record *avr; | 79 | struct dccp_ackvec_record *avr; |
80 | suseconds_t delta; | ||
81 | 81 | ||
82 | if (DCCP_SKB_CB(skb)->dccpd_opt_len + len > DCCP_MAX_OPT_LEN) | 82 | if (DCCP_SKB_CB(skb)->dccpd_opt_len + len > DCCP_MAX_OPT_LEN) |
83 | return -1; | 83 | return -1; |
84 | 84 | ||
85 | dccp_timestamp(sk, &now); | 85 | delta = ktime_us_delta(ktime_get_real(), av->dccpav_time); |
86 | elapsed_time = timeval_delta(&now, &av->dccpav_time) / 10; | 86 | elapsed_time = delta / 10; |
87 | 87 | ||
88 | if (elapsed_time != 0 && | 88 | if (elapsed_time != 0 && |
89 | dccp_insert_option_elapsed_time(sk, skb, elapsed_time)) | 89 | dccp_insert_option_elapsed_time(sk, skb, elapsed_time)) |
@@ -159,8 +159,7 @@ struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority) | |||
159 | av->dccpav_buf_head = DCCP_MAX_ACKVEC_LEN - 1; | 159 | av->dccpav_buf_head = DCCP_MAX_ACKVEC_LEN - 1; |
160 | av->dccpav_buf_ackno = UINT48_MAX + 1; | 160 | av->dccpav_buf_ackno = UINT48_MAX + 1; |
161 | av->dccpav_buf_nonce = av->dccpav_buf_nonce = 0; | 161 | av->dccpav_buf_nonce = av->dccpav_buf_nonce = 0; |
162 | av->dccpav_time.tv_sec = 0; | 162 | av->dccpav_time = ktime_set(0, 0); |
163 | av->dccpav_time.tv_usec = 0; | ||
164 | av->dccpav_vec_len = 0; | 163 | av->dccpav_vec_len = 0; |
165 | INIT_LIST_HEAD(&av->dccpav_records); | 164 | INIT_LIST_HEAD(&av->dccpav_records); |
166 | } | 165 | } |
@@ -321,7 +320,7 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, | |||
321 | } | 320 | } |
322 | 321 | ||
323 | av->dccpav_buf_ackno = ackno; | 322 | av->dccpav_buf_ackno = ackno; |
324 | dccp_timestamp(sk, &av->dccpav_time); | 323 | av->dccpav_time = ktime_get_real(); |
325 | out: | 324 | out: |
326 | return 0; | 325 | return 0; |
327 | 326 | ||
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h index 96504a3b16e4..9ef0737043ee 100644 --- a/net/dccp/ackvec.h +++ b/net/dccp/ackvec.h | |||
@@ -12,8 +12,8 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/compiler.h> | 14 | #include <linux/compiler.h> |
15 | #include <linux/ktime.h> | ||
15 | #include <linux/list.h> | 16 | #include <linux/list.h> |
16 | #include <linux/time.h> | ||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | 18 | ||
19 | /* Read about the ECN nonce to see why it is 253 */ | 19 | /* Read about the ECN nonce to see why it is 253 */ |
@@ -52,7 +52,7 @@ | |||
52 | struct dccp_ackvec { | 52 | struct dccp_ackvec { |
53 | u64 dccpav_buf_ackno; | 53 | u64 dccpav_buf_ackno; |
54 | struct list_head dccpav_records; | 54 | struct list_head dccpav_records; |
55 | struct timeval dccpav_time; | 55 | ktime_t dccpav_time; |
56 | u16 dccpav_buf_head; | 56 | u16 dccpav_buf_head; |
57 | u16 dccpav_vec_len; | 57 | u16 dccpav_vec_len; |
58 | u8 dccpav_buf_nonce; | 58 | u8 dccpav_buf_nonce; |