Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / fs / proc / proc_misc.c
index f8eebe6..16271a1 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/mman.h>
 #include <linux/proc_fs.h>
 #include <linux/ioport.h>
+#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/pagemap.h>
@@ -52,6 +53,8 @@
 #include <asm/div64.h>
 #include "internal.h"
 
+#include <linux/vs_cvirt.h>
+
 #define LOAD_INT(x) ((x) >> FSHIFT)
 #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
 /*
@@ -137,6 +140,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
 {
        struct sysinfo i;
        int len;
+       struct page_state ps;
        unsigned long inactive;
        unsigned long active;
        unsigned long free;
@@ -145,6 +149,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
        struct vmalloc_info vmi;
        long cached;
 
+       get_page_state(&ps);
        get_zone_counts(&active, &inactive, &free);
 
 /*
@@ -157,8 +162,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
        allowed = ((totalram_pages - hugetlb_total_pages())
                * sysctl_overcommit_ratio / 100) + total_swap_pages;
 
-       cached = global_page_state(NR_FILE_PAGES) -
-                       total_swapcache_pages - i.bufferram;
+       cached = get_page_cache_size() - total_swapcache_pages - i.bufferram;
        if (cached < 0 || vx_flags(VXF_VIRT_MEM, 0))
                cached = 0;
 
@@ -183,14 +187,11 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
                "SwapFree:     %8lu kB\n"
                "Dirty:        %8lu kB\n"
                "Writeback:    %8lu kB\n"
-               "AnonPages:    %8lu kB\n"
                "Mapped:       %8lu kB\n"
                "Slab:         %8lu kB\n"
-               "PageTables:   %8lu kB\n"
-               "NFS_Unstable: %8lu kB\n"
-               "Bounce:       %8lu kB\n"
                "CommitLimit:  %8lu kB\n"
                "Committed_AS: %8lu kB\n"
+               "PageTables:   %8lu kB\n"
                "VmallocTotal: %8lu kB\n"
                "VmallocUsed:  %8lu kB\n"
                "VmallocChunk: %8lu kB\n",
@@ -207,16 +208,13 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
                K(i.freeram-i.freehigh),
                K(i.totalswap),
                K(i.freeswap),
-               K(global_page_state(NR_FILE_DIRTY)),
-               K(global_page_state(NR_WRITEBACK)),
-               K(global_page_state(NR_ANON_PAGES)),
-               K(global_page_state(NR_FILE_MAPPED)),
-               K(global_page_state(NR_SLAB)),
-               K(global_page_state(NR_PAGETABLE)),
-               K(global_page_state(NR_UNSTABLE_NFS)),
-               K(global_page_state(NR_BOUNCE)),
+               K(ps.nr_dirty),
+               K(ps.nr_writeback),
+               K(ps.nr_mapped),
+               K(ps.nr_slab),
                K(allowed),
                K(committed),
+               K(ps.nr_page_table_pages),
                (unsigned long)VMALLOC_TOTAL >> 10,
                vmi.used >> 10,
                vmi.largest_chunk >> 10