* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011 Whamcloud, Inc.
- *
+ * Copyright (c) 2011, 2012, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
cfs_spin_lock_bh(&waiting_locks_spinlock);
if (expired_lock_thread.elt_dump) {
+ struct libcfs_debug_msg_data msgdata = {
+ .msg_file = __FILE__,
+ .msg_fn = "waiting_locks_callback",
+ .msg_line = expired_lock_thread.elt_dump };
cfs_spin_unlock_bh(&waiting_locks_spinlock);
/* from waiting_locks_callback, but not in timer */
libcfs_debug_dumplog();
- libcfs_run_lbug_upcall(__FILE__,
- "waiting_locks_callback",
- expired_lock_thread.elt_dump);
+ libcfs_run_lbug_upcall(&msgdata);
cfs_spin_lock_bh(&waiting_locks_spinlock);
expired_lock_thread.elt_dump = 0;
struct ldlm_cb_async_args *ca = data;
struct ldlm_lock *lock = ca->ca_lock;
struct ldlm_cb_set_arg *arg = ca->ca_set_arg;
- int count;
ENTRY;
LASSERT(lock != NULL);
}
LDLM_LOCK_RELEASE(lock);
- count = cfs_atomic_dec_return(&arg->rpcs);
- if (count < arg->threshold)
+ if (cfs_atomic_dec_return(&arg->rpcs) < arg->threshold)
cfs_waitq_signal(&arg->waitq);
- if (count == 0)
- ldlm_csa_put(arg);
+
+ ldlm_csa_put(arg);
RETURN(0);
}
cfs_atomic_inc(&arg->restart);
} else {
LDLM_LOCK_GET(lock);
- if (cfs_atomic_inc_return(&arg->rpcs) == 1)
- cfs_atomic_inc(&arg->refcount);
+ cfs_atomic_inc(&arg->rpcs);
+ cfs_atomic_inc(&arg->refcount);
ptlrpcd_add_req(req, PDL_POLICY_ROUND, -1);
}