History

fs: don't open code lru_to_page()

Multiple filesystems open code lru_to_page(). Rectify this by moving the macro from mm_inline (which is specific to lru stuff) to the more generic mm.h header and start using the macro where appropriate. No functional changes.

Nikolay Borisov committed 7 years ago

Commit f86196e1 parent 08d405c10 files · +15 −15Browse files

Showing the changes to include/linux (2 of 10 files). Show all

Unified · Split

2 files
  1. include/linux/mm.h +2 −0
  2. include/linux/mm_inline.h +0 −3
include/linux/mm.h+2−0
@@ -171,6 +171,8 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *, · 170 unmodified lines
171171 /* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */
172172 #define PAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)(addr), PAGE_SIZE)
173173
174+#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
175+
174176 /*
175177 * Linux kernel virtual memory manager primitives.
176178 * The idea being to have a "virtual" mm in the same way
include/linux/mm_inline.h+0−3
@@ -124,7 +124,4 @@ static __always_inline enum lru_list page_lru(struct page *page) · 123 unmodified lines
124124 }
125125 return lru;
126126 }
127−
128−#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
129−
130127 #endif