]> Pileus Git - ~andy/linux/blobdiff - fs/proc/proc_misc.c
Automatic merge of /spare/repo/netdev-2.6 branch natsemi
[~andy/linux] / fs / proc / proc_misc.c
index 1d75d6ab6897df73168ecdf4baab53bedbef6709..a60a3b3d8a7b1c31870dee3d947fe119a5787a5d 100644 (file)
@@ -126,6 +126,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);
@@ -140,6 +141,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);
 
        /*
@@ -172,7 +177,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),