]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/list.h
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / include / linux / list.h
index e951228db4b2c64f68a05f73bd6e058652699730..85c92555e31f85f019354e54d6efb8e79c2aee17 100644 (file)
@@ -106,6 +106,20 @@ static inline void __list_del(struct list_head * prev, struct list_head * next)
        WRITE_ONCE(prev->next, next);
 }
 
+/*
+ * Delete a list entry and clear the 'prev' pointer.
+ *
+ * This is a special-purpose list clearing method used in the networking code
+ * for lists allocated as per-cpu, where we don't want to incur the extra
+ * WRITE_ONCE() overhead of a regular list_del_init(). The code that uses this
+ * needs to check the node 'prev' pointer instead of calling list_empty().
+ */
+static inline void __list_del_clearprev(struct list_head *entry)
+{
+       __list_del(entry->prev, entry->next);
+       entry->prev = NULL;
+}
+
 /**
  * list_del - deletes entry from list.
  * @entry: the element to delete from the list.