aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r--fs/fuse/dev.c39
1 files changed, 12 insertions, 27 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 1e2006caf158..66571eafbb1e 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -212,6 +212,7 @@ void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req)
212 * Called with fc->lock, unlocks it 212 * Called with fc->lock, unlocks it
213 */ 213 */
214static void request_end(struct fuse_conn *fc, struct fuse_req *req) 214static void request_end(struct fuse_conn *fc, struct fuse_req *req)
215 __releases(fc->lock)
215{ 216{
216 void (*end) (struct fuse_conn *, struct fuse_req *) = req->end; 217 void (*end) (struct fuse_conn *, struct fuse_req *) = req->end;
217 req->end = NULL; 218 req->end = NULL;
@@ -640,6 +641,7 @@ static void request_wait(struct fuse_conn *fc)
640 */ 641 */
641static int fuse_read_interrupt(struct fuse_conn *fc, struct fuse_req *req, 642static int fuse_read_interrupt(struct fuse_conn *fc, struct fuse_req *req,
642 const struct iovec *iov, unsigned long nr_segs) 643 const struct iovec *iov, unsigned long nr_segs)
644 __releases(fc->lock)
643{ 645{
644 struct fuse_copy_state cs; 646 struct fuse_copy_state cs;
645 struct fuse_in_header ih; 647 struct fuse_in_header ih;
@@ -678,14 +680,15 @@ static int fuse_read_interrupt(struct fuse_conn *fc, struct fuse_req *req,
678 * request_end(). Otherwise add it to the processing list, and set 680 * request_end(). Otherwise add it to the processing list, and set
679 * the 'sent' flag. 681 * the 'sent' flag.
680 */ 682 */
681static ssize_t fuse_dev_readv(struct file *file, const struct iovec *iov, 683static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov,
682 unsigned long nr_segs, loff_t *off) 684 unsigned long nr_segs, loff_t pos)
683{ 685{
684 int err; 686 int err;
685 struct fuse_req *req; 687 struct fuse_req *req;
686 struct fuse_in *in; 688 struct fuse_in *in;
687 struct fuse_copy_state cs; 689 struct fuse_copy_state cs;
688 unsigned reqsize; 690 unsigned reqsize;
691 struct file *file = iocb->ki_filp;
689 struct fuse_conn *fc = fuse_get_conn(file); 692 struct fuse_conn *fc = fuse_get_conn(file);
690 if (!fc) 693 if (!fc)
691 return -EPERM; 694 return -EPERM;
@@ -759,15 +762,6 @@ static ssize_t fuse_dev_readv(struct file *file, const struct iovec *iov,
759 return err; 762 return err;
760} 763}
761 764
762static ssize_t fuse_dev_read(struct file *file, char __user *buf,
763 size_t nbytes, loff_t *off)
764{
765 struct iovec iov;
766 iov.iov_len = nbytes;
767 iov.iov_base = buf;
768 return fuse_dev_readv(file, &iov, 1, off);
769}
770
771/* Look up request on processing list by unique ID */ 765/* Look up request on processing list by unique ID */
772static struct fuse_req *request_find(struct fuse_conn *fc, u64 unique) 766static struct fuse_req *request_find(struct fuse_conn *fc, u64 unique)
773{ 767{
@@ -812,15 +806,15 @@ static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out,
812 * 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.
813 * The request is finished by calling request_end() 807 * The request is finished by calling request_end()
814 */ 808 */
815static ssize_t fuse_dev_writev(struct file *file, const struct iovec *iov, 809static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov,
816 unsigned long nr_segs, loff_t *off) 810 unsigned long nr_segs, loff_t pos)
817{ 811{
818 int err; 812 int err;
819 unsigned nbytes = iov_length(iov, nr_segs); 813 unsigned nbytes = iov_length(iov, nr_segs);
820 struct fuse_req *req; 814 struct fuse_req *req;
821 struct fuse_out_header oh; 815 struct fuse_out_header oh;
822 struct fuse_copy_state cs; 816 struct fuse_copy_state cs;
823 struct fuse_conn *fc = fuse_get_conn(file); 817 struct fuse_conn *fc = fuse_get_conn(iocb->ki_filp);
824 if (!fc) 818 if (!fc)
825 return -EPERM; 819 return -EPERM;
826 820
@@ -896,15 +890,6 @@ static ssize_t fuse_dev_writev(struct file *file, const struct iovec *iov,
896 return err; 890 return err;
897} 891}
898 892
899static ssize_t fuse_dev_write(struct file *file, const char __user *buf,
900 size_t nbytes, loff_t *off)
901{
902 struct iovec iov;
903 iov.iov_len = nbytes;
904 iov.iov_base = (char __user *) buf;
905 return fuse_dev_writev(file, &iov, 1, off);
906}
907
908static unsigned fuse_dev_poll(struct file *file, poll_table *wait) 893static unsigned fuse_dev_poll(struct file *file, poll_table *wait)
909{ 894{
910 unsigned mask = POLLOUT | POLLWRNORM; 895 unsigned mask = POLLOUT | POLLWRNORM;
@@ -1039,10 +1024,10 @@ static int fuse_dev_fasync(int fd, struct file *file, int on)
1039const struct file_operations fuse_dev_operations = { 1024const struct file_operations fuse_dev_operations = {
1040 .owner = THIS_MODULE, 1025 .owner = THIS_MODULE,
1041 .llseek = no_llseek, 1026 .llseek = no_llseek,
1042 .read = fuse_dev_read, 1027 .read = do_sync_read,
1043 .readv = fuse_dev_readv, 1028 .aio_read = fuse_dev_read,
1044 .write = fuse_dev_write, 1029 .write = do_sync_write,
1045 .writev = fuse_dev_writev, 1030 .aio_write = fuse_dev_write,
1046 .poll = fuse_dev_poll, 1031 .poll = fuse_dev_poll,
1047 .release = fuse_dev_release, 1032 .release = fuse_dev_release,
1048 .fasync = fuse_dev_fasync, 1033 .fasync = fuse_dev_fasync,