1
0
Fork 0

mm: drop actor argument of do_generic_file_read()

There's only one caller of do_generic_file_read() and the only actor is
file_read_actor().  No reason to have a callback parameter.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Matthew Wilcox <willy@linux.intel.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
hifive-unleashed-5.1
Kirill A. Shutemov 2013-11-14 14:30:40 -08:00 committed by Linus Torvalds
parent a0dce7f0ac
commit b77d88d493
1 changed files with 5 additions and 5 deletions

View File

@ -1090,7 +1090,6 @@ static void shrink_readahead_size_eio(struct file *filp,
* @filp: the file to read * @filp: the file to read
* @ppos: current file position * @ppos: current file position
* @desc: read_descriptor * @desc: read_descriptor
* @actor: read method
* *
* This is a generic file read routine, and uses the * This is a generic file read routine, and uses the
* mapping->a_ops->readpage() function for the actual low-level stuff. * mapping->a_ops->readpage() function for the actual low-level stuff.
@ -1099,7 +1098,7 @@ static void shrink_readahead_size_eio(struct file *filp,
* of the logic when it comes to error handling etc. * of the logic when it comes to error handling etc.
*/ */
static void do_generic_file_read(struct file *filp, loff_t *ppos, static void do_generic_file_read(struct file *filp, loff_t *ppos,
read_descriptor_t *desc, read_actor_t actor) read_descriptor_t *desc)
{ {
struct address_space *mapping = filp->f_mapping; struct address_space *mapping = filp->f_mapping;
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
@ -1200,13 +1199,14 @@ page_ok:
* Ok, we have the page, and it's up-to-date, so * Ok, we have the page, and it's up-to-date, so
* now we can copy it to user space... * now we can copy it to user space...
* *
* The actor routine returns how many bytes were actually used.. * The file_read_actor routine returns how many bytes were
* actually used..
* NOTE! This may not be the same as how much of a user buffer * NOTE! This may not be the same as how much of a user buffer
* we filled up (we may be padding etc), so we can only update * we filled up (we may be padding etc), so we can only update
* "pos" here (the actor routine has to update the user buffer * "pos" here (the actor routine has to update the user buffer
* pointers and the remaining count). * pointers and the remaining count).
*/ */
ret = actor(desc, page, offset, nr); ret = file_read_actor(desc, page, offset, nr);
offset += ret; offset += ret;
index += offset >> PAGE_CACHE_SHIFT; index += offset >> PAGE_CACHE_SHIFT;
offset &= ~PAGE_CACHE_MASK; offset &= ~PAGE_CACHE_MASK;
@ -1479,7 +1479,7 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
if (desc.count == 0) if (desc.count == 0)
continue; continue;
desc.error = 0; desc.error = 0;
do_generic_file_read(filp, ppos, &desc, file_read_actor); do_generic_file_read(filp, ppos, &desc);
retval += desc.written; retval += desc.written;
if (desc.error) { if (desc.error) {
retval = retval ?: desc.error; retval = retval ?: desc.error;