Skip to content

Commit

Permalink
mm: move swp_entry_t definition to include/linux/mm_types.h
Browse files Browse the repository at this point in the history
swp_entry_t being defined in include/linux/swap.h instead of
include/linux/mm_types.h causes cyclic include dependency later when
include/linux/page_cgroup.h is included from writeback path.  Move the
definition to include/linux/mm_types.h.

While at it, reformat the comment above it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Dec 13, 2014
1 parent 71fbd55 commit bd6dace
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions include/linux/mm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,4 +534,12 @@ enum tlb_flush_reason {
NR_TLB_FLUSH_REASONS,
};

/*
* A swap entry has to fit into a "unsigned long", as the entry is hidden
* in the "index" field of the swapper address space.
*/
typedef struct {
unsigned long val;
} swp_entry_t;

#endif /* _LINUX_MM_TYPES_H */
8 changes: 0 additions & 8 deletions include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ union swap_header {
} info;
};

/* A swap entry has to fit into a "unsigned long", as
* the entry is hidden in the "index" field of the
* swapper address space.
*/
typedef struct {
unsigned long val;
} swp_entry_t;

/*
* current->reclaim_state points to one of these when a task is running
* memory reclaim
Expand Down

0 comments on commit bd6dace

Please sign in to comment.