Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Remove remnants of sendfile()

There are now zero users of .sendfile() in the kernel, so kill
it from the file_operations structure and in do_sendfile().

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

+12 -17
+11 -15
fs/read_write.c
··· 724 724 in_inode = in_file->f_path.dentry->d_inode; 725 725 if (!in_inode) 726 726 goto fput_in; 727 - if (!in_file->f_op || (!in_file->f_op->sendfile && 728 - !in_file->f_op->splice_read)) 727 + if (!in_file->f_op || !in_file->f_op->splice_read) 729 728 goto fput_in; 730 729 retval = -ESPIPE; 731 730 if (!ppos) ··· 777 778 count = max - pos; 778 779 } 779 780 780 - if (in_file->f_op->splice_read) { 781 - fl = 0; 781 + fl = 0; 782 782 #if 0 783 - /* 784 - * We need to debate whether we can enable this or not. The 785 - * man page documents EAGAIN return for the output at least, 786 - * and the application is arguably buggy if it doesn't expect 787 - * EAGAIN on a non-blocking file descriptor. 788 - */ 789 - if (in_file->f_flags & O_NONBLOCK) 790 - fl = SPLICE_F_NONBLOCK; 783 + /* 784 + * We need to debate whether we can enable this or not. The 785 + * man page documents EAGAIN return for the output at least, 786 + * and the application is arguably buggy if it doesn't expect 787 + * EAGAIN on a non-blocking file descriptor. 788 + */ 789 + if (in_file->f_flags & O_NONBLOCK) 790 + fl = SPLICE_F_NONBLOCK; 791 791 #endif 792 - retval = do_splice_direct(in_file, ppos, out_file, count, fl); 793 - } else 794 - retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file); 792 + retval = do_splice_direct(in_file, ppos, out_file, count, fl); 795 793 796 794 if (retval > 0) { 797 795 add_rchar(current, retval);
+1 -2
include/linux/fs.h
··· 1054 1054 }; 1055 1055 1056 1056 /* 1057 - * "descriptor" for what we're up to with a read for sendfile(). 1057 + * "descriptor" for what we're up to with a read. 1058 1058 * This allows us to use the same read code yet 1059 1059 * have multiple different users of the data that 1060 1060 * we read from a file. ··· 1105 1105 int (*aio_fsync) (struct kiocb *, int datasync); 1106 1106 int (*fasync) (int, struct file *, int); 1107 1107 int (*lock) (struct file *, int, struct file_lock *); 1108 - ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); 1109 1108 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1110 1109 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1111 1110 int (*check_flags)(int);