aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2009-04-14 13:48:40 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-15 06:10:12 -0400
commitf8cc774ce4844811a55e2352f1443055e3994e28 (patch)
treea9d95b3d23044ff6217b76135d0be1661ffbc5e7 /fs/splice.c
parent328eaaba4e41a04c1dc4679d65bea3fee4349d86 (diff)
splice: remove generic_file_splice_write_nolock()
Remove the now unused generic_file_splice_write_nolock() function. It's conceptually broken anyway, because splice may need to wait for pipe events so holding locks across the whole operation is wrong. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c59
1 files changed, 0 insertions, 59 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 */
827ssize_t
828generic_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
870EXPORT_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