-/*
- * To avoid duplicate insertion by two CPUs of the same xlist item
- * you can call xlist_protect. It will stuff XLIST_PTR_TAIL
- * into the entry->next pointer with xchg, and only return 1
- * if there was a NULL there before.
- *
- * if xlist_protect returns zero, someone else is busy working
- * on this entry. Getting a NULL into the entry in a race
- * free manner is the caller's job.
- */
-static inline int xlist_protect(struct xlist_head *entry)
-{
- struct xlist_head *val;
-
- val = xchg(&entry->next, XLIST_PTR_TAIL);
- if (val == NULL)
- return 1;
- return 0;
-}
-