diff options
author | Jens Axboe <axboe@suse.de> | 2006-04-11 08:57:50 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-04-11 09:47:07 -0400 |
commit | cbb7e577e732f576b9f399bc2600bdc0626c68dc (patch) | |
tree | 55e3d65c9d9fb5b0ee25d0ccabf951de6da2db7b /fs | |
parent | 2514395ef88b46e895726a8d40966cb83de7940c (diff) |
[PATCH] splice: pass offset around for ->splice_read() and ->splice_write()
We need not use ->f_pos as the offset for the file input/output. If the
user passed an offset pointer in through sys_splice(), just use that and
leave ->f_pos alone.
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/splice.c | 86 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 12 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 14 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.h | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 12 |
5 files changed, 68 insertions, 60 deletions
diff --git a/fs/splice.c b/fs/splice.c index e50a460239dd..5d3eda64703b 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -231,8 +231,9 @@ static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages, | |||
231 | } | 231 | } |
232 | 232 | ||
233 | static int | 233 | static int |
234 | __generic_file_splice_read(struct file *in, struct pipe_inode_info *pipe, | 234 | __generic_file_splice_read(struct file *in, loff_t *ppos, |
235 | size_t len, unsigned int flags) | 235 | struct pipe_inode_info *pipe, size_t len, |
236 | unsigned int flags) | ||
236 | { | 237 | { |
237 | struct address_space *mapping = in->f_mapping; | 238 | struct address_space *mapping = in->f_mapping; |
238 | unsigned int offset, nr_pages; | 239 | unsigned int offset, nr_pages; |
@@ -241,8 +242,8 @@ __generic_file_splice_read(struct file *in, struct pipe_inode_info *pipe, | |||
241 | pgoff_t index; | 242 | pgoff_t index; |
242 | int i, error; | 243 | int i, error; |
243 | 244 | ||
244 | index = in->f_pos >> PAGE_CACHE_SHIFT; | 245 | index = *ppos >> PAGE_CACHE_SHIFT; |
245 | offset = in->f_pos & ~PAGE_CACHE_MASK; | 246 | offset = *ppos & ~PAGE_CACHE_MASK; |
246 | nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 247 | nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; |
247 | 248 | ||
248 | if (nr_pages > PIPE_BUFFERS) | 249 | if (nr_pages > PIPE_BUFFERS) |
@@ -348,8 +349,9 @@ fill_it: | |||
348 | * | 349 | * |
349 | * Will read pages from given file and fill them into a pipe. | 350 | * Will read pages from given file and fill them into a pipe. |
350 | */ | 351 | */ |
351 | ssize_t generic_file_splice_read(struct file *in, struct pipe_inode_info *pipe, | 352 | ssize_t generic_file_splice_read(struct file *in, loff_t *ppos, |
352 | size_t len, unsigned int flags) | 353 | struct pipe_inode_info *pipe, size_t len, |
354 | unsigned int flags) | ||
353 | { | 355 | { |
354 | ssize_t spliced; | 356 | ssize_t spliced; |
355 | int ret; | 357 | int ret; |
@@ -358,12 +360,12 @@ ssize_t generic_file_splice_read(struct file *in, struct pipe_inode_info *pipe, | |||
358 | spliced = 0; | 360 | spliced = 0; |
359 | 361 | ||
360 | while (len) { | 362 | while (len) { |
361 | ret = __generic_file_splice_read(in, pipe, len, flags); | 363 | ret = __generic_file_splice_read(in, ppos, pipe, len, flags); |
362 | 364 | ||
363 | if (ret <= 0) | 365 | if (ret <= 0) |
364 | break; | 366 | break; |
365 | 367 | ||
366 | in->f_pos += ret; | 368 | *ppos += ret; |
367 | len -= ret; | 369 | len -= ret; |
368 | spliced += ret; | 370 | spliced += ret; |
369 | 371 | ||
@@ -561,7 +563,7 @@ typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, | |||
561 | * to the wanted destination. See pipe_to_file/pipe_to_sendpage above. | 563 | * to the wanted destination. See pipe_to_file/pipe_to_sendpage above. |
562 | */ | 564 | */ |
563 | static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out, | 565 | static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out, |
564 | size_t len, unsigned int flags, | 566 | loff_t *ppos, size_t len, unsigned int flags, |
565 | splice_actor *actor) | 567 | splice_actor *actor) |
566 | { | 568 | { |
567 | int ret, do_wakeup, err; | 569 | int ret, do_wakeup, err; |
@@ -573,7 +575,7 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out, | |||
573 | sd.total_len = len; | 575 | sd.total_len = len; |
574 | sd.flags = flags; | 576 | sd.flags = flags; |
575 | sd.file = out; | 577 | sd.file = out; |
576 | sd.pos = out->f_pos; | 578 | sd.pos = *ppos; |
577 | 579 | ||
578 | if (pipe->inode) | 580 | if (pipe->inode) |
579 | mutex_lock(&pipe->inode->i_mutex); | 581 | mutex_lock(&pipe->inode->i_mutex); |
@@ -656,9 +658,7 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out, | |||
656 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); | 658 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); |
657 | } | 659 | } |
658 | 660 | ||
659 | out->f_pos = sd.pos; | ||
660 | return ret; | 661 | return ret; |
661 | |||
662 | } | 662 | } |
663 | 663 | ||
664 | /** | 664 | /** |
@@ -674,12 +674,12 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out, | |||
674 | */ | 674 | */ |
675 | ssize_t | 675 | ssize_t |
676 | generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, | 676 | generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, |
677 | size_t len, unsigned int flags) | 677 | loff_t *ppos, size_t len, unsigned int flags) |
678 | { | 678 | { |
679 | struct address_space *mapping = out->f_mapping; | 679 | struct address_space *mapping = out->f_mapping; |
680 | ssize_t ret; | 680 | ssize_t ret; |
681 | 681 | ||
682 | ret = move_from_pipe(pipe, out, len, flags, pipe_to_file); | 682 | ret = move_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); |
683 | 683 | ||
684 | /* | 684 | /* |
685 | * If file or inode is SYNC and we actually wrote some data, sync it. | 685 | * If file or inode is SYNC and we actually wrote some data, sync it. |
@@ -715,9 +715,9 @@ EXPORT_SYMBOL(generic_file_splice_write); | |||
715 | * | 715 | * |
716 | */ | 716 | */ |
717 | ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, struct file *out, | 717 | ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, struct file *out, |
718 | size_t len, unsigned int flags) | 718 | loff_t *ppos, size_t len, unsigned int flags) |
719 | { | 719 | { |
720 | return move_from_pipe(pipe, out, len, flags, pipe_to_sendpage); | 720 | return move_from_pipe(pipe, out, ppos, len, flags, pipe_to_sendpage); |
721 | } | 721 | } |
722 | 722 | ||
723 | EXPORT_SYMBOL(generic_splice_sendpage); | 723 | EXPORT_SYMBOL(generic_splice_sendpage); |
@@ -726,9 +726,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); | |||
726 | * Attempt to initiate a splice from pipe to file. | 726 | * Attempt to initiate a splice from pipe to file. |
727 | */ | 727 | */ |
728 | static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, | 728 | static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, |
729 | size_t len, unsigned int flags) | 729 | loff_t *ppos, size_t len, unsigned int flags) |
730 | { | 730 | { |
731 | loff_t pos; | ||
732 | int ret; | 731 | int ret; |
733 | 732 | ||
734 | if (unlikely(!out->f_op || !out->f_op->splice_write)) | 733 | if (unlikely(!out->f_op || !out->f_op->splice_write)) |
@@ -737,22 +736,21 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, | |||
737 | if (unlikely(!(out->f_mode & FMODE_WRITE))) | 736 | if (unlikely(!(out->f_mode & FMODE_WRITE))) |
738 | return -EBADF; | 737 | return -EBADF; |
739 | 738 | ||
740 | pos = out->f_pos; | 739 | ret = rw_verify_area(WRITE, out, ppos, len); |
741 | |||
742 | ret = rw_verify_area(WRITE, out, &pos, len); | ||
743 | if (unlikely(ret < 0)) | 740 | if (unlikely(ret < 0)) |
744 | return ret; | 741 | return ret; |
745 | 742 | ||
746 | return out->f_op->splice_write(pipe, out, len, flags); | 743 | return out->f_op->splice_write(pipe, out, ppos, len, flags); |
747 | } | 744 | } |
748 | 745 | ||
749 | /* | 746 | /* |
750 | * Attempt to initiate a splice from a file to a pipe. | 747 | * Attempt to initiate a splice from a file to a pipe. |
751 | */ | 748 | */ |
752 | static long do_splice_to(struct file *in, struct pipe_inode_info *pipe, | 749 | static long do_splice_to(struct file *in, loff_t *ppos, |
753 | size_t len, unsigned int flags) | 750 | struct pipe_inode_info *pipe, size_t len, |
751 | unsigned int flags) | ||
754 | { | 752 | { |
755 | loff_t pos, isize, left; | 753 | loff_t isize, left; |
756 | int ret; | 754 | int ret; |
757 | 755 | ||
758 | if (unlikely(!in->f_op || !in->f_op->splice_read)) | 756 | if (unlikely(!in->f_op || !in->f_op->splice_read)) |
@@ -761,28 +759,27 @@ static long do_splice_to(struct file *in, struct pipe_inode_info *pipe, | |||
761 | if (unlikely(!(in->f_mode & FMODE_READ))) | 759 | if (unlikely(!(in->f_mode & FMODE_READ))) |
762 | return -EBADF; | 760 | return -EBADF; |
763 | 761 | ||
764 | pos = in->f_pos; | 762 | ret = rw_verify_area(READ, in, ppos, len); |
765 | |||
766 | ret = rw_verify_area(READ, in, &pos, len); | ||
767 | if (unlikely(ret < 0)) | 763 | if (unlikely(ret < 0)) |
768 | return ret; | 764 | return ret; |
769 | 765 | ||
770 | isize = i_size_read(in->f_mapping->host); | 766 | isize = i_size_read(in->f_mapping->host); |
771 | if (unlikely(in->f_pos >= isize)) | 767 | if (unlikely(*ppos >= isize)) |
772 | return 0; | 768 | return 0; |
773 | 769 | ||
774 | left = isize - in->f_pos; | 770 | left = isize - *ppos; |
775 | if (unlikely(left < len)) | 771 | if (unlikely(left < len)) |
776 | len = left; | 772 | len = left; |
777 | 773 | ||
778 | return in->f_op->splice_read(in, pipe, len, flags); | 774 | return in->f_op->splice_read(in, ppos, pipe, len, flags); |
779 | } | 775 | } |
780 | 776 | ||
781 | long do_splice_direct(struct file *in, struct file *out, size_t len, | 777 | long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, |
782 | unsigned int flags) | 778 | size_t len, unsigned int flags) |
783 | { | 779 | { |
784 | struct pipe_inode_info *pipe; | 780 | struct pipe_inode_info *pipe; |
785 | long ret, bytes; | 781 | long ret, bytes; |
782 | loff_t out_off; | ||
786 | umode_t i_mode; | 783 | umode_t i_mode; |
787 | int i; | 784 | int i; |
788 | 785 | ||
@@ -820,6 +817,7 @@ long do_splice_direct(struct file *in, struct file *out, size_t len, | |||
820 | */ | 817 | */ |
821 | ret = 0; | 818 | ret = 0; |
822 | bytes = 0; | 819 | bytes = 0; |
820 | out_off = 0; | ||
823 | 821 | ||
824 | while (len) { | 822 | while (len) { |
825 | size_t read_len, max_read_len; | 823 | size_t read_len, max_read_len; |
@@ -829,7 +827,7 @@ long do_splice_direct(struct file *in, struct file *out, size_t len, | |||
829 | */ | 827 | */ |
830 | max_read_len = min(len, (size_t)(PIPE_BUFFERS*PAGE_SIZE)); | 828 | max_read_len = min(len, (size_t)(PIPE_BUFFERS*PAGE_SIZE)); |
831 | 829 | ||
832 | ret = do_splice_to(in, pipe, max_read_len, flags); | 830 | ret = do_splice_to(in, ppos, pipe, max_read_len, flags); |
833 | if (unlikely(ret < 0)) | 831 | if (unlikely(ret < 0)) |
834 | goto out_release; | 832 | goto out_release; |
835 | 833 | ||
@@ -840,7 +838,7 @@ long do_splice_direct(struct file *in, struct file *out, size_t len, | |||
840 | * must not do the output in nonblocking mode as then we | 838 | * must not do the output in nonblocking mode as then we |
841 | * could get stuck data in the internal pipe: | 839 | * could get stuck data in the internal pipe: |
842 | */ | 840 | */ |
843 | ret = do_splice_from(pipe, out, read_len, | 841 | ret = do_splice_from(pipe, out, &out_off, read_len, |
844 | flags & ~SPLICE_F_NONBLOCK); | 842 | flags & ~SPLICE_F_NONBLOCK); |
845 | if (unlikely(ret < 0)) | 843 | if (unlikely(ret < 0)) |
846 | goto out_release; | 844 | goto out_release; |
@@ -898,6 +896,7 @@ static long do_splice(struct file *in, loff_t __user *off_in, | |||
898 | size_t len, unsigned int flags) | 896 | size_t len, unsigned int flags) |
899 | { | 897 | { |
900 | struct pipe_inode_info *pipe; | 898 | struct pipe_inode_info *pipe; |
899 | loff_t offset, *off; | ||
901 | 900 | ||
902 | pipe = in->f_dentry->d_inode->i_pipe; | 901 | pipe = in->f_dentry->d_inode->i_pipe; |
903 | if (pipe) { | 902 | if (pipe) { |
@@ -906,12 +905,13 @@ static long do_splice(struct file *in, loff_t __user *off_in, | |||
906 | if (off_out) { | 905 | if (off_out) { |
907 | if (out->f_op->llseek == no_llseek) | 906 | if (out->f_op->llseek == no_llseek) |
908 | return -EINVAL; | 907 | return -EINVAL; |
909 | if (copy_from_user(&out->f_pos, off_out, | 908 | if (copy_from_user(&offset, off_out, sizeof(loff_t))) |
910 | sizeof(loff_t))) | ||
911 | return -EFAULT; | 909 | return -EFAULT; |
912 | } | 910 | off = &offset; |
911 | } else | ||
912 | off = &out->f_pos; | ||
913 | 913 | ||
914 | return do_splice_from(pipe, out, len, flags); | 914 | return do_splice_from(pipe, out, off, len, flags); |
915 | } | 915 | } |
916 | 916 | ||
917 | pipe = out->f_dentry->d_inode->i_pipe; | 917 | pipe = out->f_dentry->d_inode->i_pipe; |
@@ -921,11 +921,13 @@ static long do_splice(struct file *in, loff_t __user *off_in, | |||
921 | if (off_in) { | 921 | if (off_in) { |
922 | if (in->f_op->llseek == no_llseek) | 922 | if (in->f_op->llseek == no_llseek) |
923 | return -EINVAL; | 923 | return -EINVAL; |
924 | if (copy_from_user(&in->f_pos, off_in, sizeof(loff_t))) | 924 | if (copy_from_user(&offset, off_in, sizeof(loff_t))) |
925 | return -EFAULT; | 925 | return -EFAULT; |
926 | } | 926 | off = &offset; |
927 | } else | ||
928 | off = &in->f_pos; | ||
927 | 929 | ||
928 | return do_splice_to(in, pipe, len, flags); | 930 | return do_splice_to(in, off, pipe, len, flags); |
929 | } | 931 | } |
930 | 932 | ||
931 | return -EINVAL; | 933 | return -EINVAL; |
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 269721af02f3..c847416f6d10 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -252,6 +252,7 @@ xfs_file_sendfile_invis( | |||
252 | STATIC ssize_t | 252 | STATIC ssize_t |
253 | xfs_file_splice_read( | 253 | xfs_file_splice_read( |
254 | struct file *infilp, | 254 | struct file *infilp, |
255 | loff_t *ppos, | ||
255 | struct pipe_inode_info *pipe, | 256 | struct pipe_inode_info *pipe, |
256 | size_t len, | 257 | size_t len, |
257 | unsigned int flags) | 258 | unsigned int flags) |
@@ -259,13 +260,14 @@ xfs_file_splice_read( | |||
259 | vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); | 260 | vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); |
260 | ssize_t rval; | 261 | ssize_t rval; |
261 | 262 | ||
262 | VOP_SPLICE_READ(vp, infilp, pipe, len, flags, 0, NULL, rval); | 263 | VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, 0, NULL, rval); |
263 | return rval; | 264 | return rval; |
264 | } | 265 | } |
265 | 266 | ||
266 | STATIC ssize_t | 267 | STATIC ssize_t |
267 | xfs_file_splice_read_invis( | 268 | xfs_file_splice_read_invis( |
268 | struct file *infilp, | 269 | struct file *infilp, |
270 | loff_t *ppos, | ||
269 | struct pipe_inode_info *pipe, | 271 | struct pipe_inode_info *pipe, |
270 | size_t len, | 272 | size_t len, |
271 | unsigned int flags) | 273 | unsigned int flags) |
@@ -273,7 +275,7 @@ xfs_file_splice_read_invis( | |||
273 | vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); | 275 | vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); |
274 | ssize_t rval; | 276 | ssize_t rval; |
275 | 277 | ||
276 | VOP_SPLICE_READ(vp, infilp, pipe, len, flags, IO_INVIS, NULL, rval); | 278 | VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, IO_INVIS, NULL, rval); |
277 | return rval; | 279 | return rval; |
278 | } | 280 | } |
279 | 281 | ||
@@ -281,13 +283,14 @@ STATIC ssize_t | |||
281 | xfs_file_splice_write( | 283 | xfs_file_splice_write( |
282 | struct pipe_inode_info *pipe, | 284 | struct pipe_inode_info *pipe, |
283 | struct file *outfilp, | 285 | struct file *outfilp, |
286 | loff_t *ppos, | ||
284 | size_t len, | 287 | size_t len, |
285 | unsigned int flags) | 288 | unsigned int flags) |
286 | { | 289 | { |
287 | vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); | 290 | vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); |
288 | ssize_t rval; | 291 | ssize_t rval; |
289 | 292 | ||
290 | VOP_SPLICE_WRITE(vp, pipe, outfilp, len, flags, 0, NULL, rval); | 293 | VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, 0, NULL, rval); |
291 | return rval; | 294 | return rval; |
292 | } | 295 | } |
293 | 296 | ||
@@ -295,13 +298,14 @@ STATIC ssize_t | |||
295 | xfs_file_splice_write_invis( | 298 | xfs_file_splice_write_invis( |
296 | struct pipe_inode_info *pipe, | 299 | struct pipe_inode_info *pipe, |
297 | struct file *outfilp, | 300 | struct file *outfilp, |
301 | loff_t *ppos, | ||
298 | size_t len, | 302 | size_t len, |
299 | unsigned int flags) | 303 | unsigned int flags) |
300 | { | 304 | { |
301 | vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); | 305 | vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); |
302 | ssize_t rval; | 306 | ssize_t rval; |
303 | 307 | ||
304 | VOP_SPLICE_WRITE(vp, pipe, outfilp, len, flags, IO_INVIS, NULL, rval); | 308 | VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, IO_INVIS, NULL, rval); |
305 | return rval; | 309 | return rval; |
306 | } | 310 | } |
307 | 311 | ||
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 74a52937f208..67efe3308980 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -338,6 +338,7 @@ ssize_t | |||
338 | xfs_splice_read( | 338 | xfs_splice_read( |
339 | bhv_desc_t *bdp, | 339 | bhv_desc_t *bdp, |
340 | struct file *infilp, | 340 | struct file *infilp, |
341 | loff_t *ppos, | ||
341 | struct pipe_inode_info *pipe, | 342 | struct pipe_inode_info *pipe, |
342 | size_t count, | 343 | size_t count, |
343 | int flags, | 344 | int flags, |
@@ -360,7 +361,7 @@ xfs_splice_read( | |||
360 | int error; | 361 | int error; |
361 | 362 | ||
362 | error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp), | 363 | error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp), |
363 | infilp->f_pos, count, | 364 | *ppos, count, |
364 | FILP_DELAY_FLAG(infilp), &locktype); | 365 | FILP_DELAY_FLAG(infilp), &locktype); |
365 | if (error) { | 366 | if (error) { |
366 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); | 367 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); |
@@ -368,8 +369,8 @@ xfs_splice_read( | |||
368 | } | 369 | } |
369 | } | 370 | } |
370 | xfs_rw_enter_trace(XFS_SPLICE_READ_ENTER, &ip->i_iocore, | 371 | xfs_rw_enter_trace(XFS_SPLICE_READ_ENTER, &ip->i_iocore, |
371 | pipe, count, infilp->f_pos, ioflags); | 372 | pipe, count, *ppos, ioflags); |
372 | ret = generic_file_splice_read(infilp, pipe, count, flags); | 373 | ret = generic_file_splice_read(infilp, ppos, pipe, count, flags); |
373 | if (ret > 0) | 374 | if (ret > 0) |
374 | XFS_STATS_ADD(xs_read_bytes, ret); | 375 | XFS_STATS_ADD(xs_read_bytes, ret); |
375 | 376 | ||
@@ -382,6 +383,7 @@ xfs_splice_write( | |||
382 | bhv_desc_t *bdp, | 383 | bhv_desc_t *bdp, |
383 | struct pipe_inode_info *pipe, | 384 | struct pipe_inode_info *pipe, |
384 | struct file *outfilp, | 385 | struct file *outfilp, |
386 | loff_t *ppos, | ||
385 | size_t count, | 387 | size_t count, |
386 | int flags, | 388 | int flags, |
387 | int ioflags, | 389 | int ioflags, |
@@ -403,7 +405,7 @@ xfs_splice_write( | |||
403 | int error; | 405 | int error; |
404 | 406 | ||
405 | error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, BHV_TO_VNODE(bdp), | 407 | error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, BHV_TO_VNODE(bdp), |
406 | outfilp->f_pos, count, | 408 | *ppos, count, |
407 | FILP_DELAY_FLAG(outfilp), &locktype); | 409 | FILP_DELAY_FLAG(outfilp), &locktype); |
408 | if (error) { | 410 | if (error) { |
409 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | 411 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); |
@@ -411,8 +413,8 @@ xfs_splice_write( | |||
411 | } | 413 | } |
412 | } | 414 | } |
413 | xfs_rw_enter_trace(XFS_SPLICE_WRITE_ENTER, &ip->i_iocore, | 415 | xfs_rw_enter_trace(XFS_SPLICE_WRITE_ENTER, &ip->i_iocore, |
414 | pipe, count, outfilp->f_pos, ioflags); | 416 | pipe, count, *ppos, ioflags); |
415 | ret = generic_file_splice_write(pipe, outfilp, count, flags); | 417 | ret = generic_file_splice_write(pipe, outfilp, ppos, count, flags); |
416 | if (ret > 0) | 418 | if (ret > 0) |
417 | XFS_STATS_ADD(xs_write_bytes, ret); | 419 | XFS_STATS_ADD(xs_write_bytes, ret); |
418 | 420 | ||
diff --git a/fs/xfs/linux-2.6/xfs_lrw.h b/fs/xfs/linux-2.6/xfs_lrw.h index 55c689a86ad2..8f4539952350 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.h +++ b/fs/xfs/linux-2.6/xfs_lrw.h | |||
@@ -93,11 +93,11 @@ extern ssize_t xfs_write(struct bhv_desc *, struct kiocb *, | |||
93 | extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *, | 93 | extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *, |
94 | loff_t *, int, size_t, read_actor_t, | 94 | loff_t *, int, size_t, read_actor_t, |
95 | void *, struct cred *); | 95 | void *, struct cred *); |
96 | extern ssize_t xfs_splice_read(struct bhv_desc *, struct file *, | 96 | extern ssize_t xfs_splice_read(struct bhv_desc *, struct file *, loff_t *, |
97 | struct pipe_inode_info *, size_t, int, int, | 97 | struct pipe_inode_info *, size_t, int, int, |
98 | struct cred *); | 98 | struct cred *); |
99 | extern ssize_t xfs_splice_write(struct bhv_desc *, struct pipe_inode_info *, | 99 | extern ssize_t xfs_splice_write(struct bhv_desc *, struct pipe_inode_info *, |
100 | struct file *, size_t, int, int, | 100 | struct file *, loff_t *, size_t, int, int, |
101 | struct cred *); | 101 | struct cred *); |
102 | 102 | ||
103 | #endif /* __XFS_LRW_H__ */ | 103 | #endif /* __XFS_LRW_H__ */ |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 88b09f186289..2a8e16c22353 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -173,11 +173,11 @@ typedef ssize_t (*vop_write_t)(bhv_desc_t *, struct kiocb *, | |||
173 | typedef ssize_t (*vop_sendfile_t)(bhv_desc_t *, struct file *, | 173 | typedef ssize_t (*vop_sendfile_t)(bhv_desc_t *, struct file *, |
174 | loff_t *, int, size_t, read_actor_t, | 174 | loff_t *, int, size_t, read_actor_t, |
175 | void *, struct cred *); | 175 | void *, struct cred *); |
176 | typedef ssize_t (*vop_splice_read_t)(bhv_desc_t *, struct file *, | 176 | typedef ssize_t (*vop_splice_read_t)(bhv_desc_t *, struct file *, loff_t *, |
177 | struct pipe_inode_info *, size_t, int, int, | 177 | struct pipe_inode_info *, size_t, int, int, |
178 | struct cred *); | 178 | struct cred *); |
179 | typedef ssize_t (*vop_splice_write_t)(bhv_desc_t *, struct pipe_inode_info *, | 179 | typedef ssize_t (*vop_splice_write_t)(bhv_desc_t *, struct pipe_inode_info *, |
180 | struct file *, size_t, int, int, | 180 | struct file *, loff_t *, size_t, int, int, |
181 | struct cred *); | 181 | struct cred *); |
182 | typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *, | 182 | typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *, |
183 | int, unsigned int, void __user *); | 183 | int, unsigned int, void __user *); |
@@ -284,10 +284,10 @@ typedef struct vnodeops { | |||
284 | rv = _VOP_(vop_write, vp)((vp)->v_fbhv,file,iov,segs,offset,ioflags,cr) | 284 | rv = _VOP_(vop_write, vp)((vp)->v_fbhv,file,iov,segs,offset,ioflags,cr) |
285 | #define VOP_SENDFILE(vp,f,off,ioflags,cnt,act,targ,cr,rv) \ | 285 | #define VOP_SENDFILE(vp,f,off,ioflags,cnt,act,targ,cr,rv) \ |
286 | rv = _VOP_(vop_sendfile, vp)((vp)->v_fbhv,f,off,ioflags,cnt,act,targ,cr) | 286 | rv = _VOP_(vop_sendfile, vp)((vp)->v_fbhv,f,off,ioflags,cnt,act,targ,cr) |
287 | #define VOP_SPLICE_READ(vp,f,pipe,cnt,fl,iofl,cr,rv) \ | 287 | #define VOP_SPLICE_READ(vp,f,o,pipe,cnt,fl,iofl,cr,rv) \ |
288 | rv = _VOP_(vop_splice_read, vp)((vp)->v_fbhv,f,pipe,cnt,fl,iofl,cr) | 288 | rv = _VOP_(vop_splice_read, vp)((vp)->v_fbhv,f,o,pipe,cnt,fl,iofl,cr) |
289 | #define VOP_SPLICE_WRITE(vp,f,pipe,cnt,fl,iofl,cr,rv) \ | 289 | #define VOP_SPLICE_WRITE(vp,f,o,pipe,cnt,fl,iofl,cr,rv) \ |
290 | rv = _VOP_(vop_splice_write, vp)((vp)->v_fbhv,f,pipe,cnt,fl,iofl,cr) | 290 | rv = _VOP_(vop_splice_write, vp)((vp)->v_fbhv,f,o,pipe,cnt,fl,iofl,cr) |
291 | #define VOP_BMAP(vp,of,sz,rw,b,n,rv) \ | 291 | #define VOP_BMAP(vp,of,sz,rw,b,n,rv) \ |
292 | rv = _VOP_(vop_bmap, vp)((vp)->v_fbhv,of,sz,rw,b,n) | 292 | rv = _VOP_(vop_bmap, vp)((vp)->v_fbhv,of,sz,rw,b,n) |
293 | #define VOP_OPEN(vp, cr, rv) \ | 293 | #define VOP_OPEN(vp, cr, rv) \ |