[Bluetooth] Add generic driver for Bluetooth SDIO devices
[pandora-kernel.git] / mm / rmap.c
index 850165d..8990f90 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -36,6 +36,7 @@
  *                 mapping->tree_lock (widely used, in set_page_dirty,
  *                           in arch-dependent flush_dcache_mmap_lock,
  *                           within inode_lock in __sync_single_inode)
+ *                   zone->lock (within radix tree node alloc)
  */
 
 #include <linux/mm.h>
 
 struct kmem_cache *anon_vma_cachep;
 
-static inline void validate_anon_vma(struct vm_area_struct *find_vma)
-{
-#ifdef CONFIG_DEBUG_VM
-       struct anon_vma *anon_vma = find_vma->anon_vma;
-       struct vm_area_struct *vma;
-       unsigned int mapcount = 0;
-       int found = 0;
-
-       list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
-               mapcount++;
-               BUG_ON(mapcount > 100000);
-               if (vma == find_vma)
-                       found = 1;
-       }
-       BUG_ON(!found);
-#endif
-}
-
 /* This must be called under the mmap_sem. */
 int anon_vma_prepare(struct vm_area_struct *vma)
 {
@@ -121,10 +104,8 @@ void __anon_vma_link(struct vm_area_struct *vma)
 {
        struct anon_vma *anon_vma = vma->anon_vma;
 
-       if (anon_vma) {
+       if (anon_vma)
                list_add_tail(&vma->anon_vma_node, &anon_vma->head);
-               validate_anon_vma(vma);
-       }
 }
 
 void anon_vma_link(struct vm_area_struct *vma)
@@ -134,7 +115,6 @@ void anon_vma_link(struct vm_area_struct *vma)
        if (anon_vma) {
                spin_lock(&anon_vma->lock);
                list_add_tail(&vma->anon_vma_node, &anon_vma->head);
-               validate_anon_vma(vma);
                spin_unlock(&anon_vma->lock);
        }
 }
@@ -148,7 +128,6 @@ void anon_vma_unlink(struct vm_area_struct *vma)
                return;
 
        spin_lock(&anon_vma->lock);
-       validate_anon_vma(vma);
        list_del(&vma->anon_vma_node);
 
        /* We must garbage collect the anon_vma if it's empty */
@@ -159,8 +138,7 @@ void anon_vma_unlink(struct vm_area_struct *vma)
                anon_vma_free(anon_vma);
 }
 
-static void anon_vma_ctor(void *data, struct kmem_cache *cachep,
-                         unsigned long flags)
+static void anon_vma_ctor(struct kmem_cache *cachep, void *data)
 {
        struct anon_vma *anon_vma = data;
 
@@ -171,7 +149,7 @@ static void anon_vma_ctor(void *data, struct kmem_cache *cachep,
 void __init anon_vma_init(void)
 {
        anon_vma_cachep = kmem_cache_create("anon_vma", sizeof(struct anon_vma),
-                       0, SLAB_DESTROY_BY_RCU|SLAB_PANIC, anon_vma_ctor, NULL);
+                       0, SLAB_DESTROY_BY_RCU|SLAB_PANIC, anon_vma_ctor);
 }
 
 /*
@@ -458,7 +436,6 @@ static int page_mkclean_one(struct page *page, struct vm_area_struct *vma)
                entry = pte_wrprotect(entry);
                entry = pte_mkclean(entry);
                set_pte_at(mm, address, pte, entry);
-               lazy_mmu_prot_update(entry);
                ret = 1;
        }
 
@@ -643,8 +620,10 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma)
                        printk (KERN_EMERG "  page->count = %x\n", page_count(page));
                        printk (KERN_EMERG "  page->mapping = %p\n", page->mapping);
                        print_symbol (KERN_EMERG "  vma->vm_ops = %s\n", (unsigned long)vma->vm_ops);
-                       if (vma->vm_ops)
+                       if (vma->vm_ops) {
                                print_symbol (KERN_EMERG "  vma->vm_ops->nopage = %s\n", (unsigned long)vma->vm_ops->nopage);
+                               print_symbol (KERN_EMERG "  vma->vm_ops->fault = %s\n", (unsigned long)vma->vm_ops->fault);
+                       }
                        if (vma->vm_file && vma->vm_file->f_op)
                                print_symbol (KERN_EMERG "  vma->vm_file->f_op->mmap = %s\n", (unsigned long)vma->vm_file->f_op->mmap);
                        BUG();