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)
{
struct super_block *sb = inode->i_sb;
if (!sb)
return; /* swapper_space */
/*
* Don't do this for I_DIRTY_PAGES - that doesn't actually
* dirty the inode itself
......@@ -90,9 +87,12 @@ void __mark_inode_dirty(struct inode *inode, int flags)
* Only add valid (hashed) inodes to the superblock's
* dirty list. Add blockdev inodes as well.
*/
if ((hlist_unhashed(&inode->i_hash) || (inode->i_state & (I_FREEING|I_CLEAR)))
&& !S_ISBLK(inode->i_mode))
goto out;
if (!S_ISBLK(inode->i_mode)) {
if (hlist_unhashed(&inode->i_hash))
goto out;
if (inode->i_state & (I_FREEING|I_CLEAR))
goto out;
}
/*
* 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)
list_add(&page->list, &mapping->dirty_pages);
}
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;
......
......@@ -16,14 +16,6 @@
#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 = {
.ra_pages = 0, /* No readahead */
.memory_backed = 1, /* Does not contribute to dirty memory */
......@@ -38,7 +30,6 @@ struct address_space swapper_space = {
.dirty_pages = LIST_HEAD_INIT(swapper_space.dirty_pages),
.io_pages = LIST_HEAD_INIT(swapper_space.io_pages),
.locked_pages = LIST_HEAD_INIT(swapper_space.locked_pages),
.host = &swapper_inode,
.a_ops = &swap_aops,
.backing_dev_info = &swap_backing_dev_info,
.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