X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=mm%2Finternal.h;h=d527b80b292fc7d96308ab91f459dbe7bae874c8;hb=0fbbeba2427a842a1a4ac9f379ca2ca37ea907eb;hp=6bf134e8fb3d4cd0beac17c961c2caad506596ed;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=powerpc.git diff --git a/mm/internal.h b/mm/internal.h index 6bf134e8fb..d527b80b29 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -8,6 +8,33 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#ifndef __MM_INTERNAL_H +#define __MM_INTERNAL_H -/* page_alloc.c */ -extern void set_page_refs(struct page *page, int order); +#include + +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) +{ + VM_BUG_ON(PageCompound(page) && page_private(page) != (unsigned long)page); + VM_BUG_ON(atomic_read(&page->_count)); + set_page_count(page, 1); +} + +static inline void __put_page(struct page *page) +{ + atomic_dec(&page->_count); +} + +extern void fastcall __init __free_pages_bootmem(struct page *page, + unsigned int order); + +#endif