Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Move list types from <linux/list.h> to <linux/types.h>.

This allows a list_head (or hlist_head, etc.) to be used from places
that used to be impractical, in particular <asm/processor.h>, which
used to cause include file recursion: <linux/list.h> includes
<linux/prefetch.h>, which always includes <asm/processor.h> for the
prefetch macros, as well as <asm/system.h>, which often includes
<asm/processor.h> directly or indirectly.

This avoids a lot of painful workaround hackery on the tile
architecture, where we use a list_head in the thread_struct to chain
together tasks that are activated on a particular hardwall.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>

+13 -12
+1 -12
include/linux/list.h
··· 1 1 #ifndef _LINUX_LIST_H 2 2 #define _LINUX_LIST_H 3 3 4 + #include <linux/types.h> 4 5 #include <linux/stddef.h> 5 6 #include <linux/poison.h> 6 7 #include <linux/prefetch.h> ··· 16 15 * generate better code by using them directly rather than 17 16 * using the generic single-entry routines. 18 17 */ 19 - 20 - struct list_head { 21 - struct list_head *next, *prev; 22 - }; 23 18 24 19 #define LIST_HEAD_INIT(name) { &(name), &(name) } 25 20 ··· 547 550 * too wasteful. 548 551 * You lose the ability to access the tail in O(1). 549 552 */ 550 - 551 - struct hlist_head { 552 - struct hlist_node *first; 553 - }; 554 - 555 - struct hlist_node { 556 - struct hlist_node *next, **pprev; 557 - }; 558 553 559 554 #define HLIST_HEAD_INIT { .first = NULL } 560 555 #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL }
+12
include/linux/types.h
··· 197 197 } atomic64_t; 198 198 #endif 199 199 200 + struct list_head { 201 + struct list_head *next, *prev; 202 + }; 203 + 204 + struct hlist_head { 205 + struct hlist_node *first; 206 + }; 207 + 208 + struct hlist_node { 209 + struct hlist_node *next, **pprev; 210 + }; 211 + 200 212 struct ustat { 201 213 __kernel_daddr_t f_tfree; 202 214 __kernel_ino_t f_tinode;