]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/proc/mmu.c
RDMA/iwcm: Test rdma_create_id() for IS_ERR rather than 0
[linux-2.6-omap-h63xx.git] / fs / proc / mmu.c
index a7041038ad56108ef45f195bedf109dbbb7ddb24..8ae221dfd0101ea3048de30bbf3444a89f147ea0 100644 (file)
@@ -8,27 +8,10 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/time.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/mman.h>
-#include <linux/proc_fs.h>
-#include <linux/mm.h>
-#include <linux/mmzone.h>
-#include <linux/pagemap.h>
-#include <linux/swap.h>
-#include <linux/slab.h>
-#include <linux/smp.h>
-#include <linux/seq_file.h>
-#include <linux/hugetlb.h>
+#include <linux/spinlock.h>
 #include <linux/vmalloc.h>
-#include <asm/uaccess.h>
+#include <linux/highmem.h>
 #include <asm/pgtable.h>
-#include <asm/tlb.h>
-#include <asm/div64.h>
 #include "internal.h"
 
 void get_vmalloc_info(struct vmalloc_info *vmi)
@@ -50,13 +33,23 @@ void get_vmalloc_info(struct vmalloc_info *vmi)
                read_lock(&vmlist_lock);
 
                for (vma = vmlist; vma; vma = vma->next) {
+                       unsigned long addr = (unsigned long) vma->addr;
+
+                       /*
+                        * Some archs keep another range for modules in vmlist
+                        */
+                       if (addr < VMALLOC_START)
+                               continue;
+                       if (addr >= VMALLOC_END)
+                               break;
+
                        vmi->used += vma->size;
 
-                       free_area_size = (unsigned long) vma->addr - prev_end;
+                       free_area_size = addr - prev_end;
                        if (vmi->largest_chunk < free_area_size)
                                vmi->largest_chunk = free_area_size;
 
-                       prev_end = vma->size + (unsigned long) vma->addr;
+                       prev_end = vma->size + addr;
                }
 
                if (VMALLOC_END - prev_end > vmi->largest_chunk)