diff options
author | Maxim Patlasov <mpatlasov@parallels.com> | 2012-12-14 10:20:51 -0500 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2013-04-17 15:50:59 -0400 |
commit | 36cf66ed9f871fc0d0911921fba5873df3ddb2dc (patch) | |
tree | 8a449efaf4eeb9f0044258d926711d5ebb03416f /fs/fuse/cuse.c | |
parent | 01e9d11a3e79035ca5cd89b035435acd4ba61ee1 (diff) |
fuse: make fuse_direct_io() aware about AIO
The patch implements passing "struct fuse_io_priv *io" down the stack up to
fuse_send_read/write where it is used to submit request asynchronously.
io->async==0 designates synchronous processing.
Non-trivial part of the patch is changes in fuse_direct_io(): resources
like fuse requests and user pages cannot be released immediately in async
case.
Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse/cuse.c')
-rw-r--r-- | fs/fuse/cuse.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c index c59c097eb2e9..b3aaf7b3578b 100644 --- a/fs/fuse/cuse.c +++ b/fs/fuse/cuse.c | |||
@@ -92,8 +92,9 @@ static ssize_t cuse_read(struct file *file, char __user *buf, size_t count, | |||
92 | { | 92 | { |
93 | loff_t pos = 0; | 93 | loff_t pos = 0; |
94 | struct iovec iov = { .iov_base = buf, .iov_len = count }; | 94 | struct iovec iov = { .iov_base = buf, .iov_len = count }; |
95 | struct fuse_io_priv io = { .async = 0, .file = file }; | ||
95 | 96 | ||
96 | return fuse_direct_io(file, &iov, 1, count, &pos, 0); | 97 | return fuse_direct_io(&io, &iov, 1, count, &pos, 0); |
97 | } | 98 | } |
98 | 99 | ||
99 | static ssize_t cuse_write(struct file *file, const char __user *buf, | 100 | static ssize_t cuse_write(struct file *file, const char __user *buf, |
@@ -101,12 +102,13 @@ static ssize_t cuse_write(struct file *file, const char __user *buf, | |||
101 | { | 102 | { |
102 | loff_t pos = 0; | 103 | loff_t pos = 0; |
103 | struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = count }; | 104 | struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = count }; |
105 | struct fuse_io_priv io = { .async = 0, .file = file }; | ||
104 | 106 | ||
105 | /* | 107 | /* |
106 | * No locking or generic_write_checks(), the server is | 108 | * No locking or generic_write_checks(), the server is |
107 | * responsible for locking and sanity checks. | 109 | * responsible for locking and sanity checks. |
108 | */ | 110 | */ |
109 | return fuse_direct_io(file, &iov, 1, count, &pos, 1); | 111 | return fuse_direct_io(&io, &iov, 1, count, &pos, 1); |
110 | } | 112 | } |
111 | 113 | ||
112 | static int cuse_open(struct inode *inode, struct file *file) | 114 | static int cuse_open(struct inode *inode, struct file *file) |