Commit 0f8053a509ceba4a077a50ea7b77039b5559b428
Committed by
Linus Torvalds
1 parent
4fa4f53bf9
Exists in
master
and in
7 other branches
[PATCH] mm: make __put_page internal
Remove __put_page from outside the core mm/. It is dangerous because it does not handle compound pages nicely, and misses 1->0 transitions. If a user later appears that really needs the extra speed we can reevaluate. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 4 changed files with 15 additions and 1 deletions Side-by-side Diff
include/linux/mm.h
mm/filemap.c
mm/internal.h
... | ... | @@ -8,7 +8,11 @@ |
8 | 8 | * as published by the Free Software Foundation; either version |
9 | 9 | * 2 of the License, or (at your option) any later version. |
10 | 10 | */ |
11 | +#ifndef __MM_INTERNAL_H | |
12 | +#define __MM_INTERNAL_H | |
11 | 13 | |
14 | +#include <linux/mm.h> | |
15 | + | |
12 | 16 | static inline void set_page_refs(struct page *page, int order) |
13 | 17 | { |
14 | 18 | #ifdef CONFIG_MMU |
15 | 19 | |
... | ... | @@ -26,6 +30,13 @@ |
26 | 30 | #endif /* CONFIG_MMU */ |
27 | 31 | } |
28 | 32 | |
33 | +static inline void __put_page(struct page *page) | |
34 | +{ | |
35 | + atomic_dec(&page->_count); | |
36 | +} | |
37 | + | |
29 | 38 | extern void fastcall __init __free_pages_bootmem(struct page *page, |
30 | 39 | unsigned int order); |
40 | + | |
41 | +#endif |