mm: move swp_entry_t definition to include/linux/mm_types.h
authorTejun Heo <tj@kernel.org>
Sat, 13 Dec 2014 00:55:35 +0000 (16:55 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 13 Dec 2014 20:42:47 +0000 (12:42 -0800)
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>
include/linux/mm_types.h
include/linux/swap.h

index bf9f57529dcf18fa007e402d81afdc46916ddce3..fc2daffa9db1274f7274f19c0a8a9805cbe50c19 100644 (file)
@@ -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 */
index 37a585beef5cf86e27fe54bc9a444ce7874ac1d3..34e8b60ab9736b89aa97346d7ccea203f212c84a 100644 (file)
@@ -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