Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=17ee4f49ab2c802c7818fa71c4e7e351a7230b86
Commit:     17ee4f49ab2c802c7818fa71c4e7e351a7230b86
Parent:     22b1a9203ea634ac0ee5240e021613da3328275f
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 15 13:10:37 2007 +0200
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Fri Jun 15 13:10:37 2007 +0200

    splice: adjust balance_dirty_pages_ratelimited() call
    
    As we have potentially dirtied more than 1 page, we should indicate as
    such to the dirty page balancing. So call
    balance_dirty_pages_ratelimited_nr() and pass in the approximate number
    of pages we dirtied.
    
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 fs/splice.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/fs/splice.c b/fs/splice.c
index cb21136..12d247f 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -811,7 +811,10 @@ generic_file_splice_write_nolock(struct pipe_inode_info 
*pipe, struct file *out,
 
        ret = __splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);
        if (ret > 0) {
+               unsigned long nr_pages;
+
                *ppos += ret;
+               nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 
                /*
                 * If file or inode is SYNC and we actually wrote some data,
@@ -824,7 +827,7 @@ generic_file_splice_write_nolock(struct pipe_inode_info 
*pipe, struct file *out,
                        if (err)
                                ret = err;
                }
-               balance_dirty_pages_ratelimited(mapping);
+               balance_dirty_pages_ratelimited_nr(mapping, nr_pages);
        }
 
        return ret;
@@ -863,7 +866,10 @@ generic_file_splice_write(struct pipe_inode_info *pipe, 
struct file *out,
 
        ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);
        if (ret > 0) {
+               unsigned long nr_pages;
+
                *ppos += ret;
+               nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 
                /*
                 * If file or inode is SYNC and we actually wrote some data,
@@ -878,7 +884,7 @@ generic_file_splice_write(struct pipe_inode_info *pipe, 
struct file *out,
                        if (err)
                                ret = err;
                }
-               balance_dirty_pages_ratelimited(mapping);
+               balance_dirty_pages_ratelimited_nr(mapping, nr_pages);
        }
 
        return ret;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to