diff options
-rw-r--r-- | fs/splice.c | 59 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
2 files changed, 0 insertions, 61 deletions
diff --git a/fs/splice.c b/fs/splice.c index 584b2b7a1dbe..128ee36a719b 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -811,65 +811,6 @@ ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out, | |||
811 | } | 811 | } |
812 | 812 | ||
813 | /** | 813 | /** |
814 | * generic_file_splice_write_nolock - generic_file_splice_write without mutexes | ||
815 | * @pipe: pipe info | ||
816 | * @out: file to write to | ||
817 | * @ppos: position in @out | ||
818 | * @len: number of bytes to splice | ||
819 | * @flags: splice modifier flags | ||
820 | * | ||
821 | * Description: | ||
822 | * Will either move or copy pages (determined by @flags options) from | ||
823 | * the given pipe inode to the given file. The caller is responsible | ||
824 | * for acquiring i_mutex on both inodes. | ||
825 | * | ||
826 | */ | ||
827 | ssize_t | ||
828 | generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out, | ||
829 | loff_t *ppos, size_t len, unsigned int flags) | ||
830 | { | ||
831 | struct address_space *mapping = out->f_mapping; | ||
832 | struct inode *inode = mapping->host; | ||
833 | struct splice_desc sd = { | ||
834 | .total_len = len, | ||
835 | .flags = flags, | ||
836 | .pos = *ppos, | ||
837 | .u.file = out, | ||
838 | }; | ||
839 | ssize_t ret; | ||
840 | int err; | ||
841 | |||
842 | err = file_remove_suid(out); | ||
843 | if (unlikely(err)) | ||
844 | return err; | ||
845 | |||
846 | ret = __splice_from_pipe(pipe, &sd, pipe_to_file); | ||
847 | if (ret > 0) { | ||
848 | unsigned long nr_pages; | ||
849 | |||
850 | *ppos += ret; | ||
851 | nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | ||
852 | |||
853 | /* | ||
854 | * If file or inode is SYNC and we actually wrote some data, | ||
855 | * sync it. | ||
856 | */ | ||
857 | if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) { | ||
858 | err = generic_osync_inode(inode, mapping, | ||
859 | OSYNC_METADATA|OSYNC_DATA); | ||
860 | |||
861 | if (err) | ||
862 | ret = err; | ||
863 | } | ||
864 | balance_dirty_pages_ratelimited_nr(mapping, nr_pages); | ||
865 | } | ||
866 | |||
867 | return ret; | ||
868 | } | ||
869 | |||
870 | EXPORT_SYMBOL(generic_file_splice_write_nolock); | ||
871 | |||
872 | /** | ||
873 | * generic_file_splice_write - splice data from a pipe to a file | 814 | * generic_file_splice_write - splice data from a pipe to a file |
874 | * @pipe: pipe info | 815 | * @pipe: pipe info |
875 | * @out: file to write to | 816 | * @out: file to write to |
diff --git a/include/linux/fs.h b/include/linux/fs.h index b535aec4406b..907d8f56c6fa 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2209,8 +2209,6 @@ extern ssize_t generic_file_splice_read(struct file *, loff_t *, | |||
2209 | struct pipe_inode_info *, size_t, unsigned int); | 2209 | struct pipe_inode_info *, size_t, unsigned int); |
2210 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, | 2210 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, |
2211 | struct file *, loff_t *, size_t, unsigned int); | 2211 | struct file *, loff_t *, size_t, unsigned int); |
2212 | extern ssize_t generic_file_splice_write_nolock(struct pipe_inode_info *, | ||
2213 | struct file *, loff_t *, size_t, unsigned int); | ||
2214 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | 2212 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, |
2215 | struct file *out, loff_t *, size_t len, unsigned int flags); | 2213 | struct file *out, loff_t *, size_t len, unsigned int flags); |
2216 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | 2214 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, |