diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-08 08:06:40 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-08 08:06:40 -0700 |
commit | c77e9e68269bf50573ce130b5d95ff6e539dbcf8 (patch) | |
tree | 99edc1b070717e18f5958f934bc3921cfed2ce1f /fs/splice.c | |
parent | 31016e9941be85e8c487b1f3c45d253eda356715 (diff) | |
parent | 83ba7b071f30f7c01f72518ad72d5cd203c27502 (diff) | |
download | op-kernel-dev-c77e9e68269bf50573ce130b5d95ff6e539dbcf8.zip op-kernel-dev-c77e9e68269bf50573ce130b5d95ff6e539dbcf8.tar.gz |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
writeback: simplify the write back thread queue
writeback: split writeback_inodes_wb
writeback: remove writeback_inodes_wbc
fs-writeback: fix kernel-doc warnings
splice: check f_mode for seekable file
splice: direct_splice_actor() should not use pos in sd
Diffstat (limited to 'fs/splice.c')
-rw-r--r-- | fs/splice.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/splice.c b/fs/splice.c index 740e6b9..efdbfec 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1282,7 +1282,8 @@ static int direct_splice_actor(struct pipe_inode_info *pipe, { struct file *file = sd->u.file; - return do_splice_from(pipe, file, &sd->pos, sd->total_len, sd->flags); + return do_splice_from(pipe, file, &file->f_pos, sd->total_len, + sd->flags); } /** @@ -1371,8 +1372,7 @@ static long do_splice(struct file *in, loff_t __user *off_in, if (off_in) return -ESPIPE; if (off_out) { - if (!out->f_op || !out->f_op->llseek || - out->f_op->llseek == no_llseek) + if (!(out->f_mode & FMODE_PWRITE)) return -EINVAL; if (copy_from_user(&offset, off_out, sizeof(loff_t))) return -EFAULT; @@ -1392,8 +1392,7 @@ static long do_splice(struct file *in, loff_t __user *off_in, if (off_out) return -ESPIPE; if (off_in) { - if (!in->f_op || !in->f_op->llseek || - in->f_op->llseek == no_llseek) + if (!(in->f_mode & FMODE_PREAD)) return -EINVAL; if (copy_from_user(&offset, off_in, sizeof(loff_t))) return -EFAULT; |