return bdev;
}
+long nr_blockdev_pages(void)
+{
+ long ret = 0;
+ int i;
+
+ spin_lock(&bdev_lock);
+ for (i = 0; i < ARRAY_SIZE(bdev_hashtable); i++) {
+ struct list_head *head = &bdev_hashtable[i];
+ struct list_head *lh;
+
+ if (head == NULL)
+ continue;
+ list_for_each(lh, head) {
+ struct block_device *bdev;
+
+ bdev = list_entry(lh, struct block_device, bd_hash);
+ ret += bdev->bd_inode->i_mapping->nrpages;
+ }
+ }
+ spin_unlock(&bdev_lock);
+ return ret;
+}
+
static inline void __bd_forget(struct inode *inode)
{
list_del_init(&inode->i_devices);
"MemTotal: %8lu kB\n"
"MemFree: %8lu kB\n"
"MemShared: %8lu kB\n"
+ "Buffers: %8lu kB\n"
"Cached: %8lu kB\n"
"SwapCached: %8lu kB\n"
"Active: %8lu kB\n"
K(i.totalram),
K(i.freeram),
K(i.sharedram),
- K(ps.nr_pagecache-swapper_space.nrpages),
+ K(i.bufferram),
+ K(ps.nr_pagecache-swapper_space.nrpages-i.bufferram),
K(swapper_space.nrpages),
K(active),
K(inactive),
extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *);
extern void blk_dump_rq_flags(struct request *, char *);
extern void generic_unplug_device(void *);
-
+extern long nr_blockdev_pages(void);
/*
* tag stuff
#include <linux/module.h>
#include <linux/suspend.h>
#include <linux/pagevec.h>
+#include <linux/blkdev.h>
unsigned long totalram_pages;
unsigned long totalhigh_pages;
val->totalram = totalram_pages;
val->sharedram = 0;
val->freeram = nr_free_pages();
- val->bufferram = get_page_cache_size();
+ val->bufferram = nr_blockdev_pages();
#ifdef CONFIG_HIGHMEM
val->totalhigh = totalhigh_pages;
val->freehigh = nr_free_highpages();