Commit b3e8feca authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] put in-memory filesystem dirty pages on the correct list

Replaces SetPageDirty() with set_page_dirty() in several places related
to in-memory filesystems.

SetPageDirty() is basically always the wrong thing to do.  Pages should
be moved to the ->dirty_pages list when dirtied so that writeback can
see them.

Without this change, dirty pages against in-memory filesystems would
churn around on the inactive list all the time, rather than getting
pushed away onto the active list.  A minor efficiency thing.
parent c83686ac
...@@ -450,7 +450,7 @@ int fail_writepage(struct page *page) ...@@ -450,7 +450,7 @@ int fail_writepage(struct page *page)
} }
/* Set the page dirty again, unlock */ /* Set the page dirty again, unlock */
SetPageDirty(page); set_page_dirty(page);
unlock_page(page); unlock_page(page);
return 0; return 0;
} }
......
...@@ -854,7 +854,7 @@ shmem_file_write(struct file *file,const char *buf,size_t count,loff_t *ppos) ...@@ -854,7 +854,7 @@ shmem_file_write(struct file *file,const char *buf,size_t count,loff_t *ppos)
flush_dcache_page(page); flush_dcache_page(page);
if (bytes > 0) { if (bytes > 0) {
SetPageDirty(page); set_page_dirty(page);
written += bytes; written += bytes;
count -= bytes; count -= bytes;
pos += bytes; pos += bytes;
...@@ -1139,7 +1139,7 @@ static int shmem_symlink(struct inode * dir, struct dentry *dentry, const char * ...@@ -1139,7 +1139,7 @@ static int shmem_symlink(struct inode * dir, struct dentry *dentry, const char *
kaddr = kmap(page); kaddr = kmap(page);
memcpy(kaddr, symname, len); memcpy(kaddr, symname, len);
kunmap(page); kunmap(page);
SetPageDirty(page); set_page_dirty(page);
unlock_page(page); unlock_page(page);
page_cache_release(page); page_cache_release(page);
up(&info->sem); up(&info->sem);
......
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