LDLM_ERROR(lock,
"lock timed out (enqueued at %lld, %llds ago); not entering recovery in server code, just going back to sleep",
- (s64)lock->l_activity,
- (s64)(ktime_get_real_seconds() -
- lock->l_activity));
+ lock->l_activity,
+ ktime_get_real_seconds() - lock->l_activity);
if (ktime_get_seconds() > next_dump) {
last_dump = next_dump;
next_dump = ktime_get_seconds() + 300;
ptlrpc_fail_import(imp, lwd->lwd_conn_cnt);
LDLM_ERROR(lock,
"lock timed out (enqueued at %lld, %llds ago), entering recovery for %s@%s",
- (s64)lock->l_activity,
- (s64)(ktime_get_real_seconds() - lock->l_activity),
+ lock->l_activity,
+ ktime_get_real_seconds() - lock->l_activity,
obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid);
EXIT;
* We use the same basis for both server side and client side functions
* from a single node.
*/
-static time64_t ldlm_cp_timeout(struct ldlm_lock *lock)
+static timeout_t ldlm_cp_timeout(struct ldlm_lock *lock)
{
- time64_t timeout;
+ timeout_t timeout;
if (AT_OFF)
return obd_timeout;
* doesn't respond reasonably, and then give us the lock.
*/
timeout = at_get(ldlm_lock_to_ns_at(lock));
- return max(3 * timeout, (time64_t) ldlm_enqueue_min);
+ return max(3 * timeout, (timeout_t)ldlm_enqueue_min);
}
/**
*/
static int ldlm_completion_tail(struct ldlm_lock *lock, void *data)
{
- time64_t delay;
int result = 0;
if (ldlm_is_destroyed(lock) || ldlm_is_failed(lock)) {
LDLM_DEBUG(lock, "client-side enqueue: granted");
} else {
/* Take into AT only CP RPC, not immediately granted locks */
- delay = ktime_get_real_seconds() - lock->l_activity;
- LDLM_DEBUG(lock, "client-side enqueue: granted after %llds",
- (s64)delay);
+ timeout_t delay = 0;
+ /* Discard negative timeouts. We should also limit the
+ * maximum value of the timeout
+ */
+ if (ktime_get_real_seconds() > lock->l_activity)
+ delay = ktime_get_real_seconds() - lock->l_activity;
+
+ LDLM_DEBUG(lock, "client-side enqueue: granted after %ds",
+ delay);
/* Update our time estimate */
at_measured(ldlm_lock_to_ns_at(lock), delay);
}
struct lock_wait_data lwd;
struct obd_device *obd;
struct obd_import *imp = NULL;
- time64_t timeout;
+ timeout_t timeout;
int rc = 0;
ENTRY;