···724724 in_inode = in_file->f_path.dentry->d_inode;725725 if (!in_inode)726726 goto fput_in;727727- if (!in_file->f_op || (!in_file->f_op->sendfile &&728728- !in_file->f_op->splice_read))727727+ if (!in_file->f_op || !in_file->f_op->splice_read)729728 goto fput_in;730729 retval = -ESPIPE;731730 if (!ppos)···777778 count = max - pos;778779 }779780780780- if (in_file->f_op->splice_read) {781781- fl = 0;781781+ fl = 0;782782#if 0783783- /*784784- * We need to debate whether we can enable this or not. The785785- * man page documents EAGAIN return for the output at least,786786- * and the application is arguably buggy if it doesn't expect787787- * EAGAIN on a non-blocking file descriptor.788788- */789789- if (in_file->f_flags & O_NONBLOCK)790790- fl = SPLICE_F_NONBLOCK;783783+ /*784784+ * We need to debate whether we can enable this or not. The785785+ * man page documents EAGAIN return for the output at least,786786+ * and the application is arguably buggy if it doesn't expect787787+ * EAGAIN on a non-blocking file descriptor.788788+ */789789+ if (in_file->f_flags & O_NONBLOCK)790790+ fl = SPLICE_F_NONBLOCK;791791#endif792792- retval = do_splice_direct(in_file, ppos, out_file, count, fl);793793- } else794794- retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file);792792+ retval = do_splice_direct(in_file, ppos, out_file, count, fl);795793796794 if (retval > 0) {797795 add_rchar(current, retval);
+1-2
include/linux/fs.h
···10541054};1055105510561056/*10571057- * "descriptor" for what we're up to with a read for sendfile().10571057+ * "descriptor" for what we're up to with a read.10581058 * This allows us to use the same read code yet10591059 * have multiple different users of the data that10601060 * we read from a file.···11051105 int (*aio_fsync) (struct kiocb *, int datasync);11061106 int (*fasync) (int, struct file *, int);11071107 int (*lock) (struct file *, int, struct file_lock *);11081108- ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);11091108 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);11101109 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);11111110 int (*check_flags)(int);