/* were we the head of the list? (head if prev is a resource) */
if (it->parent != KDS_RESOURCE)
{
- if (!(it->state & KDS_LINK_TRIGGERED) ||
- (it->state & KDS_LINK_EXCLUSIVE))
- continue;
-
- /*
- * previous was triggered and not exclusive, so we
- * trigger non-exclusive until end-of-list or first
- * exclusive
- */
- list_for_each_entry(it, &it->link, link)
+ if ((it->state & KDS_LINK_TRIGGERED) && !(it->state & KDS_LINK_EXCLUSIVE) )
{
- /* exclusive found, stop triggering */
- if (it->state & KDS_LINK_EXCLUSIVE)
- break;
+ /*
+ * previous was triggered and not exclusive, so we
+ * trigger non-exclusive until end-of-list or first
+ * exclusive
+ */
- it->state |= KDS_LINK_TRIGGERED;
- /* a parent to update? */
- if (it->parent != KDS_IGNORED)
+ struct kds_link *it_waiting = it;
+
+ list_for_each_entry(it, &it_waiting->link, link)
{
- if (0 == --it->parent->pending)
+ /* exclusive found, stop triggering */
+ if (it->state & KDS_LINK_EXCLUSIVE)
+ break;
+
+ it->state |= KDS_LINK_TRIGGERED;
+ /* a parent to update? */
+ if ( (it->parent != KDS_IGNORED) && (it->parent != KDS_RESOURCE) )
{
- /* new owner now triggered, track for callback later */
- list_add(&it->parent->callback_link, &triggered);
+ if (0 == --it->parent->pending)
+ {
+ /* new owner now triggered, track for callback later */
+ list_add(&it->parent->callback_link, &triggered);
+ }
}
}
}
continue;
}
-
/* we were the head, find the kds_resource */
resource = container_of(it, struct kds_resource, waiters);