141 * Note: list_empty() on entry does not return true after this, the entry is 142 * in an undefined state. 140 * the element to delete from the list. 123 */ 124static inline void _list_del_clearprev(struct list_head * entry)ġ26 _list_del( entry-> prev, entry-> next) ġ29 130static inline void _list_del_entry(struct list_head * entry)ġ32 if (! _list_del_entry_valid( entry))ġ34 135 _list_del( entry-> prev, entry-> next) ġ37 138 /** 139 * list_del - deletes entry from list. The code that uses this 122 * needs to check the node 'prev' pointer instead of calling list_empty(). 118 * 119 * This is a special-purpose list clearing method used in the networking code 120 * for lists allocated as per-cpu, where we don't want to incur the extra 121 * WRITE_ONCE() overhead of a regular list_del_init(). 106 * 107 * This is only for internal list manipulation where we know 108 * the prev/next entries already! 109 */ 110static inline void _list_del(struct list_head * prev, struct list_head * next)ġ15 116 /* 117 * Delete a list entry and clear the 'prev' pointer. 97 */ 98static inline void list_add_tail(struct list_head * new, struct list_head * head)ġ02 103 /* 104 * Delete a list entry by making the prev/next entries 105 * point to each other. 96 * This is useful for implementing queues. 83 */ 84static inline void list_add(struct list_head * new, struct list_head * head)Ĩ8 89 90 /** 91 * list_add_tail - add a new entry 92 * new entry to be added 93 * list head to add it before 94 * 95 * Insert a new entry before the specified head. 82 * This is good for implementing stacks. 59 * 60 * This is only for internal list manipulation where we know 61 * the prev/next entries already! 62 */ 63static inline void _list_add(struct list_head * new,Ħ7 if (! _list_add_valid( new, prev, next))ħ5 76 /** 77 * list_add - add a new entry 78 * new entry to be added 79 * list head to add it after 80 * 81 * Insert a new entry after the specified head. 32 */ 33static inline void INIT_LIST_HEAD(struct list_head * list)ģ8 39#ifdef CONFIG_DEBUG_LIST 40extern bool _list_add_valid(struct list_head * new,Ĥ3extern bool _list_del_entry_valid(struct list_head * entry) Ĥ5static inline bool _list_add_valid(struct list_head * new,ĥ1static inline bool _list_del_entry_valid(struct list_head * entry)ĥ6 57 /* 58 * Insert a new entry between two known consecutive entries. If it is a list header, 31 * the result is an empty list. 29 * 30 * Initializes the list_head to point to itself. 19 */ 20 21#define LIST_HEAD_INIT( name) Ģ4 struct list_head name = LIST_HEAD_INIT( name)Ģ5 26 /** 27 * INIT_LIST_HEAD - Initialize a list_head structure 28 * list_head structure to be initialized. 13 * 14 * Some of the internal functions ("_xxx") are useful when 15 * manipulating whole lists rather than single entries, as 16 * sometimes we already know the next/prev entries and we can 17 * generate better code by using them directly rather than 18 * using the generic single-entry routines. 1 /* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _LINUX_LIST_H 3#define _LINUX_LIST_H 4 5#include ġ0 11 /* 12 * Circular doubly linked list implementation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |