summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_read.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-06-10 13:20:37 -0700
committerJeremy Allison <jra@samba.org>2010-06-10 13:20:37 -0700
commit321d7a6303b651cc2533f4b72dc7cef6b7d64da4 (patch)
tree6f5a24f98802ceaa5eded1dd7d1bfe2288f5520b /source3/smbd/smb2_read.c
parentedd8940e1864deedaf0f6484809def586ac215f2 (diff)
downloadsamba-321d7a6303b651cc2533f4b72dc7cef6b7d64da4.tar.gz
samba-321d7a6303b651cc2533f4b72dc7cef6b7d64da4.tar.bz2
samba-321d7a6303b651cc2533f4b72dc7cef6b7d64da4.zip
Implement AIO in SMB2. Doesn't allow cancel calls yet (to be added).
Jeremy.
Diffstat (limited to 'source3/smbd/smb2_read.c')
-rw-r--r--source3/smbd/smb2_read.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c
index 3e1162fb92..7f3bc35616 100644
--- a/source3/smbd/smb2_read.c
+++ b/source3/smbd/smb2_read.c
@@ -322,6 +322,34 @@ static struct tevent_req *smbd_smb2_read_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
+ status = schedule_smb2_aio_read(fsp->conn,
+ smbreq,
+ fsp,
+ (char *)state->out_data.data,
+ (SMB_OFF_T)in_offset,
+ (size_t)in_length);
+
+ if (NT_STATUS_IS_OK(status)) {
+ /*
+ * Doing an async read. Don't
+ * send a "gone async" message
+ * as we expect this to be less
+ * than the client timeout period.
+ * JRA. FIXME for offline files..
+ * FIXME. Add cancel code..
+ */
+ smb2req->async = true;
+ return req;
+ }
+
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_RETRY)) {
+ /* Real error in setting up aio. Fail. */
+ tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
+ return tevent_req_post(req, ev);
+ }
+
+ /* Fallback to synchronous. */
+
init_strict_lock_struct(fsp,
in_file_id_volatile,
in_offset,