mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
[PATCH] remove set_page_count() outside mm/
set_page_count usage outside mm/ is limited to setting the refcount to 1. Remove set_page_count from outside mm/, and replace those users with init_page_count() and set_page_refcounted(). This allows more debug checking, and tighter control on how code is allowed to play around with page->_count. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
70dc991d66
commit
7835e98b2e
40 changed files with 96 additions and 79 deletions
|
@ -13,8 +13,19 @@
|
|||
|
||||
#include <linux/mm.h>
|
||||
|
||||
static inline void set_page_refs(struct page *page, int order)
|
||||
static inline void set_page_count(struct page *page, int v)
|
||||
{
|
||||
atomic_set(&page->_count, v);
|
||||
}
|
||||
|
||||
/*
|
||||
* Turn a non-refcounted page (->_count == 0) into refcounted with
|
||||
* a count of one.
|
||||
*/
|
||||
static inline void set_page_refcounted(struct page *page)
|
||||
{
|
||||
BUG_ON(PageCompound(page) && page_private(page) != (unsigned long)page);
|
||||
BUG_ON(atomic_read(&page->_count));
|
||||
set_page_count(page, 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue