Skip to content

Commit

Permalink
Move list types from <linux/list.h> to <linux/types.h>.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Metcalf committed Jul 6, 2010
1 parent b51cae2 commit de5d9bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 1 addition & 12 deletions include/linux/list.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H

#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/poison.h>
#include <linux/prefetch.h>
Expand All @@ -16,10 +17,6 @@
* using the generic single-entry routines.
*/

struct list_head {
struct list_head *next, *prev;
};

#define LIST_HEAD_INIT(name) { &(name), &(name) }

#define LIST_HEAD(name) \
Expand Down Expand Up @@ -551,14 +548,6 @@ static inline void list_splice_tail_init(struct list_head *list,
* You lose the ability to access the tail in O(1).
*/

struct hlist_head {
struct hlist_node *first;
};

struct hlist_node {
struct hlist_node *next, **pprev;
};

#define HLIST_HEAD_INIT { .first = NULL }
#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL }
#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
Expand Down
12 changes: 12 additions & 0 deletions include/linux/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,18 @@ typedef struct {
} atomic64_t;
#endif

struct list_head {
struct list_head *next, *prev;
};

struct hlist_head {
struct hlist_node *first;
};

struct hlist_node {
struct hlist_node *next, **pprev;
};

struct ustat {
__kernel_daddr_t f_tfree;
__kernel_ino_t f_tinode;
Expand Down

0 comments on commit de5d9bf

Please sign in to comment.