#include <linux/rcu_segcblist.h>
-/* Is simple callback list empty? */
-static inline bool rcu_cblist_empty(struct rcu_cblist *rclp)
-{
- return !rclp->head;
-}
-
/* Return number of callbacks in simple callback list. */
static inline long rcu_cblist_n_cbs(struct rcu_cblist *rclp)
{
*/
static inline struct rcu_head **rcu_cblist_tail(struct rcu_cblist *rclp)
{
- WARN_ON_ONCE(rcu_cblist_empty(rclp));
+ WARN_ON_ONCE(!rclp->head);
return rclp->tail;
}
/* First adopt the ready-to-invoke callbacks, then the done ones. */
rcu_segcblist_insert_done_cbs(&rdp->cblist, &rsp->orphan_done);
- WARN_ON_ONCE(!rcu_cblist_empty(&rsp->orphan_done));
+ WARN_ON_ONCE(rsp->orphan_done.head);
rcu_segcblist_insert_pend_cbs(&rdp->cblist, &rsp->orphan_pend);
- WARN_ON_ONCE(!rcu_cblist_empty(&rsp->orphan_pend));
+ WARN_ON_ONCE(rsp->orphan_pend.head);
WARN_ON_ONCE(rcu_segcblist_empty(&rdp->cblist) !=
!rcu_segcblist_n_cbs(&rdp->cblist));
}
local_irq_save(flags);
count = -rcu_cblist_n_cbs(&rcl);
- trace_rcu_batch_end(rsp->name, count, !rcu_cblist_empty(&rcl),
- need_resched(), is_idle_task(current),
- rcu_is_callbacks_kthread());
+ trace_rcu_batch_end(rsp->name, count, !!rcl.head, need_resched(),
+ is_idle_task(current), rcu_is_callbacks_kthread());
/* Update counts and requeue any remaining callbacks. */
rcu_segcblist_insert_done_cbs(&rdp->cblist, &rcl);
return false;
/* First, enqueue the donelist, if any. This preserves CB ordering. */
- if (!rcu_cblist_empty(&rsp->orphan_done)) {
+ if (rsp->orphan_done.head) {
__call_rcu_nocb_enqueue(rdp, rcu_cblist_head(&rsp->orphan_done),
rcu_cblist_tail(&rsp->orphan_done),
ql, qll, flags);
}
- if (!rcu_cblist_empty(&rsp->orphan_pend)) {
+ if (rsp->orphan_pend.head) {
__call_rcu_nocb_enqueue(rdp, rcu_cblist_head(&rsp->orphan_pend),
rcu_cblist_tail(&rsp->orphan_pend),
ql, qll, flags);