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 <jens.axboe@oracle.com>

+8 -2
+8 -2
fs/splice.c
··· 811 812 ret = __splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); 813 if (ret > 0) { 814 *ppos += ret; 815 816 /* 817 * If file or inode is SYNC and we actually wrote some data, ··· 827 if (err) 828 ret = err; 829 } 830 - balance_dirty_pages_ratelimited(mapping); 831 } 832 833 return ret; ··· 866 867 ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); 868 if (ret > 0) { 869 *ppos += ret; 870 871 /* 872 * If file or inode is SYNC and we actually wrote some data, ··· 884 if (err) 885 ret = err; 886 } 887 - balance_dirty_pages_ratelimited(mapping); 888 } 889 890 return ret;
··· 811 812 ret = __splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); 813 if (ret > 0) { 814 + unsigned long nr_pages; 815 + 816 *ppos += ret; 817 + nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 818 819 /* 820 * If file or inode is SYNC and we actually wrote some data, ··· 824 if (err) 825 ret = err; 826 } 827 + balance_dirty_pages_ratelimited_nr(mapping, nr_pages); 828 } 829 830 return ret; ··· 863 864 ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); 865 if (ret > 0) { 866 + unsigned long nr_pages; 867 + 868 *ppos += ret; 869 + nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 870 871 /* 872 * If file or inode is SYNC and we actually wrote some data, ··· 878 if (err) 879 ret = err; 880 } 881 + balance_dirty_pages_ratelimited_nr(mapping, nr_pages); 882 } 883 884 return ret;