lkml.org 
[lkml]   [2013]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCHv2, RFC 03/30] mm: drop actor argument of do_generic_file_read()
    Date
    From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

    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>
    ---
    mm/filemap.c | 10 +++++-----
    1 file changed, 5 insertions(+), 5 deletions(-)

    diff --git a/mm/filemap.c b/mm/filemap.c
    index 4ebaf95..2d99191 100644
    --- a/mm/filemap.c
    +++ b/mm/filemap.c
    @@ -1075,7 +1075,6 @@ static void shrink_readahead_size_eio(struct file *filp,
    * @filp: the file to read
    * @ppos: current file position
    * @desc: read_descriptor
    - * @actor: read method
    *
    * This is a generic file read routine, and uses the
    * mapping->a_ops->readpage() function for the actual low-level stuff.
    @@ -1084,7 +1083,7 @@ static void shrink_readahead_size_eio(struct file *filp,
    * of the logic when it comes to error handling etc.
    */
    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 inode *inode = mapping->host;
    @@ -1185,13 +1184,14 @@ page_ok:
    * Ok, we have the page, and it's up-to-date, so
    * 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
    * we filled up (we may be padding etc), so we can only update
    * "pos" here (the actor routine has to update the user buffer
    * pointers and the remaining count).
    */
    - ret = actor(desc, page, offset, nr);
    + ret = file_read_actor(desc, page, offset, nr);
    offset += ret;
    index += offset >> PAGE_CACHE_SHIFT;
    offset &= ~PAGE_CACHE_MASK;
    @@ -1464,7 +1464,7 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
    if (desc.count == 0)
    continue;
    desc.error = 0;
    - do_generic_file_read(filp, ppos, &desc, file_read_actor);
    + do_generic_file_read(filp, ppos, &desc);
    retval += desc.written;
    if (desc.error) {
    retval = retval ?: desc.error;
    --
    1.7.10.4


    \
     
     \ /
      Last update: 2013-03-14 20:02    [W:6.509 / U:0.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site