/* @node: &struct plist_node pointer @head: &struct plist_head pointer  */
void plist_add(struct plist_node *node, struct plist_head *head)
/* @node: &struct plist_node pointer @head: &struct plist_head pointer  */
void plist_add(struct plist_node *node, struct plist_head *head)
{
	struct plist_node *iter;
	plist_check_head(head);
	WARN_ON(!plist_node_empty(node));
	list_for_each_entry(iter, &head->prio_list, plist.prio_list) {
		if (node->prio < iter->prio)
			goto lt_prio;
		else if (node->prio == iter->prio) {
			iter = list_entry(iter->plist.prio_list.next,
					struct plist_node, plist.prio_list);
			goto eq_prio;
		}
	}
lt_prio:
	list_add_tail(&node->plist.prio_list, &iter->plist.prio_list);
eq_prio:
	list_add_tail(&node->plist.node_list, &iter->plist.node_list);
	plist_check_head(head);
}