aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2007-08-19 20:18:33 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:48:16 -0400
commit19ac21465e15e476220909c01b23df847b6ffa30 (patch)
tree0f47d32208477e4150e9caa295e1badad7321628
parent0740d49c2465bdd2644455c4bc49794395b73433 (diff)
[DCCP]: Convert dccps_timestamp_time to ktime_t
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/dccp.h3
-rw-r--r--net/dccp/options.c13
2 files changed, 7 insertions, 9 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index fda2148d8c85..3a4b96becfc4 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -215,6 +215,7 @@ struct dccp_so_feat {
215#ifdef __KERNEL__ 215#ifdef __KERNEL__
216 216
217#include <linux/in.h> 217#include <linux/in.h>
218#include <linux/ktime.h>
218#include <linux/list.h> 219#include <linux/list.h>
219#include <linux/uio.h> 220#include <linux/uio.h>
220#include <linux/workqueue.h> 221#include <linux/workqueue.h>
@@ -498,7 +499,7 @@ struct dccp_sock {
498 __u64 dccps_gar; 499 __u64 dccps_gar;
499 __be32 dccps_service; 500 __be32 dccps_service;
500 struct dccp_service_list *dccps_service_list; 501 struct dccp_service_list *dccps_service_list;
501 struct timeval dccps_timestamp_time; 502 ktime_t dccps_timestamp_time;
502 __u32 dccps_timestamp_echo; 503 __u32 dccps_timestamp_echo;
503 __u16 dccps_l_ack_ratio; 504 __u16 dccps_l_ack_ratio;
504 __u16 dccps_r_ack_ratio; 505 __u16 dccps_r_ack_ratio;
diff --git a/net/dccp/options.c b/net/dccp/options.c
index 34d536d5f1a1..95b75d8354ff 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -158,7 +158,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
158 opt_recv->dccpor_timestamp = ntohl(*(__be32 *)value); 158 opt_recv->dccpor_timestamp = ntohl(*(__be32 *)value);
159 159
160 dp->dccps_timestamp_echo = opt_recv->dccpor_timestamp; 160 dp->dccps_timestamp_echo = opt_recv->dccpor_timestamp;
161 dccp_timestamp(sk, &dp->dccps_timestamp_time); 161 dp->dccps_timestamp_time = ktime_get_real();
162 162
163 dccp_pr_debug("%s rx opt: TIMESTAMP=%u, ackno=%llu\n", 163 dccp_pr_debug("%s rx opt: TIMESTAMP=%u, ackno=%llu\n",
164 dccp_role(sk), opt_recv->dccpor_timestamp, 164 dccp_role(sk), opt_recv->dccpor_timestamp,
@@ -405,14 +405,12 @@ static int dccp_insert_option_timestamp_echo(struct sock *sk,
405 struct sk_buff *skb) 405 struct sk_buff *skb)
406{ 406{
407 struct dccp_sock *dp = dccp_sk(sk); 407 struct dccp_sock *dp = dccp_sk(sk);
408 struct timeval now;
409 __be32 tstamp_echo; 408 __be32 tstamp_echo;
410 u32 elapsed_time;
411 int len, elapsed_time_len; 409 int len, elapsed_time_len;
412 unsigned char *to; 410 unsigned char *to;
413 411 const suseconds_t delta = ktime_us_delta(ktime_get_real(),
414 dccp_timestamp(sk, &now); 412 dp->dccps_timestamp_time);
415 elapsed_time = timeval_delta(&now, &dp->dccps_timestamp_time) / 10; 413 u32 elapsed_time = delta / 10;
416 elapsed_time_len = dccp_elapsed_time_len(elapsed_time); 414 elapsed_time_len = dccp_elapsed_time_len(elapsed_time);
417 len = 6 + elapsed_time_len; 415 len = 6 + elapsed_time_len;
418 416
@@ -438,8 +436,7 @@ static int dccp_insert_option_timestamp_echo(struct sock *sk,
438 } 436 }
439 437
440 dp->dccps_timestamp_echo = 0; 438 dp->dccps_timestamp_echo = 0;
441 dp->dccps_timestamp_time.tv_sec = 0; 439 dp->dccps_timestamp_time = ktime_set(0, 0);
442 dp->dccps_timestamp_time.tv_usec = 0;
443 return 0; 440 return 0;
444} 441}
445 442