diff options
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index 2527cf035b0e..507ddff48a9a 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -724,8 +724,7 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, | |||
724 | in_inode = in_file->f_path.dentry->d_inode; | 724 | in_inode = in_file->f_path.dentry->d_inode; |
725 | if (!in_inode) | 725 | if (!in_inode) |
726 | goto fput_in; | 726 | goto fput_in; |
727 | if (!in_file->f_op || (!in_file->f_op->sendfile && | 727 | if (!in_file->f_op || !in_file->f_op->splice_read) |
728 | !in_file->f_op->splice_read)) | ||
729 | goto fput_in; | 728 | goto fput_in; |
730 | retval = -ESPIPE; | 729 | retval = -ESPIPE; |
731 | if (!ppos) | 730 | if (!ppos) |
@@ -778,21 +777,18 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, | |||
778 | count = max - pos; | 777 | count = max - pos; |
779 | } | 778 | } |
780 | 779 | ||
781 | if (in_file->f_op->splice_read) { | 780 | fl = 0; |
782 | fl = 0; | ||
783 | #if 0 | 781 | #if 0 |
784 | /* | 782 | /* |
785 | * We need to debate whether we can enable this or not. The | 783 | * We need to debate whether we can enable this or not. The |
786 | * man page documents EAGAIN return for the output at least, | 784 | * man page documents EAGAIN return for the output at least, |
787 | * and the application is arguably buggy if it doesn't expect | 785 | * and the application is arguably buggy if it doesn't expect |
788 | * EAGAIN on a non-blocking file descriptor. | 786 | * EAGAIN on a non-blocking file descriptor. |
789 | */ | 787 | */ |
790 | if (in_file->f_flags & O_NONBLOCK) | 788 | if (in_file->f_flags & O_NONBLOCK) |
791 | fl = SPLICE_F_NONBLOCK; | 789 | fl = SPLICE_F_NONBLOCK; |
792 | #endif | 790 | #endif |
793 | retval = do_splice_direct(in_file, ppos, out_file, count, fl); | 791 | retval = do_splice_direct(in_file, ppos, out_file, count, fl); |
794 | } else | ||
795 | retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file); | ||
796 | 792 | ||
797 | if (retval > 0) { | 793 | if (retval > 0) { |
798 | add_rchar(current, retval); | 794 | add_rchar(current, retval); |