vserver 2.0 rc7
[linux-2.6.git] / fs / proc / proc_misc.c
index 042fe59..8e58a42 100644 (file)
@@ -146,6 +146,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
        unsigned long committed;
        unsigned long allowed;
        struct vmalloc_info vmi;
+       long cached;
 
        get_page_state(&ps);
        get_zone_counts(&active, &inactive, &free);
@@ -160,6 +161,10 @@ 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 = get_page_cache_size() - total_swapcache_pages - i.bufferram;
+       if (cached < 0)
+               cached = 0;
+
        get_vmalloc_info(&vmi);
 
        /*
@@ -192,7 +197,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
                K(i.totalram),
                K(i.freeram),
                K(i.bufferram),
-               K(get_page_cache_size()-total_swapcache_pages-i.bufferram),
+               K(cached),
                K(total_swapcache_pages),
                K(active),
                K(inactive),
@@ -209,7 +214,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
                K(allowed),
                K(committed),
                K(ps.nr_page_table_pages),
-               VMALLOC_TOTAL >> 10,
+               (unsigned long)VMALLOC_TOTAL >> 10,
                vmi.used >> 10,
                vmi.largest_chunk >> 10
                );
@@ -545,7 +550,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
 
                if (get_user(c, buf))
                        return -EFAULT;
-               __handle_sysrq(c, NULL, NULL);
+               __handle_sysrq(c, NULL, NULL, 0);
        }
        return count;
 }