2.4.5-ac13 ramfs and tmpfs accounting
Subsystems (4)
PATCH 1/1 2.4.5-ac13 ramfs and tmpfs accounting
Hi Alan,
ramfs accounting does not get notified when a clean page gets dropped from the inode.
Also tmpfs should use the new function to do accurate accounting. Else the cached field in -ac will get spurious negative values.
The following patch fixes both.
Greetings
Christoph
fs/ramfs/inode.c +2 -2
@@ -289,7 +289,7 @@return 0 ; } -static void ramfs_truncatepage (struct page *page) +static void ramfs_removepage (struct page *page) {struct inode *inode = (struct inode *)page->mapping->host;
@@ -659,7 +659,7 @@ writepage: ramfs_writepage, prepare_write: ramfs_prepare_write, commit_write: ramfs_commit_write, - truncatepage: ramfs_truncatepage, + removepage: ramfs_removepage, };static struct file_operations ramfs_file_operations = {
include/linux/fs.h +1 -1
@@ -368,7 +368,7 @@int (*sync_page)(struct page *);int (*prepare_write)(struct file *,struct page *,unsigned ,unsigned );int (*commit_write)(struct file *,struct page *,unsigned ,unsigned ); -void (*truncatepage)(struct page *);/* called from truncate_complete_page */ +void (*removepage)(struct page *);/* called when page gets removed from the inode */ /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ int (*bmap)(struct address_space *,long ); };
mm/filemap.c +3 -3
@@ -82,6 +82,9 @@ {struct address_space * mapping = page->mapping; +if (mapping->a_ops->removepage) + mapping->a_ops->removepage (page); + mapping->nrpages--;list_del (&page->list); page->mapping =NULL ;
@@ -206,9 +209,6 @@if (!page->buffers ||block_flushpage (page,0 ))lru_cache_del (page); -if (page->mapping->a_ops->truncatepage) - page->mapping->a_ops->truncatepage (page); -/* * We remove the page from the page cache _after_ we have * destroyed all buffer-cache references to it. Otherwise some
mm/shmem.c +14 -37
83 lines not on this page · raw message