diff options
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r-- | fs/fuse/dev.c | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 4fc557c40cc0..66571eafbb1e 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -680,14 +680,15 @@ static int fuse_read_interrupt(struct fuse_conn *fc, struct fuse_req *req, | |||
680 | * request_end(). Otherwise add it to the processing list, and set | 680 | * request_end(). Otherwise add it to the processing list, and set |
681 | * the 'sent' flag. | 681 | * the 'sent' flag. |
682 | */ | 682 | */ |
683 | static ssize_t fuse_dev_readv(struct file *file, const struct iovec *iov, | 683 | static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov, |
684 | unsigned long nr_segs, loff_t *off) | 684 | unsigned long nr_segs, loff_t pos) |
685 | { | 685 | { |
686 | int err; | 686 | int err; |
687 | struct fuse_req *req; | 687 | struct fuse_req *req; |
688 | struct fuse_in *in; | 688 | struct fuse_in *in; |
689 | struct fuse_copy_state cs; | 689 | struct fuse_copy_state cs; |
690 | unsigned reqsize; | 690 | unsigned reqsize; |
691 | struct file *file = iocb->ki_filp; | ||
691 | struct fuse_conn *fc = fuse_get_conn(file); | 692 | struct fuse_conn *fc = fuse_get_conn(file); |
692 | if (!fc) | 693 | if (!fc) |
693 | return -EPERM; | 694 | return -EPERM; |
@@ -761,15 +762,6 @@ static ssize_t fuse_dev_readv(struct file *file, const struct iovec *iov, | |||
761 | return err; | 762 | return err; |
762 | } | 763 | } |
763 | 764 | ||
764 | static ssize_t fuse_dev_read(struct file *file, char __user *buf, | ||
765 | size_t nbytes, loff_t *off) | ||
766 | { | ||
767 | struct iovec iov; | ||
768 | iov.iov_len = nbytes; | ||
769 | iov.iov_base = buf; | ||
770 | return fuse_dev_readv(file, &iov, 1, off); | ||
771 | } | ||
772 | |||
773 | /* Look up request on processing list by unique ID */ | 765 | /* Look up request on processing list by unique ID */ |
774 | static struct fuse_req *request_find(struct fuse_conn *fc, u64 unique) | 766 | static struct fuse_req *request_find(struct fuse_conn *fc, u64 unique) |
775 | { | 767 | { |
@@ -814,15 +806,15 @@ static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out, | |||
814 | * it from the list and copy the rest of the buffer to the request. | 806 | * it from the list and copy the rest of the buffer to the request. |
815 | * The request is finished by calling request_end() | 807 | * The request is finished by calling request_end() |
816 | */ | 808 | */ |
817 | static ssize_t fuse_dev_writev(struct file *file, const struct iovec *iov, | 809 | static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov, |
818 | unsigned long nr_segs, loff_t *off) | 810 | unsigned long nr_segs, loff_t pos) |
819 | { | 811 | { |
820 | int err; | 812 | int err; |
821 | unsigned nbytes = iov_length(iov, nr_segs); | 813 | unsigned nbytes = iov_length(iov, nr_segs); |
822 | struct fuse_req *req; | 814 | struct fuse_req *req; |
823 | struct fuse_out_header oh; | 815 | struct fuse_out_header oh; |
824 | struct fuse_copy_state cs; | 816 | struct fuse_copy_state cs; |
825 | struct fuse_conn *fc = fuse_get_conn(file); | 817 | struct fuse_conn *fc = fuse_get_conn(iocb->ki_filp); |
826 | if (!fc) | 818 | if (!fc) |
827 | return -EPERM; | 819 | return -EPERM; |
828 | 820 | ||
@@ -898,15 +890,6 @@ static ssize_t fuse_dev_writev(struct file *file, const struct iovec *iov, | |||
898 | return err; | 890 | return err; |
899 | } | 891 | } |
900 | 892 | ||
901 | static ssize_t fuse_dev_write(struct file *file, const char __user *buf, | ||
902 | size_t nbytes, loff_t *off) | ||
903 | { | ||
904 | struct iovec iov; | ||
905 | iov.iov_len = nbytes; | ||
906 | iov.iov_base = (char __user *) buf; | ||
907 | return fuse_dev_writev(file, &iov, 1, off); | ||
908 | } | ||
909 | |||
910 | static unsigned fuse_dev_poll(struct file *file, poll_table *wait) | 893 | static unsigned fuse_dev_poll(struct file *file, poll_table *wait) |
911 | { | 894 | { |
912 | unsigned mask = POLLOUT | POLLWRNORM; | 895 | unsigned mask = POLLOUT | POLLWRNORM; |
@@ -1041,10 +1024,10 @@ static int fuse_dev_fasync(int fd, struct file *file, int on) | |||
1041 | const struct file_operations fuse_dev_operations = { | 1024 | const struct file_operations fuse_dev_operations = { |
1042 | .owner = THIS_MODULE, | 1025 | .owner = THIS_MODULE, |
1043 | .llseek = no_llseek, | 1026 | .llseek = no_llseek, |
1044 | .read = fuse_dev_read, | 1027 | .read = do_sync_read, |
1045 | .readv = fuse_dev_readv, | 1028 | .aio_read = fuse_dev_read, |
1046 | .write = fuse_dev_write, | 1029 | .write = do_sync_write, |
1047 | .writev = fuse_dev_writev, | 1030 | .aio_write = fuse_dev_write, |
1048 | .poll = fuse_dev_poll, | 1031 | .poll = fuse_dev_poll, |
1049 | .release = fuse_dev_release, | 1032 | .release = fuse_dev_release, |
1050 | .fasync = fuse_dev_fasync, | 1033 | .fasync = fuse_dev_fasync, |