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