Commit 2927b748 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] tmpfs 2/6 remove shmem_readpage

From: Hugh Dickins <hugh@veritas.com>

shmem_readpage was created to give tmpfs sendfile and loop ability; but
they're both using shmem_file_sendfile now, so remove shmem_readpage.
parent acad2c18
...@@ -750,9 +750,9 @@ static int shmem_getpage(struct inode *inode, unsigned long idx, struct page **p ...@@ -750,9 +750,9 @@ static int shmem_getpage(struct inode *inode, unsigned long idx, struct page **p
* Normally, filepage is NULL on entry, and either found * Normally, filepage is NULL on entry, and either found
* uptodate immediately, or allocated and zeroed, or read * uptodate immediately, or allocated and zeroed, or read
* in under swappage, which is then assigned to filepage. * in under swappage, which is then assigned to filepage.
* But shmem_readpage and shmem_prepare_write pass in a locked * But shmem_prepare_write passes in a locked filepage,
* filepage, which may be found not uptodate by other callers * which may be found not uptodate by other callers too,
* too, and may need to be copied from the swappage read in. * and may need to be copied from the swappage read in.
*/ */
repeat: repeat:
if (!filepage) if (!filepage)
...@@ -1102,19 +1102,9 @@ static struct inode_operations shmem_symlink_inode_operations; ...@@ -1102,19 +1102,9 @@ static struct inode_operations shmem_symlink_inode_operations;
static struct inode_operations shmem_symlink_inline_operations; static struct inode_operations shmem_symlink_inline_operations;
/* /*
* tmpfs itself makes no use of generic_file_read, generic_file_mmap * Normally tmpfs makes no use of shmem_prepare_write, but it
* or generic_file_write; but shmem_readpage, shmem_prepare_write and * lets a tmpfs file be used read-write below the loop driver.
* simple_commit_write let a tmpfs file be used below the loop driver.
*/ */
static int
shmem_readpage(struct file *file, struct page *page)
{
struct inode *inode = page->mapping->host;
int error = shmem_getpage(inode, page->index, &page, SGP_CACHE);
unlock_page(page);
return error;
}
static int static int
shmem_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to) shmem_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to)
{ {
...@@ -1751,7 +1741,6 @@ static struct address_space_operations shmem_aops = { ...@@ -1751,7 +1741,6 @@ static struct address_space_operations shmem_aops = {
.writepage = shmem_writepage, .writepage = shmem_writepage,
.set_page_dirty = __set_page_dirty_nobuffers, .set_page_dirty = __set_page_dirty_nobuffers,
#ifdef CONFIG_TMPFS #ifdef CONFIG_TMPFS
.readpage = shmem_readpage,
.prepare_write = shmem_prepare_write, .prepare_write = shmem_prepare_write,
.commit_write = simple_commit_write, .commit_write = simple_commit_write,
#endif #endif
......
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