Hi Philip,
On 16/11/10 07:56, Philip Nye wrote:
I've just got my Coldfire m5272 target up with a recent kernel from git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git I find that a recent overhaul of fs/nfs/dir.c has introduced a vm_map_ram() call which is triggering a BUG() in nommu.c. Does anyone have a patch for this? or any suggestions on how to fix it?
Eww, that is not pretty. Here is a (probably quite bogus) first attempt at a fix. I hacked this up quickly, the refcounting is probably wrong (it probably leaks memory) but it seems to work for simple test cases. Regards Greg ------------------------------------------------------------------------ Greg Ungerer -- Principal Engineer EMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
--- linux-2.6.x/fs/nfs/dir.c.org 2010-11-16 16:09:12.501834525 +1000 +++ linux-2.6.x/fs/nfs/dir.c 2010-11-17 13:57:54.681833200 +1000 @@ -500,7 +500,11 @@ static void nfs_readdir_free_large_page(void *ptr, struct page **pages, unsigned int npages) { +#ifdef CONFIG_MMU vm_unmap_ram(ptr, npages); +#else + __free_pages(pages[0], get_order(npages)); +#endif nfs_readdir_free_pagearray(pages, npages); } @@ -514,6 +518,7 @@ void *nfs_readdir_large_page(struct page void *ptr; unsigned int i; +#ifdef CONFIG_MMU for (i = 0; i < npages; i++) { struct page *page = alloc_page(GFP_KERNEL); if (page == NULL) @@ -527,6 +532,17 @@ void *nfs_readdir_large_page(struct page out_freepages: nfs_readdir_free_pagearray(pages, i); return NULL; +#else + struct page *bp; + + bp = alloc_pages(GFP_KERNEL, get_order(npages * PAGE_SIZE)); + ptr = page_address(bp); + for (i = 0; i < npages; i++, bp++) { + get_page(bp); + pages[i] = bp; + } + return ptr; +#endif } static
_______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev