diff options
| author | Chris Metcalf <cmetcalf@tilera.com> | 2010-07-02 13:41:14 -0400 |
|---|---|---|
| committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-07-06 13:33:54 -0400 |
| commit | de5d9bf6541736dc7ad264d2b5cc99bc1b2ad958 (patch) | |
| tree | b81702527a1b00440d8ae28b858dff93b930c0e6 | |
| parent | b51cae21ee66f77a368428e6bdf75a0c012c9fd7 (diff) | |
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>
| -rw-r--r-- | include/linux/list.h | 13 | ||||
| -rw-r--r-- | include/linux/types.h | 12 |
2 files changed, 13 insertions, 12 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index 8392884a2977..bc43e8a0d7f6 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _LINUX_LIST_H | 1 | #ifndef _LINUX_LIST_H |
| 2 | #define _LINUX_LIST_H | 2 | #define _LINUX_LIST_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 4 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
| 5 | #include <linux/poison.h> | 6 | #include <linux/poison.h> |
| 6 | #include <linux/prefetch.h> | 7 | #include <linux/prefetch.h> |
| @@ -16,10 +17,6 @@ | |||
| 16 | * using the generic single-entry routines. | 17 | * using the generic single-entry routines. |
| 17 | */ | 18 | */ |
| 18 | 19 | ||
| 19 | struct list_head { | ||
| 20 | struct list_head *next, *prev; | ||
| 21 | }; | ||
| 22 | |||
| 23 | #define LIST_HEAD_INIT(name) { &(name), &(name) } | 20 | #define LIST_HEAD_INIT(name) { &(name), &(name) } |
| 24 | 21 | ||
| 25 | #define LIST_HEAD(name) \ | 22 | #define LIST_HEAD(name) \ |
| @@ -551,14 +548,6 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 551 | * You lose the ability to access the tail in O(1). | 548 | * You lose the ability to access the tail in O(1). |
| 552 | */ | 549 | */ |
| 553 | 550 | ||
| 554 | struct hlist_head { | ||
| 555 | struct hlist_node *first; | ||
| 556 | }; | ||
| 557 | |||
| 558 | struct hlist_node { | ||
| 559 | struct hlist_node *next, **pprev; | ||
| 560 | }; | ||
| 561 | |||
| 562 | #define HLIST_HEAD_INIT { .first = NULL } | 551 | #define HLIST_HEAD_INIT { .first = NULL } |
| 563 | #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } | 552 | #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } |
| 564 | #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) | 553 | #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) |
diff --git a/include/linux/types.h b/include/linux/types.h index 23d237a075e2..336cc39c46f1 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -197,6 +197,18 @@ typedef struct { | |||
| 197 | } atomic64_t; | 197 | } atomic64_t; |
| 198 | #endif | 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 | struct ustat { | 212 | struct ustat { |
| 201 | __kernel_daddr_t f_tfree; | 213 | __kernel_daddr_t f_tfree; |
| 202 | __kernel_ino_t f_tinode; | 214 | __kernel_ino_t f_tinode; |
