diff options
Diffstat (limited to 'arch/um/os-Linux/aio.c')
-rw-r--r-- | arch/um/os-Linux/aio.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c index 6ff12743a0bd..c1f0f76291cf 100644 --- a/arch/um/os-Linux/aio.c +++ b/arch/um/os-Linux/aio.c | |||
@@ -146,28 +146,21 @@ static int aio_thread(void *arg) | |||
146 | static int do_not_aio(struct aio_thread_req *req) | 146 | static int do_not_aio(struct aio_thread_req *req) |
147 | { | 147 | { |
148 | char c; | 148 | char c; |
149 | unsigned long long actual; | ||
149 | int err; | 150 | int err; |
150 | 151 | ||
152 | actual = lseek64(req->io_fd, req->offset, SEEK_SET); | ||
153 | if(actual != req->offset) | ||
154 | return -errno; | ||
155 | |||
151 | switch(req->type){ | 156 | switch(req->type){ |
152 | case AIO_READ: | 157 | case AIO_READ: |
153 | err = os_seek_file(req->io_fd, req->offset); | ||
154 | if(err) | ||
155 | goto out; | ||
156 | |||
157 | err = os_read_file(req->io_fd, req->buf, req->len); | 158 | err = os_read_file(req->io_fd, req->buf, req->len); |
158 | break; | 159 | break; |
159 | case AIO_WRITE: | 160 | case AIO_WRITE: |
160 | err = os_seek_file(req->io_fd, req->offset); | ||
161 | if(err) | ||
162 | goto out; | ||
163 | |||
164 | err = os_write_file(req->io_fd, req->buf, req->len); | 161 | err = os_write_file(req->io_fd, req->buf, req->len); |
165 | break; | 162 | break; |
166 | case AIO_MMAP: | 163 | case AIO_MMAP: |
167 | err = os_seek_file(req->io_fd, req->offset); | ||
168 | if(err) | ||
169 | goto out; | ||
170 | |||
171 | err = os_read_file(req->io_fd, &c, sizeof(c)); | 164 | err = os_read_file(req->io_fd, &c, sizeof(c)); |
172 | break; | 165 | break; |
173 | default: | 166 | default: |
@@ -176,7 +169,6 @@ static int do_not_aio(struct aio_thread_req *req) | |||
176 | break; | 169 | break; |
177 | } | 170 | } |
178 | 171 | ||
179 | out: | ||
180 | return err; | 172 | return err; |
181 | } | 173 | } |
182 | 174 | ||
@@ -207,7 +199,7 @@ static int not_aio_thread(void *arg) | |||
207 | } | 199 | } |
208 | err = do_not_aio(&req); | 200 | err = do_not_aio(&req); |
209 | reply = ((struct aio_thread_reply) { .data = req.aio, | 201 | reply = ((struct aio_thread_reply) { .data = req.aio, |
210 | .err = err }); | 202 | .err = err }); |
211 | err = os_write_file(req.aio->reply_fd, &reply, sizeof(reply)); | 203 | err = os_write_file(req.aio->reply_fd, &reply, sizeof(reply)); |
212 | if(err != sizeof(reply)) | 204 | if(err != sizeof(reply)) |
213 | printk("not_aio_thread - write failed, fd = %d, " | 205 | printk("not_aio_thread - write failed, fd = %d, " |