Merge tag 'regmap-offload-update-bits' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / net / rxrpc / ar-connection.c
index 7bf5b5b9e8b9400af1cbaecaeaf9a8c222670492..692b3e67fb54418ffb143491b9e2f1dc82d8d503 100644 (file)
 #include <net/af_rxrpc.h>
 #include "ar-internal.h"
 
+/*
+ * Time till a connection expires after last use (in seconds).
+ */
+unsigned rxrpc_connection_expiry = 10 * 60;
+
 static void rxrpc_connection_reaper(struct work_struct *work);
 
 LIST_HEAD(rxrpc_connections);
 DEFINE_RWLOCK(rxrpc_connection_lock);
-static unsigned long rxrpc_connection_timeout = 10 * 60;
 static DECLARE_DELAYED_WORK(rxrpc_connection_reap, rxrpc_connection_reaper);
 
 /*
@@ -804,7 +808,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn)
 
        ASSERTCMP(atomic_read(&conn->usage), >, 0);
 
-       conn->put_time = get_seconds();
+       conn->put_time = ktime_get_seconds();
        if (atomic_dec_and_test(&conn->usage)) {
                _debug("zombie");
                rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0);
@@ -848,7 +852,7 @@ static void rxrpc_connection_reaper(struct work_struct *work)
 
        _enter("");
 
-       now = get_seconds();
+       now = ktime_get_seconds();
        earliest = ULONG_MAX;
 
        write_lock_bh(&rxrpc_connection_lock);
@@ -862,7 +866,7 @@ static void rxrpc_connection_reaper(struct work_struct *work)
 
                spin_lock(&conn->trans->client_lock);
                write_lock(&conn->trans->conn_lock);
-               reap_time = conn->put_time + rxrpc_connection_timeout;
+               reap_time = conn->put_time + rxrpc_connection_expiry;
 
                if (atomic_read(&conn->usage) > 0) {
                        ;
@@ -916,7 +920,7 @@ void __exit rxrpc_destroy_all_connections(void)
 {
        _enter("");
 
-       rxrpc_connection_timeout = 0;
+       rxrpc_connection_expiry = 0;
        cancel_delayed_work(&rxrpc_connection_reap);
        rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0);