From: Arnd Bergmann Date: Tue, 6 Dec 2005 03:52:22 +0000 (-0500) Subject: [PATCH] spufs: fix local store page refcounting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d88cfffac0002c56c1a7a813cb885fa6b5fdcd0e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [PATCH] spufs: fix local store page refcounting With the new rules for reserved pages, the spufs now needs working page reference counting. I should probably look into converting to vm_insert_page, but for now this patch makes spufs work again. Signed-off-by: Arnd Bergmann Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 56273e56cbfb..c41a6e2e2c30 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c @@ -114,7 +114,7 @@ static void __init cell_spuprop_present(struct device_node *spe, for (pfn = start_pfn; pfn < end_pfn; pfn++) { struct page *page = pfn_to_page(pfn); set_page_links(page, ZONE_DMA, node_id, pfn); - set_page_count(page, 0); + set_page_count(page, 1); reset_page_mapcount(page); SetPageReserved(page); INIT_LIST_HEAD(&page->lru); diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 786fdb1a1cc1..0fe1feccc02d 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -106,6 +107,7 @@ spufs_mem_mmap_nopage(struct vm_area_struct *vma, if (type) *type = VM_FAULT_MINOR; + page_cache_get(page); return page; } @@ -120,7 +122,6 @@ spufs_mem_mmap(struct file *file, struct vm_area_struct *vma) return -EINVAL; /* FIXME: */ - vma->vm_flags |= VM_RESERVED; vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) | _PAGE_NO_CACHE);