@@ -680,14 +680,15 @@ static int fuse_read_interrupt(struct fuse_conn *fc, struct fuse_req *req,
680
680
* request_end(). Otherwise add it to the processing list, and set
681
681
* the 'sent' flag.
682
682
*/
683
- static ssize_t fuse_dev_readv (struct file * file , const struct iovec * iov ,
684
- unsigned long nr_segs , loff_t * off )
683
+ static ssize_t fuse_dev_read (struct kiocb * iocb , const struct iovec * iov ,
684
+ unsigned long nr_segs , loff_t pos )
685
685
{
686
686
int err ;
687
687
struct fuse_req * req ;
688
688
struct fuse_in * in ;
689
689
struct fuse_copy_state cs ;
690
690
unsigned reqsize ;
691
+ struct file * file = iocb -> ki_filp ;
691
692
struct fuse_conn * fc = fuse_get_conn (file );
692
693
if (!fc )
693
694
return - EPERM ;
@@ -761,15 +762,6 @@ static ssize_t fuse_dev_readv(struct file *file, const struct iovec *iov,
761
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
765
/* Look up request on processing list by unique ID */
774
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
806
* it from the list and copy the rest of the buffer to the request.
815
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 ,
818
- unsigned long nr_segs , loff_t * off )
809
+ static ssize_t fuse_dev_write (struct kiocb * iocb , const struct iovec * iov ,
810
+ unsigned long nr_segs , loff_t pos )
819
811
{
820
812
int err ;
821
813
unsigned nbytes = iov_length (iov , nr_segs );
822
814
struct fuse_req * req ;
823
815
struct fuse_out_header oh ;
824
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
818
if (!fc )
827
819
return - EPERM ;
828
820
@@ -898,15 +890,6 @@ static ssize_t fuse_dev_writev(struct file *file, const struct iovec *iov,
898
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
893
static unsigned fuse_dev_poll (struct file * file , poll_table * wait )
911
894
{
912
895
unsigned mask = POLLOUT | POLLWRNORM ;
@@ -1041,10 +1024,10 @@ static int fuse_dev_fasync(int fd, struct file *file, int on)
1041
1024
const struct file_operations fuse_dev_operations = {
1042
1025
.owner = THIS_MODULE ,
1043
1026
.llseek = no_llseek ,
1044
- .read = fuse_dev_read ,
1045
- .readv = fuse_dev_readv ,
1046
- .write = fuse_dev_write ,
1047
- .writev = fuse_dev_writev ,
1027
+ .read = do_sync_read ,
1028
+ .aio_read = fuse_dev_read ,
1029
+ .write = do_sync_write ,
1030
+ .aio_write = fuse_dev_write ,
1048
1031
.poll = fuse_dev_poll ,
1049
1032
.release = fuse_dev_release ,
1050
1033
.fasync = fuse_dev_fasync ,
0 commit comments