提交 22a3f9a2 编写于 作者: K Ksenija Stanojevic 提交者: David S. Miller

rxrpc: Replace get_seconds with ktime_get_seconds

Replace time_t type and get_seconds function which are not y2038 safe
on 32-bit systems. Function ktime_get_seconds use monotonic instead of
real time and therefore will not cause overflow.
Signed-off-by: NKsenija Stanojevic <ksenija.stanojevic@gmail.com>
Reviewed-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 62e3b1d0
...@@ -808,7 +808,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn) ...@@ -808,7 +808,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn)
ASSERTCMP(atomic_read(&conn->usage), >, 0); ASSERTCMP(atomic_read(&conn->usage), >, 0);
conn->put_time = get_seconds(); conn->put_time = ktime_get_seconds();
if (atomic_dec_and_test(&conn->usage)) { if (atomic_dec_and_test(&conn->usage)) {
_debug("zombie"); _debug("zombie");
rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0); rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0);
...@@ -852,7 +852,7 @@ static void rxrpc_connection_reaper(struct work_struct *work) ...@@ -852,7 +852,7 @@ static void rxrpc_connection_reaper(struct work_struct *work)
_enter(""); _enter("");
now = get_seconds(); now = ktime_get_seconds();
earliest = ULONG_MAX; earliest = ULONG_MAX;
write_lock_bh(&rxrpc_connection_lock); write_lock_bh(&rxrpc_connection_lock);
......
...@@ -208,7 +208,7 @@ struct rxrpc_transport { ...@@ -208,7 +208,7 @@ struct rxrpc_transport {
struct rb_root server_conns; /* server connections on this transport */ struct rb_root server_conns; /* server connections on this transport */
struct list_head link; /* link in master session list */ struct list_head link; /* link in master session list */
struct sk_buff_head error_queue; /* error packets awaiting processing */ struct sk_buff_head error_queue; /* error packets awaiting processing */
time_t put_time; /* time at which to reap */ unsigned long put_time; /* time at which to reap */
spinlock_t client_lock; /* client connection allocation lock */ spinlock_t client_lock; /* client connection allocation lock */
rwlock_t conn_lock; /* lock for active/dead connections */ rwlock_t conn_lock; /* lock for active/dead connections */
atomic_t usage; atomic_t usage;
...@@ -256,7 +256,7 @@ struct rxrpc_connection { ...@@ -256,7 +256,7 @@ struct rxrpc_connection {
struct rxrpc_crypt csum_iv; /* packet checksum base */ struct rxrpc_crypt csum_iv; /* packet checksum base */
unsigned long events; unsigned long events;
#define RXRPC_CONN_CHALLENGE 0 /* send challenge packet */ #define RXRPC_CONN_CHALLENGE 0 /* send challenge packet */
time_t put_time; /* time at which to reap */ unsigned long put_time; /* time at which to reap */
rwlock_t lock; /* access lock */ rwlock_t lock; /* access lock */
spinlock_t state_lock; /* state-change lock */ spinlock_t state_lock; /* state-change lock */
atomic_t usage; atomic_t usage;
......
...@@ -189,7 +189,7 @@ void rxrpc_put_transport(struct rxrpc_transport *trans) ...@@ -189,7 +189,7 @@ void rxrpc_put_transport(struct rxrpc_transport *trans)
ASSERTCMP(atomic_read(&trans->usage), >, 0); ASSERTCMP(atomic_read(&trans->usage), >, 0);
trans->put_time = get_seconds(); trans->put_time = ktime_get_seconds();
if (unlikely(atomic_dec_and_test(&trans->usage))) { if (unlikely(atomic_dec_and_test(&trans->usage))) {
_debug("zombie"); _debug("zombie");
/* let the reaper determine the timeout to avoid a race with /* let the reaper determine the timeout to avoid a race with
...@@ -226,7 +226,7 @@ static void rxrpc_transport_reaper(struct work_struct *work) ...@@ -226,7 +226,7 @@ static void rxrpc_transport_reaper(struct work_struct *work)
_enter(""); _enter("");
now = get_seconds(); now = ktime_get_seconds();
earliest = ULONG_MAX; earliest = ULONG_MAX;
/* extract all the transports that have been dead too long */ /* extract all the transports that have been dead too long */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册