]> err.no Git - linux-2.6/commitdiff
[DCCP]: Convert dccps_timestamp_time to ktime_t
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>
Mon, 20 Aug 2007 00:18:33 +0000 (17:18 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:48:16 +0000 (16:48 -0700)
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/dccp.h
net/dccp/options.c

index fda2148d8c85cf3b58407f47b50ef0d8bdb6ec20..3a4b96becfc4b843438ec40dcf8bff50db632ed4 100644 (file)
@@ -215,6 +215,7 @@ struct dccp_so_feat {
 #ifdef __KERNEL__
 
 #include <linux/in.h>
+#include <linux/ktime.h>
 #include <linux/list.h>
 #include <linux/uio.h>
 #include <linux/workqueue.h>
@@ -498,7 +499,7 @@ struct dccp_sock {
        __u64                           dccps_gar;
        __be32                          dccps_service;
        struct dccp_service_list        *dccps_service_list;
-       struct timeval                  dccps_timestamp_time;
+       ktime_t                         dccps_timestamp_time;
        __u32                           dccps_timestamp_echo;
        __u16                           dccps_l_ack_ratio;
        __u16                           dccps_r_ack_ratio;
index 34d536d5f1a1f4bafbd4bdf553b5832d4d5dcceb..95b75d8354ff33c4a5f8107e5d49fc9f7c1343bd 100644 (file)
@@ -158,7 +158,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
                        opt_recv->dccpor_timestamp = ntohl(*(__be32 *)value);
 
                        dp->dccps_timestamp_echo = opt_recv->dccpor_timestamp;
-                       dccp_timestamp(sk, &dp->dccps_timestamp_time);
+                       dp->dccps_timestamp_time = ktime_get_real();
 
                        dccp_pr_debug("%s rx opt: TIMESTAMP=%u, ackno=%llu\n",
                                      dccp_role(sk), opt_recv->dccpor_timestamp,
@@ -405,14 +405,12 @@ static int dccp_insert_option_timestamp_echo(struct sock *sk,
                                             struct sk_buff *skb)
 {
        struct dccp_sock *dp = dccp_sk(sk);
-       struct timeval now;
        __be32 tstamp_echo;
-       u32 elapsed_time;
        int len, elapsed_time_len;
        unsigned char *to;
-
-       dccp_timestamp(sk, &now);
-       elapsed_time = timeval_delta(&now, &dp->dccps_timestamp_time) / 10;
+       const suseconds_t delta = ktime_us_delta(ktime_get_real(),
+                                                dp->dccps_timestamp_time);
+       u32 elapsed_time = delta / 10;
        elapsed_time_len = dccp_elapsed_time_len(elapsed_time);
        len = 6 + elapsed_time_len;
 
@@ -438,8 +436,7 @@ static int dccp_insert_option_timestamp_echo(struct sock *sk,
        }
 
        dp->dccps_timestamp_echo = 0;
-       dp->dccps_timestamp_time.tv_sec = 0;
-       dp->dccps_timestamp_time.tv_usec = 0;
+       dp->dccps_timestamp_time = ktime_set(0, 0);
        return 0;
 }