X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fpipe.c;h=547aec5efc39e6d7dce221fb6326178bc5f1f7e5;hb=fe49bdca8ed2e96407d7d6f2bc35faa054ad119f;hp=737271c0c9b9e7f36c69932cdb539c5a4602110a;hpb=daddc0d38b3571bed170afa273a49a0eba090c1e;p=linux-2.6.git diff --git a/fs/pipe.c b/fs/pipe.c index 737271c0c..547aec5ef 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -94,10 +94,6 @@ pipe_readv(struct file *filp, const struct iovec *_iov, struct iovec *iov = (struct iovec *)_iov; size_t total_len; - /* pread is not allowed on pipes. */ - if (unlikely(ppos != &filp->f_pos)) - return -ESPIPE; - total_len = iov_length(iov, nr_segs); /* Null read succeeds. */ if (unlikely(total_len == 0)) @@ -187,10 +183,6 @@ pipe_writev(struct file *filp, const struct iovec *_iov, struct iovec *iov = (struct iovec *)_iov; size_t total_len; - /* pwrite is not allowed on pipes. */ - if (unlikely(ppos != &filp->f_pos)) - return -ESPIPE; - total_len = iov_length(iov, nr_segs); /* Null write succeeds. */ if (unlikely(total_len == 0)) @@ -263,7 +255,7 @@ pipe_writev(struct file *filp, const struct iovec *_iov, kill_fasync(PIPE_FASYNC_READERS(*inode), SIGIO, POLL_IN); } if (ret > 0) - inode_update_time(inode, 1); /* mtime and ctime */ + inode_update_time(inode, filp->f_vfsmnt, 1); /* mtime and ctime */ return ret; } @@ -656,13 +648,13 @@ int do_pipe(int *fd) f1->f_pos = f2->f_pos = 0; f1->f_flags = O_RDONLY; f1->f_op = &read_pipe_fops; - f1->f_mode = 1; + f1->f_mode = FMODE_READ; f1->f_version = 0; /* write file */ f2->f_flags = O_WRONLY; f2->f_op = &write_pipe_fops; - f2->f_mode = 2; + f2->f_mode = FMODE_WRITE; f2->f_version = 0; fd_install(i, f1); @@ -688,6 +680,8 @@ no_files: return error; } +EXPORT_SYMBOL_GPL(do_pipe); + /* * pipefs should _never_ be mounted by userland - too much of security hassle, * no real gain from having the whole whorehouse mounted. So we don't need @@ -726,5 +720,5 @@ static void __exit exit_pipe_fs(void) mntput(pipe_mnt); } -module_init(init_pipe_fs) -module_exit(exit_pipe_fs) +fs_initcall(init_pipe_fs); +module_exit(exit_pipe_fs);