smbd: add an effective {smb,smbd_smb2}_request->ev_ctx that holds the event context...
[amitay/samba.git] / source3 / smbd / aio.c
index b984036e9f8e31a8eb6ca4c23e4e70a9f342b280..c066ea1a97886fcb9695540aa0cc495486c5a7ff 100644 (file)
@@ -206,7 +206,7 @@ NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
        aio_ex->nbyte = smb_maxcnt;
        aio_ex->offset = startpos;
 
-       req = SMB_VFS_PREAD_SEND(aio_ex, fsp->conn->sconn->ev_ctx,
+       req = SMB_VFS_PREAD_SEND(aio_ex, smbreq->ev_ctx,
                                 fsp,
                                 smb_buf(aio_ex->outbuf.data) + 1 /* pad */,
                                 smb_maxcnt, startpos);
@@ -459,7 +459,7 @@ NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
        aio_ex->nbyte = numtowrite;
        aio_ex->offset = startpos;
 
-       req = pwrite_fsync_send(aio_ex, fsp->conn->sconn->ev_ctx, fsp,
+       req = pwrite_fsync_send(aio_ex, smbreq->ev_ctx, fsp,
                                data, numtowrite, startpos,
                                aio_ex->write_through);
        if (req == NULL) {
@@ -701,7 +701,7 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
        aio_ex->nbyte = smb_maxcnt;
        aio_ex->offset = startpos;
 
-       req = SMB_VFS_PREAD_SEND(aio_ex, fsp->conn->sconn->ev_ctx, fsp,
+       req = SMB_VFS_PREAD_SEND(aio_ex, smbreq->ev_ctx, fsp,
                                 preadbuf->data, smb_maxcnt, startpos);
        if (req == NULL) {
                DEBUG(0, ("smb2: SMB_VFS_PREAD_SEND failed. "
@@ -850,7 +850,7 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
        aio_ex->nbyte = in_data.length;
        aio_ex->offset = in_offset;
 
-       req = pwrite_fsync_send(aio_ex, fsp->conn->sconn->ev_ctx, fsp,
+       req = pwrite_fsync_send(aio_ex, smbreq->ev_ctx, fsp,
                                in_data.data, in_data.length, in_offset,
                                write_through);
        if (req == NULL) {