aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
authorjohn stultz <johnstul@us.ibm.com>2007-07-24 20:47:43 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-25 13:09:20 -0400
commit2c6b47de17c75d553de3e2fb426d8298d2074585 (patch)
treec8edc3d727d85cb3e1c043583c350a04a133e1a3 /net/rxrpc
parent0de085bb474f64e4fdb2f1ff3268590792648c7b (diff)
Cleanup non-arch xtime uses, use get_seconds() or current_kernel_time().
This avoids use of the kernel-internal "xtime" variable directly outside of the actual time-related functions. Instead, use the helper functions that we already have available to us. This doesn't actually change any behaviour, but this will allow us to fix the fact that "xtime" isn't updated very often with CONFIG_NO_HZ (because much of the realtime information is maintained as separate offsets to 'xtime'), which has caused interfaces that use xtime directly to get a time that is out of sync with the real-time clock by up to a third of a second or so. Signed-off-by: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/af_rxrpc.c2
-rw-r--r--net/rxrpc/ar-connection.c4
-rw-r--r--net/rxrpc/ar-transport.c4
-rw-r--r--net/rxrpc/rxkad.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index 16a68df4e36b..c58fa0d1be26 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -787,7 +787,7 @@ static int __init af_rxrpc_init(void)
787 787
788 BUILD_BUG_ON(sizeof(struct rxrpc_skb_priv) > sizeof(dummy_skb->cb)); 788 BUILD_BUG_ON(sizeof(struct rxrpc_skb_priv) > sizeof(dummy_skb->cb));
789 789
790 rxrpc_epoch = htonl(xtime.tv_sec); 790 rxrpc_epoch = htonl(get_seconds());
791 791
792 ret = -ENOMEM; 792 ret = -ENOMEM;
793 rxrpc_call_jar = kmem_cache_create( 793 rxrpc_call_jar = kmem_cache_create(
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 482750efc235..372b24466dc7 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -791,7 +791,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn)
791 791
792 ASSERTCMP(atomic_read(&conn->usage), >, 0); 792 ASSERTCMP(atomic_read(&conn->usage), >, 0);
793 793
794 conn->put_time = xtime.tv_sec; 794 conn->put_time = get_seconds();
795 if (atomic_dec_and_test(&conn->usage)) { 795 if (atomic_dec_and_test(&conn->usage)) {
796 _debug("zombie"); 796 _debug("zombie");
797 rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0); 797 rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0);
@@ -835,7 +835,7 @@ void rxrpc_connection_reaper(struct work_struct *work)
835 835
836 _enter(""); 836 _enter("");
837 837
838 now = xtime.tv_sec; 838 now = get_seconds();
839 earliest = ULONG_MAX; 839 earliest = ULONG_MAX;
840 840
841 write_lock_bh(&rxrpc_connection_lock); 841 write_lock_bh(&rxrpc_connection_lock);
diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c
index d43d78f19302..bb282a6a19f0 100644
--- a/net/rxrpc/ar-transport.c
+++ b/net/rxrpc/ar-transport.c
@@ -183,7 +183,7 @@ void rxrpc_put_transport(struct rxrpc_transport *trans)
183 183
184 ASSERTCMP(atomic_read(&trans->usage), >, 0); 184 ASSERTCMP(atomic_read(&trans->usage), >, 0);
185 185
186 trans->put_time = xtime.tv_sec; 186 trans->put_time = get_seconds();
187 if (unlikely(atomic_dec_and_test(&trans->usage))) 187 if (unlikely(atomic_dec_and_test(&trans->usage)))
188 _debug("zombie"); 188 _debug("zombie");
189 /* let the reaper determine the timeout to avoid a race with 189 /* let the reaper determine the timeout to avoid a race with
@@ -219,7 +219,7 @@ static void rxrpc_transport_reaper(struct work_struct *work)
219 219
220 _enter(""); 220 _enter("");
221 221
222 now = xtime.tv_sec; 222 now = get_seconds();
223 earliest = ULONG_MAX; 223 earliest = ULONG_MAX;
224 224
225 /* extract all the transports that have been dead too long */ 225 /* extract all the transports that have been dead too long */
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index 5ec705144e10..ac3cabdca78c 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -916,7 +916,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn,
916 issue = be32_to_cpu(stamp); 916 issue = be32_to_cpu(stamp);
917 } 917 }
918 p += 4; 918 p += 4;
919 now = xtime.tv_sec; 919 now = get_seconds();
920 _debug("KIV ISSUE: %lx [%lx]", issue, now); 920 _debug("KIV ISSUE: %lx [%lx]", issue, now);
921 921
922 /* check the ticket is in date */ 922 /* check the ticket is in date */