X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Fasm-powerpc%2Fpgalloc-64.h;h=43214c8085b7f36cdf44a205e8c5fac8a3aad7b1;hb=93890b71a34f9490673a6edd56b61c2124215e46;hp=d9a3a8ca58a108ed0781e17ed9d80903a5176f7b;hpb=5884c40668a928bba017eaf54e2eb3c01c8a98e6;p=linux-2.6-omap-h63xx.git diff --git a/include/asm-powerpc/pgalloc-64.h b/include/asm-powerpc/pgalloc-64.h index d9a3a8ca58a..43214c8085b 100644 --- a/include/asm-powerpc/pgalloc-64.h +++ b/include/asm-powerpc/pgalloc-64.h @@ -12,6 +12,10 @@ #include #include +#ifndef CONFIG_PPC_SUBPAGE_PROT +static inline void subpage_prot_free(pgd_t *pgd) {} +#endif + extern struct kmem_cache *pgtable_cache[]; #define PGD_CACHE_NUM 0 @@ -27,6 +31,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) static inline void pgd_free(pgd_t *pgd) { + subpage_prot_free(pgd); kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd); } @@ -90,7 +95,8 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - return virt_to_page(pte_alloc_one_kernel(mm, address)); + pte_t *pte = pte_alloc_one_kernel(mm, address); + return pte ? virt_to_page(pte) : NULL; } static inline void pte_free_kernel(pte_t *pte)