diff -Naur linux-2.5.49-mm2/mm/page_walk.c linux-2.5.49-mm2-ioe/mm/page_walk.c --- linux-2.5.49-mm2/mm/page_walk.c Wed Nov 27 14:48:33 2002 +++ linux-2.5.49-mm2-ioe/mm/page_walk.c Wed Nov 27 17:05:35 2002 @@ -116,6 +116,7 @@ struct vm_area_struct *vma = pw->vma; int write = pw->vm_flags & (VM_MAYWRITE|VM_WRITE); + /* follow_page also does all the checking of ptes for us. */ while (!(page= follow_page(vma->vm_mm, pw->virt, write))) { int fault; @@ -138,16 +139,7 @@ } spin_lock(&vma->vm_mm->page_table_lock); } - /* - * Given a physical address, is there a useful struct page pointing to - * it? This may become more complex in the future if we start dealing - * with IO-aperture pages for direct-IO. - */ - if (pfn_valid(page_to_pfn(page))) - return page; - - spin_unlock(&vma->vm_mm->page_table_lock); - return ERR_PTR(-EFAULT); + return page; } /* Setup page walking for the simple and common case. @@ -291,7 +283,7 @@ pw->page = single_page_walk(pw); if (IS_ERR(pw->page)) { ret = PTR_ERR(pw->page); - break; + goto out_unlocked; } ret = pw->walker(pw->data); @@ -304,7 +296,8 @@ } while (pw->virt < vma->vm_end); spin_unlock(&pw->mm->page_table_lock); } while (ret == 0); - + +out_unlocked: /* cleanup after errors */ if (ret < 0 && pw->cleaner) pw->cleaner(pw->data); @@ -393,3 +386,12 @@ EXPORT_SYMBOL(get_user_pages); EXPORT_SYMBOL(get_one_user_page); EXPORT_SYMBOL_GPL(walk_user_pages); +EXPORT_SYMBOL_GPL(setup_simple_page_walk); +EXPORT_SYMBOL_GPL(setup_sgl_page_walk); +EXPORT_SYMBOL_GPL(fixup_sgl_walk); +EXPORT_SYMBOL_GPL(gup_add_pages); +EXPORT_SYMBOL_GPL(gup_cleanup_pages); +EXPORT_SYMBOL_GPL(gup_cleanup_pages_kfree); +EXPORT_SYMBOL_GPL(gup_add_sgls); +EXPORT_SYMBOL_GPL(gup_cleanup_sgls); +EXPORT_SYMBOL_GPL(gup_cleanup_sgls_kfree);