Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=22cd25ed31bbf849acaa06ab220dc4f526153f13
Commit:     22cd25ed31bbf849acaa06ab220dc4f526153f13
Parent:     e0dc0d8f4a327d033bfb63d43f113d5f31d11b3c
Author:     Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 12 00:51:38 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 12 09:48:27 2007 -0800

    [PATCH] Add NOPFN_REFAULT result from vm_ops->nopfn()
    
    Add a NOPFN_REFAULT return code for vm_ops->nopfn() equivalent to
    NOPAGE_REFAULT for vmops->nopage() indicating that the handler requests a
    re-execution of the faulting instruction
    
    Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Cc: Arnd Bergmann <[EMAIL PROTECTED]>
    Cc: Hugh Dickins <[EMAIL PROTECTED]>
    Cc: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/mm.h |    1 +
 mm/memory.c        |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 903f3b7..a0eec16 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -637,6 +637,7 @@ static inline int page_mapped(struct page *page)
  */
 #define NOPFN_SIGBUS   ((unsigned long) -1)
 #define NOPFN_OOM      ((unsigned long) -2)
+#define NOPFN_REFAULT  ((unsigned long) -3)
 
 /*
  * Different kinds of faults, as returned by handle_mm_fault().
diff --git a/mm/memory.c b/mm/memory.c
index 8b8f0d2..e7066e7 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2355,10 +2355,12 @@ static noinline int do_no_pfn(struct mm_struct *mm, 
struct vm_area_struct *vma,
        BUG_ON(is_cow_mapping(vma->vm_flags));
 
        pfn = vma->vm_ops->nopfn(vma, address & PAGE_MASK);
-       if (pfn == NOPFN_OOM)
+       if (unlikely(pfn == NOPFN_OOM))
                return VM_FAULT_OOM;
-       if (pfn == NOPFN_SIGBUS)
+       else if (unlikely(pfn == NOPFN_SIGBUS))
                return VM_FAULT_SIGBUS;
+       else if (unlikely(pfn == NOPFN_REFAULT))
+               return VM_FAULT_MINOR;
 
        page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to