aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/splice.c b/fs/splice.c
index da74583a00ee..2fca6ebf4cc2 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -42,7 +42,7 @@ struct splice_pipe_desc {
42 struct partial_page *partial; /* pages[] may not be contig */ 42 struct partial_page *partial; /* pages[] may not be contig */
43 int nr_pages; /* number of pages in map */ 43 int nr_pages; /* number of pages in map */
44 unsigned int flags; /* splice flags */ 44 unsigned int flags; /* splice flags */
45 struct pipe_buf_operations *ops;/* ops associated with output pipe */ 45 const struct pipe_buf_operations *ops;/* ops associated with output pipe */
46}; 46};
47 47
48/* 48/*
@@ -139,7 +139,7 @@ error:
139 return err; 139 return err;
140} 140}
141 141
142static struct pipe_buf_operations page_cache_pipe_buf_ops = { 142static const struct pipe_buf_operations page_cache_pipe_buf_ops = {
143 .can_merge = 0, 143 .can_merge = 0,
144 .map = generic_pipe_buf_map, 144 .map = generic_pipe_buf_map,
145 .unmap = generic_pipe_buf_unmap, 145 .unmap = generic_pipe_buf_unmap,
@@ -159,7 +159,7 @@ static int user_page_pipe_buf_steal(struct pipe_inode_info *pipe,
159 return generic_pipe_buf_steal(pipe, buf); 159 return generic_pipe_buf_steal(pipe, buf);
160} 160}
161 161
162static struct pipe_buf_operations user_page_pipe_buf_ops = { 162static const struct pipe_buf_operations user_page_pipe_buf_ops = {
163 .can_merge = 0, 163 .can_merge = 0,
164 .map = generic_pipe_buf_map, 164 .map = generic_pipe_buf_map,
165 .unmap = generic_pipe_buf_unmap, 165 .unmap = generic_pipe_buf_unmap,
@@ -724,7 +724,7 @@ static ssize_t __splice_from_pipe(struct pipe_inode_info *pipe,
724 for (;;) { 724 for (;;) {
725 if (pipe->nrbufs) { 725 if (pipe->nrbufs) {
726 struct pipe_buffer *buf = pipe->bufs + pipe->curbuf; 726 struct pipe_buffer *buf = pipe->bufs + pipe->curbuf;
727 struct pipe_buf_operations *ops = buf->ops; 727 const struct pipe_buf_operations *ops = buf->ops;
728 728
729 sd.len = buf->len; 729 sd.len = buf->len;
730 if (sd.len > sd.total_len) 730 if (sd.len > sd.total_len)
@@ -844,7 +844,7 @@ generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out,
844 ssize_t ret; 844 ssize_t ret;
845 int err; 845 int err;
846 846
847 err = remove_suid(out->f_dentry); 847 err = remove_suid(out->f_path.dentry);
848 if (unlikely(err)) 848 if (unlikely(err))
849 return err; 849 return err;
850 850
@@ -890,10 +890,10 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
890 ssize_t ret; 890 ssize_t ret;
891 int err; 891 int err;
892 892
893 err = should_remove_suid(out->f_dentry); 893 err = should_remove_suid(out->f_path.dentry);
894 if (unlikely(err)) { 894 if (unlikely(err)) {
895 mutex_lock(&inode->i_mutex); 895 mutex_lock(&inode->i_mutex);
896 err = __remove_suid(out->f_dentry, err); 896 err = __remove_suid(out->f_path.dentry, err);
897 mutex_unlock(&inode->i_mutex); 897 mutex_unlock(&inode->i_mutex);
898 if (err) 898 if (err)
899 return err; 899 return err;
@@ -1008,7 +1008,7 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
1008 * randomly drop data for eg socket -> socket splicing. Use the 1008 * randomly drop data for eg socket -> socket splicing. Use the
1009 * piped splicing for that! 1009 * piped splicing for that!
1010 */ 1010 */
1011 i_mode = in->f_dentry->d_inode->i_mode; 1011 i_mode = in->f_path.dentry->d_inode->i_mode;
1012 if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode))) 1012 if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode)))
1013 return -EINVAL; 1013 return -EINVAL;
1014 1014
@@ -1132,7 +1132,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
1132 loff_t offset, *off; 1132 loff_t offset, *off;
1133 long ret; 1133 long ret;
1134 1134
1135 pipe = pipe_info(in->f_dentry->d_inode); 1135 pipe = pipe_info(in->f_path.dentry->d_inode);
1136 if (pipe) { 1136 if (pipe) {
1137 if (off_in) 1137 if (off_in)
1138 return -ESPIPE; 1138 return -ESPIPE;
@@ -1153,7 +1153,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
1153 return ret; 1153 return ret;
1154 } 1154 }
1155 1155
1156 pipe = pipe_info(out->f_dentry->d_inode); 1156 pipe = pipe_info(out->f_path.dentry->d_inode);
1157 if (pipe) { 1157 if (pipe) {
1158 if (off_out) 1158 if (off_out)
1159 return -ESPIPE; 1159 return -ESPIPE;
@@ -1321,7 +1321,7 @@ static long do_vmsplice(struct file *file, const struct iovec __user *iov,
1321 .ops = &user_page_pipe_buf_ops, 1321 .ops = &user_page_pipe_buf_ops,
1322 }; 1322 };
1323 1323
1324 pipe = pipe_info(file->f_dentry->d_inode); 1324 pipe = pipe_info(file->f_path.dentry->d_inode);
1325 if (!pipe) 1325 if (!pipe)
1326 return -EBADF; 1326 return -EBADF;
1327 if (unlikely(nr_segs > UIO_MAXIOV)) 1327 if (unlikely(nr_segs > UIO_MAXIOV))
@@ -1549,8 +1549,8 @@ static int link_pipe(struct pipe_inode_info *ipipe,
1549static long do_tee(struct file *in, struct file *out, size_t len, 1549static long do_tee(struct file *in, struct file *out, size_t len,
1550 unsigned int flags) 1550 unsigned int flags)
1551{ 1551{
1552 struct pipe_inode_info *ipipe = pipe_info(in->f_dentry->d_inode); 1552 struct pipe_inode_info *ipipe = pipe_info(in->f_path.dentry->d_inode);
1553 struct pipe_inode_info *opipe = pipe_info(out->f_dentry->d_inode); 1553 struct pipe_inode_info *opipe = pipe_info(out->f_path.dentry->d_inode);
1554 int ret = -EINVAL; 1554 int ret = -EINVAL;
1555 1555
1556 /* 1556 /*