Commit 9d54df6e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove swapper_inode

By moving the special-casing for swapper_space out of __mark_inode_dirty()
and into __set_page_dirty_nobuffers() we can remove swapper_inode.
parent afa31420
...@@ -49,9 +49,6 @@ void __mark_inode_dirty(struct inode *inode, int flags) ...@@ -49,9 +49,6 @@ void __mark_inode_dirty(struct inode *inode, int flags)
{ {
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
if (!sb)
return; /* swapper_space */
/* /*
* Don't do this for I_DIRTY_PAGES - that doesn't actually * Don't do this for I_DIRTY_PAGES - that doesn't actually
* dirty the inode itself * dirty the inode itself
...@@ -90,9 +87,12 @@ void __mark_inode_dirty(struct inode *inode, int flags) ...@@ -90,9 +87,12 @@ void __mark_inode_dirty(struct inode *inode, int flags)
* Only add valid (hashed) inodes to the superblock's * Only add valid (hashed) inodes to the superblock's
* dirty list. Add blockdev inodes as well. * dirty list. Add blockdev inodes as well.
*/ */
if ((hlist_unhashed(&inode->i_hash) || (inode->i_state & (I_FREEING|I_CLEAR))) if (!S_ISBLK(inode->i_mode)) {
&& !S_ISBLK(inode->i_mode)) if (hlist_unhashed(&inode->i_hash))
goto out;
if (inode->i_state & (I_FREEING|I_CLEAR))
goto out; goto out;
}
/* /*
* If the inode was already on s_dirty or s_io, don't * If the inode was already on s_dirty or s_io, don't
......
...@@ -516,7 +516,9 @@ int __set_page_dirty_nobuffers(struct page *page) ...@@ -516,7 +516,9 @@ int __set_page_dirty_nobuffers(struct page *page)
list_add(&page->list, &mapping->dirty_pages); list_add(&page->list, &mapping->dirty_pages);
} }
spin_unlock(&mapping->page_lock); spin_unlock(&mapping->page_lock);
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES); if (!PageSwapCache(page))
__mark_inode_dirty(mapping->host,
I_DIRTY_PAGES);
} }
} }
return ret; return ret;
......
...@@ -16,14 +16,6 @@ ...@@ -16,14 +16,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
/*
* swapper_inode doesn't do anything much. It is really only here to
* avoid some special-casing in other parts of the kernel.
*/
static struct inode swapper_inode = {
.i_mapping = &swapper_space,
};
static struct backing_dev_info swap_backing_dev_info = { static struct backing_dev_info swap_backing_dev_info = {
.ra_pages = 0, /* No readahead */ .ra_pages = 0, /* No readahead */
.memory_backed = 1, /* Does not contribute to dirty memory */ .memory_backed = 1, /* Does not contribute to dirty memory */
...@@ -38,7 +30,6 @@ struct address_space swapper_space = { ...@@ -38,7 +30,6 @@ struct address_space swapper_space = {
.dirty_pages = LIST_HEAD_INIT(swapper_space.dirty_pages), .dirty_pages = LIST_HEAD_INIT(swapper_space.dirty_pages),
.io_pages = LIST_HEAD_INIT(swapper_space.io_pages), .io_pages = LIST_HEAD_INIT(swapper_space.io_pages),
.locked_pages = LIST_HEAD_INIT(swapper_space.locked_pages), .locked_pages = LIST_HEAD_INIT(swapper_space.locked_pages),
.host = &swapper_inode,
.a_ops = &swap_aops, .a_ops = &swap_aops,
.backing_dev_info = &swap_backing_dev_info, .backing_dev_info = &swap_backing_dev_info,
.i_mmap = LIST_HEAD_INIT(swapper_space.i_mmap), .i_mmap = LIST_HEAD_INIT(swapper_space.i_mmap),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment