mm: move swp_entry_t definition to include/linux/mm_types.h
PATCH 1/1 mm: move swp_entry_t definition to include/linux/mm_types.h
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.
--- include/linux/mm_types.h | 8 ++++++++ include/linux/swap.h | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-)
include/linux/mm_types.h +8 -0
@@ -525,4 +525,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 */
include/linux/swap.h +0 -8
@@ -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
Andrew Morton
maintainerQuoted 31 lines · On Mon, 17 Nov 2014 16:17:23 -0500 Tejun Heo <[email protected]> wrote:
swp_entry_tbeing defined ininclude/linux/swap.hinstead ofinclude/linux/mm_types.hcauses cyclic include dependency later wheninclude/linux/page_cgroup.his included from writeback path. Move the definition toinclude/linux/mm_types.h.While at it, reformat the comment above it.
...
include/linux/mm_types.h +8
-0@@ -525,4 +525,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 */ include/linux/swap.h +0
-1@@ -102,14 +102,6 @@ union swap_header { } info; }; -/* A swap entry has to fit into a "unsigned long", as
include/linux/swap.h union swap_header { · line 107
Quoted 10 lines
include/linux/swap.h +0
-7-* 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
Looks OK to me. Do you have some patch which depends on this? If so, please merge this via whatever tree carries that patch?
Quoted 2 lines · Andrew Morton
Looks OK to me. Do you have some patch which depends on this? If so, please merge this via whatever tree carries that patch?
The dependant ones will have to go through -mm anyway, so applying to -mm should be fine.
Thanks.
Signature · 1 line
tejun