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

sendfile: remove .sendfile from filesystems that use generic_file_sendfile()

They can use generic_file_splice_read() instead. Since sys_sendfile() now
prefers that, there should be no change in behaviour.

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

+43 -131
+1 -1
fs/adfs/file.c
··· 33 33 .fsync = file_fsync, 34 34 .write = do_sync_write, 35 35 .aio_write = generic_file_aio_write, 36 - .sendfile = generic_file_sendfile, 36 + .splice_read = generic_file_splice_read, 37 37 }; 38 38 39 39 const struct inode_operations adfs_file_inode_operations = {
+1 -1
fs/affs/file.c
··· 35 35 .open = affs_file_open, 36 36 .release = affs_file_release, 37 37 .fsync = file_fsync, 38 - .sendfile = generic_file_sendfile, 38 + .splice_read = generic_file_splice_read, 39 39 }; 40 40 41 41 const struct inode_operations affs_file_inode_operations = {
+1 -1
fs/afs/file.c
··· 32 32 .aio_read = generic_file_aio_read, 33 33 .aio_write = afs_file_write, 34 34 .mmap = generic_file_readonly_mmap, 35 - .sendfile = generic_file_sendfile, 35 + .splice_read = generic_file_splice_read, 36 36 .fsync = afs_fsync, 37 37 }; 38 38
+1 -1
fs/bfs/file.c
··· 24 24 .write = do_sync_write, 25 25 .aio_write = generic_file_aio_write, 26 26 .mmap = generic_file_mmap, 27 - .sendfile = generic_file_sendfile, 27 + .splice_read = generic_file_splice_read, 28 28 }; 29 29 30 30 static int bfs_move_block(unsigned long from, unsigned long to, struct super_block *sb)
-1
fs/block_dev.c
··· 1346 1346 #ifdef CONFIG_COMPAT 1347 1347 .compat_ioctl = compat_blkdev_ioctl, 1348 1348 #endif 1349 - .sendfile = generic_file_sendfile, 1350 1349 .splice_read = generic_file_splice_read, 1351 1350 .splice_write = generic_file_splice_write, 1352 1351 };
+4 -4
fs/cifs/cifsfs.c
··· 616 616 .fsync = cifs_fsync, 617 617 .flush = cifs_flush, 618 618 .mmap = cifs_file_mmap, 619 - .sendfile = generic_file_sendfile, 619 + .splice_read = generic_file_splice_read, 620 620 .llseek = cifs_llseek, 621 621 #ifdef CONFIG_CIFS_POSIX 622 622 .ioctl = cifs_ioctl, ··· 637 637 .lock = cifs_lock, 638 638 .fsync = cifs_fsync, 639 639 .flush = cifs_flush, 640 - .sendfile = generic_file_sendfile, /* BB removeme BB */ 640 + .splice_read = generic_file_splice_read, 641 641 #ifdef CONFIG_CIFS_POSIX 642 642 .ioctl = cifs_ioctl, 643 643 #endif /* CONFIG_CIFS_POSIX */ ··· 656 656 .fsync = cifs_fsync, 657 657 .flush = cifs_flush, 658 658 .mmap = cifs_file_mmap, 659 - .sendfile = generic_file_sendfile, 659 + .splice_read = generic_file_splice_read, 660 660 .llseek = cifs_llseek, 661 661 #ifdef CONFIG_CIFS_POSIX 662 662 .ioctl = cifs_ioctl, ··· 676 676 .release = cifs_close, 677 677 .fsync = cifs_fsync, 678 678 .flush = cifs_flush, 679 - .sendfile = generic_file_sendfile, /* BB removeme BB */ 679 + .splice_read = generic_file_splice_read, 680 680 #ifdef CONFIG_CIFS_POSIX 681 681 .ioctl = cifs_ioctl, 682 682 #endif /* CONFIG_CIFS_POSIX */
+6 -5
fs/coda/file.c
··· 47 47 } 48 48 49 49 static ssize_t 50 - coda_file_sendfile(struct file *coda_file, loff_t *ppos, size_t count, 51 - read_actor_t actor, void *target) 50 + coda_file_splice_read(struct file *coda_file, loff_t *ppos, 51 + struct pipe_inode_info *pipe, size_t count, 52 + unsigned int flags) 52 53 { 53 54 struct coda_file_info *cfi; 54 55 struct file *host_file; ··· 58 57 BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); 59 58 host_file = cfi->cfi_container; 60 59 61 - if (!host_file->f_op || !host_file->f_op->sendfile) 60 + if (!host_file->f_op || !host_file->f_op->splice_read) 62 61 return -EINVAL; 63 62 64 - return host_file->f_op->sendfile(host_file, ppos, count, actor, target); 63 + return host_file->f_op->splice_read(host_file, ppos, pipe, count,flags); 65 64 } 66 65 67 66 static ssize_t ··· 296 295 .flush = coda_flush, 297 296 .release = coda_release, 298 297 .fsync = coda_fsync, 299 - .sendfile = coda_file_sendfile, 298 + .splice_read = coda_file_splice_read, 300 299 }; 301 300
+8 -7
fs/ecryptfs/file.c
··· 338 338 return rc; 339 339 } 340 340 341 - static ssize_t ecryptfs_sendfile(struct file *file, loff_t * ppos, 342 - size_t count, read_actor_t actor, void *target) 341 + static ssize_t ecryptfs_splice_read(struct file *file, loff_t * ppos, 342 + struct pipe_inode_info *pipe, size_t count, 343 + unsigned int flags) 343 344 { 344 345 struct file *lower_file = NULL; 345 346 int rc = -EINVAL; 346 347 347 348 lower_file = ecryptfs_file_to_lower(file); 348 - if (lower_file->f_op && lower_file->f_op->sendfile) 349 - rc = lower_file->f_op->sendfile(lower_file, ppos, count, 350 - actor, target); 349 + if (lower_file->f_op && lower_file->f_op->splice_read) 350 + rc = lower_file->f_op->splice_read(lower_file, ppos, pipe, 351 + count, flags); 351 352 352 353 return rc; 353 354 } ··· 365 364 .release = ecryptfs_release, 366 365 .fsync = ecryptfs_fsync, 367 366 .fasync = ecryptfs_fasync, 368 - .sendfile = ecryptfs_sendfile, 367 + .splice_read = ecryptfs_splice_read, 369 368 }; 370 369 371 370 const struct file_operations ecryptfs_main_fops = { ··· 382 381 .release = ecryptfs_release, 383 382 .fsync = ecryptfs_fsync, 384 383 .fasync = ecryptfs_fasync, 385 - .sendfile = ecryptfs_sendfile, 384 + .splice_read = ecryptfs_splice_read, 386 385 }; 387 386 388 387 static int
-1
fs/ext2/file.c
··· 53 53 .open = generic_file_open, 54 54 .release = ext2_release_file, 55 55 .fsync = ext2_sync_file, 56 - .sendfile = generic_file_sendfile, 57 56 .splice_read = generic_file_splice_read, 58 57 .splice_write = generic_file_splice_write, 59 58 };
-1
fs/ext3/file.c
··· 120 120 .open = generic_file_open, 121 121 .release = ext3_release_file, 122 122 .fsync = ext3_sync_file, 123 - .sendfile = generic_file_sendfile, 124 123 .splice_read = generic_file_splice_read, 125 124 .splice_write = generic_file_splice_write, 126 125 };
-1
fs/ext4/file.c
··· 120 120 .open = generic_file_open, 121 121 .release = ext4_release_file, 122 122 .fsync = ext4_sync_file, 123 - .sendfile = generic_file_sendfile, 124 123 .splice_read = generic_file_splice_read, 125 124 .splice_write = generic_file_splice_write, 126 125 };
+1 -1
fs/fat/file.c
··· 134 134 .release = fat_file_release, 135 135 .ioctl = fat_generic_ioctl, 136 136 .fsync = file_fsync, 137 - .sendfile = generic_file_sendfile, 137 + .splice_read = generic_file_splice_read, 138 138 }; 139 139 140 140 static int fat_cont_expand(struct inode *inode, loff_t size)
+2 -2
fs/fuse/file.c
··· 802 802 .release = fuse_release, 803 803 .fsync = fuse_fsync, 804 804 .lock = fuse_file_lock, 805 - .sendfile = generic_file_sendfile, 805 + .splice_read = generic_file_splice_read, 806 806 }; 807 807 808 808 static const struct file_operations fuse_direct_io_file_operations = { ··· 814 814 .release = fuse_release, 815 815 .fsync = fuse_fsync, 816 816 .lock = fuse_file_lock, 817 - /* no mmap and sendfile */ 817 + /* no mmap and splice_read */ 818 818 }; 819 819 820 820 static const struct address_space_operations fuse_file_aops = {
-1
fs/gfs2/ops_file.c
··· 635 635 .release = gfs2_close, 636 636 .fsync = gfs2_fsync, 637 637 .lock = gfs2_lock, 638 - .sendfile = generic_file_sendfile, 639 638 .flock = gfs2_flock, 640 639 .splice_read = generic_file_splice_read, 641 640 .splice_write = generic_file_splice_write,
+1 -1
fs/hfs/inode.c
··· 607 607 .write = do_sync_write, 608 608 .aio_write = generic_file_aio_write, 609 609 .mmap = generic_file_mmap, 610 - .sendfile = generic_file_sendfile, 610 + .splice_read = generic_file_splice_read, 611 611 .fsync = file_fsync, 612 612 .open = hfs_file_open, 613 613 .release = hfs_file_release,
+1 -1
fs/hfsplus/inode.c
··· 288 288 .write = do_sync_write, 289 289 .aio_write = generic_file_aio_write, 290 290 .mmap = generic_file_mmap, 291 - .sendfile = generic_file_sendfile, 291 + .splice_read = generic_file_splice_read, 292 292 .fsync = file_fsync, 293 293 .open = hfsplus_file_open, 294 294 .release = hfsplus_file_release,
+1 -1
fs/hostfs/hostfs_kern.c
··· 390 390 static const struct file_operations hostfs_file_fops = { 391 391 .llseek = generic_file_llseek, 392 392 .read = do_sync_read, 393 - .sendfile = generic_file_sendfile, 393 + .splice_read = generic_file_splice_read, 394 394 .aio_read = generic_file_aio_read, 395 395 .aio_write = generic_file_aio_write, 396 396 .write = do_sync_write,
+1 -1
fs/hpfs/file.c
··· 129 129 .mmap = generic_file_mmap, 130 130 .release = hpfs_file_release, 131 131 .fsync = hpfs_file_fsync, 132 - .sendfile = generic_file_sendfile, 132 + .splice_read = generic_file_splice_read, 133 133 }; 134 134 135 135 const struct inode_operations hpfs_file_iops =
+1 -1
fs/jffs2/file.c
··· 47 47 .ioctl = jffs2_ioctl, 48 48 .mmap = generic_file_readonly_mmap, 49 49 .fsync = jffs2_fsync, 50 - .sendfile = generic_file_sendfile 50 + .splice_read = generic_file_splice_read, 51 51 }; 52 52 53 53 /* jffs2_file_inode_operations */
-1
fs/jfs/file.c
··· 108 108 .aio_read = generic_file_aio_read, 109 109 .aio_write = generic_file_aio_write, 110 110 .mmap = generic_file_mmap, 111 - .sendfile = generic_file_sendfile, 112 111 .splice_read = generic_file_splice_read, 113 112 .splice_write = generic_file_splice_write, 114 113 .fsync = jfs_fsync,
+1 -1
fs/minix/file.c
··· 23 23 .aio_write = generic_file_aio_write, 24 24 .mmap = generic_file_mmap, 25 25 .fsync = minix_sync_file, 26 - .sendfile = generic_file_sendfile, 26 + .splice_read = generic_file_splice_read, 27 27 }; 28 28 29 29 const struct inode_operations minix_file_inode_operations = {
+1 -1
fs/ntfs/file.c
··· 2276 2276 mounted filesystem. */ 2277 2277 .mmap = generic_file_mmap, /* Mmap file. */ 2278 2278 .open = ntfs_file_open, /* Open file. */ 2279 - .sendfile = generic_file_sendfile, /* Zero-copy data send with 2279 + .splice_read = generic_file_splice_read /* Zero-copy data send with 2280 2280 the data source being on 2281 2281 the ntfs partition. We do 2282 2282 not need to care about the
-1
fs/ocfs2/file.c
··· 1822 1822 const struct file_operations ocfs2_fops = { 1823 1823 .read = do_sync_read, 1824 1824 .write = do_sync_write, 1825 - .sendfile = generic_file_sendfile, 1826 1825 .mmap = ocfs2_mmap, 1827 1826 .fsync = ocfs2_sync_file, 1828 1827 .release = ocfs2_file_release,
+1 -1
fs/qnx4/file.c
··· 25 25 .read = do_sync_read, 26 26 .aio_read = generic_file_aio_read, 27 27 .mmap = generic_file_mmap, 28 - .sendfile = generic_file_sendfile, 28 + .splice_read = generic_file_splice_read, 29 29 #ifdef CONFIG_QNX4FS_RW 30 30 .write = do_sync_write, 31 31 .aio_write = generic_file_aio_write,
+1 -1
fs/ramfs/file-mmu.c
··· 41 41 .aio_write = generic_file_aio_write, 42 42 .mmap = generic_file_mmap, 43 43 .fsync = simple_sync_file, 44 - .sendfile = generic_file_sendfile, 44 + .splice_read = generic_file_splice_read, 45 45 .llseek = generic_file_llseek, 46 46 }; 47 47
+1 -1
fs/ramfs/file-nommu.c
··· 42 42 .write = do_sync_write, 43 43 .aio_write = generic_file_aio_write, 44 44 .fsync = simple_sync_file, 45 - .sendfile = generic_file_sendfile, 45 + .splice_read = generic_file_splice_read, 46 46 .llseek = generic_file_llseek, 47 47 }; 48 48
-1
fs/reiserfs/file.c
··· 1531 1531 .open = generic_file_open, 1532 1532 .release = reiserfs_file_release, 1533 1533 .fsync = reiserfs_sync_file, 1534 - .sendfile = generic_file_sendfile, 1535 1534 .aio_read = generic_file_aio_read, 1536 1535 .aio_write = generic_file_aio_write, 1537 1536 .splice_read = generic_file_splice_read,
+5 -4
fs/smbfs/file.c
··· 262 262 } 263 263 264 264 static ssize_t 265 - smb_file_sendfile(struct file *file, loff_t *ppos, 266 - size_t count, read_actor_t actor, void *target) 265 + smb_file_splice_read(struct file *file, loff_t *ppos, 266 + struct pipe_inode_info *pipe, size_t count, 267 + unsigned int flags) 267 268 { 268 269 struct dentry *dentry = file->f_path.dentry; 269 270 ssize_t status; ··· 278 277 DENTRY_PATH(dentry), status); 279 278 goto out; 280 279 } 281 - status = generic_file_sendfile(file, ppos, count, actor, target); 280 + status = generic_file_splice_read(file, ppos, pipe, count, flags); 282 281 out: 283 282 return status; 284 283 } ··· 417 416 .open = smb_file_open, 418 417 .release = smb_file_release, 419 418 .fsync = smb_fsync, 420 - .sendfile = smb_file_sendfile, 419 + .splice_read = smb_file_splice_read, 421 420 }; 422 421 423 422 const struct inode_operations smb_file_inode_operations =
+1 -1
fs/sysv/file.c
··· 27 27 .aio_write = generic_file_aio_write, 28 28 .mmap = generic_file_mmap, 29 29 .fsync = sysv_sync_file, 30 - .sendfile = generic_file_sendfile, 30 + .splice_read = generic_file_splice_read, 31 31 }; 32 32 33 33 const struct inode_operations sysv_file_inode_operations = {
+1 -1
fs/udf/file.c
··· 261 261 .aio_write = udf_file_aio_write, 262 262 .release = udf_release_file, 263 263 .fsync = udf_fsync_file, 264 - .sendfile = generic_file_sendfile, 264 + .splice_read = generic_file_splice_read, 265 265 }; 266 266 267 267 const struct inode_operations udf_file_inode_operations = {
+1 -1
fs/ufs/file.c
··· 60 60 .mmap = generic_file_mmap, 61 61 .open = generic_file_open, 62 62 .fsync = ufs_sync_file, 63 - .sendfile = generic_file_sendfile, 63 + .splice_read = generic_file_splice_read, 64 64 };
-26
fs/xfs/linux-2.6/xfs_file.c
··· 124 124 } 125 125 126 126 STATIC ssize_t 127 - xfs_file_sendfile( 128 - struct file *filp, 129 - loff_t *pos, 130 - size_t count, 131 - read_actor_t actor, 132 - void *target) 133 - { 134 - return bhv_vop_sendfile(vn_from_inode(filp->f_path.dentry->d_inode), 135 - filp, pos, 0, count, actor, target, NULL); 136 - } 137 - 138 - STATIC ssize_t 139 - xfs_file_sendfile_invis( 140 - struct file *filp, 141 - loff_t *pos, 142 - size_t count, 143 - read_actor_t actor, 144 - void *target) 145 - { 146 - return bhv_vop_sendfile(vn_from_inode(filp->f_path.dentry->d_inode), 147 - filp, pos, IO_INVIS, count, actor, target, NULL); 148 - } 149 - 150 - STATIC ssize_t 151 127 xfs_file_splice_read( 152 128 struct file *infilp, 153 129 loff_t *ppos, ··· 428 452 .write = do_sync_write, 429 453 .aio_read = xfs_file_aio_read, 430 454 .aio_write = xfs_file_aio_write, 431 - .sendfile = xfs_file_sendfile, 432 455 .splice_read = xfs_file_splice_read, 433 456 .splice_write = xfs_file_splice_write, 434 457 .unlocked_ioctl = xfs_file_ioctl, ··· 450 475 .write = do_sync_write, 451 476 .aio_read = xfs_file_aio_read_invis, 452 477 .aio_write = xfs_file_aio_write_invis, 453 - .sendfile = xfs_file_sendfile_invis, 454 478 .splice_read = xfs_file_splice_read_invis, 455 479 .splice_write = xfs_file_splice_write_invis, 456 480 .unlocked_ioctl = xfs_file_ioctl_invis,
-1
fs/xfs/linux-2.6/xfs_linux.h
··· 101 101 * Feature macros (disable/enable) 102 102 */ 103 103 #undef HAVE_REFCACHE /* reference cache not needed for NFS in 2.6 */ 104 - #define HAVE_SENDFILE /* sendfile(2) exists in 2.6, but not in 2.4 */ 105 104 #define HAVE_SPLICE /* a splice(2) exists in 2.6, but not in 2.4 */ 106 105 #ifdef CONFIG_SMP 107 106 #define HAVE_PERCPU_SB /* per cpu superblock counters are a 2.6 feature */
-44
fs/xfs/linux-2.6/xfs_lrw.c
··· 287 287 } 288 288 289 289 ssize_t 290 - xfs_sendfile( 291 - bhv_desc_t *bdp, 292 - struct file *filp, 293 - loff_t *offset, 294 - int ioflags, 295 - size_t count, 296 - read_actor_t actor, 297 - void *target, 298 - cred_t *credp) 299 - { 300 - xfs_inode_t *ip = XFS_BHVTOI(bdp); 301 - xfs_mount_t *mp = ip->i_mount; 302 - ssize_t ret; 303 - 304 - XFS_STATS_INC(xs_read_calls); 305 - if (XFS_FORCED_SHUTDOWN(mp)) 306 - return -EIO; 307 - 308 - xfs_ilock(ip, XFS_IOLOCK_SHARED); 309 - 310 - if (DM_EVENT_ENABLED(BHV_TO_VNODE(bdp)->v_vfsp, ip, DM_EVENT_READ) && 311 - (!(ioflags & IO_INVIS))) { 312 - bhv_vrwlock_t locktype = VRWLOCK_READ; 313 - int error; 314 - 315 - error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp), 316 - *offset, count, 317 - FILP_DELAY_FLAG(filp), &locktype); 318 - if (error) { 319 - xfs_iunlock(ip, XFS_IOLOCK_SHARED); 320 - return -error; 321 - } 322 - } 323 - xfs_rw_enter_trace(XFS_SENDFILE_ENTER, &ip->i_iocore, 324 - (void *)(unsigned long)target, count, *offset, ioflags); 325 - ret = generic_file_sendfile(filp, offset, count, actor, target); 326 - if (ret > 0) 327 - XFS_STATS_ADD(xs_read_bytes, ret); 328 - 329 - xfs_iunlock(ip, XFS_IOLOCK_SHARED); 330 - return ret; 331 - } 332 - 333 - ssize_t 334 290 xfs_splice_read( 335 291 bhv_desc_t *bdp, 336 292 struct file *infilp,
-3
fs/xfs/linux-2.6/xfs_lrw.h
··· 90 90 extern ssize_t xfs_write(struct bhv_desc *, struct kiocb *, 91 91 const struct iovec *, unsigned int, 92 92 loff_t *, int, struct cred *); 93 - extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *, 94 - loff_t *, int, size_t, read_actor_t, 95 - void *, struct cred *); 96 93 extern ssize_t xfs_splice_read(struct bhv_desc *, struct file *, loff_t *, 97 94 struct pipe_inode_info *, size_t, int, int, 98 95 struct cred *);
-6
fs/xfs/linux-2.6/xfs_vnode.h
··· 139 139 typedef ssize_t (*vop_write_t)(bhv_desc_t *, struct kiocb *, 140 140 const struct iovec *, unsigned int, 141 141 loff_t *, int, struct cred *); 142 - typedef ssize_t (*vop_sendfile_t)(bhv_desc_t *, struct file *, 143 - loff_t *, int, size_t, read_actor_t, 144 - void *, struct cred *); 145 142 typedef ssize_t (*vop_splice_read_t)(bhv_desc_t *, struct file *, loff_t *, 146 143 struct pipe_inode_info *, size_t, int, int, 147 144 struct cred *); ··· 203 206 vop_close_t vop_close; 204 207 vop_read_t vop_read; 205 208 vop_write_t vop_write; 206 - vop_sendfile_t vop_sendfile; 207 209 vop_splice_read_t vop_splice_read; 208 210 vop_splice_write_t vop_splice_write; 209 211 vop_ioctl_t vop_ioctl; ··· 250 254 VOP(vop_read, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr) 251 255 #define bhv_vop_write(vp,file,iov,segs,offset,ioflags,cr) \ 252 256 VOP(vop_write, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr) 253 - #define bhv_vop_sendfile(vp,f,off,ioflags,cnt,act,targ,cr) \ 254 - VOP(vop_sendfile, vp)(VNHEAD(vp),f,off,ioflags,cnt,act,targ,cr) 255 257 #define bhv_vop_splice_read(vp,f,o,pipe,cnt,fl,iofl,cr) \ 256 258 VOP(vop_splice_read, vp)(VNHEAD(vp),f,o,pipe,cnt,fl,iofl,cr) 257 259 #define bhv_vop_splice_write(vp,f,o,pipe,cnt,fl,iofl,cr) \
-3
fs/xfs/xfs_vnodeops.c
··· 4680 4680 .vop_open = xfs_open, 4681 4681 .vop_close = xfs_close, 4682 4682 .vop_read = xfs_read, 4683 - #ifdef HAVE_SENDFILE 4684 - .vop_sendfile = xfs_sendfile, 4685 - #endif 4686 4683 #ifdef HAVE_SPLICE 4687 4684 .vop_splice_read = xfs_splice_read, 4688 4685 .vop_splice_write = xfs_splice_write,