Thread (11 messages) 11 messages, 3 authors, 2015-03-19
STALE4105d
Revisions (3)
  1. rfc [diff vs current]
  2. v2 current
  3. v3 [diff vs current]

[PATCH v2 net-next 2/4] aio: prefer aio_op op over iter_op

From: Tadeusz Struk <hidden>
Date: 2015-03-16 16:15:19
Also in: linux-crypto, linux-fsdevel
Subsystem: aio, filesystems (vfs and infrastructure), the rest · Maintainers: Benjamin LaHaise, Alexander Viro, Christian Brauner, Linus Torvalds

AIO interface should prefer AIO operations over iter_op

Signed-off-by: Tadeusz Struk <redacted>
---
 fs/aio.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/aio.c b/fs/aio.c
index f8e52a1..389f4dd 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1449,11 +1449,15 @@ rw_common:
 		if (rw == WRITE)
 			file_start_write(file);
 
-		if (iter_op) {
+		if (rw_op) {
+			ret = rw_op(req, iovec, nr_segs, req->ki_pos);
+		} else if (iter_op) {
 			iov_iter_init(&iter, rw, iovec, nr_segs, req->ki_nbytes);
 			ret = iter_op(req, &iter);
 		} else {
-			ret = rw_op(req, iovec, nr_segs, req->ki_pos);
+			if (iovec != inline_vecs)
+				kfree(iovec);
+			return -EINVAL;
 		}
 
 		if (rw == WRITE)

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help