diff options
Diffstat (limited to 'source3/smbd/aio.c')
-rw-r--r-- | source3/smbd/aio.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c index f4c4aaec41..0ba857e2e5 100644 --- a/source3/smbd/aio.c +++ b/source3/smbd/aio.c @@ -284,11 +284,10 @@ BOOL schedule_aio_read_and_X(connection_struct *conn, *****************************************************************************/ BOOL schedule_aio_write_and_X(connection_struct *conn, - char *inbuf, char *outbuf, - int length, int len_outbuf, - files_struct *fsp, char *data, - SMB_OFF_T startpos, - size_t numtowrite) + struct smb_request *req, + files_struct *fsp, char *data, + SMB_OFF_T startpos, + size_t numtowrite) { struct aio_extra *aio_ex; SMB_STRUCT_AIOCB *a; @@ -306,7 +305,7 @@ BOOL schedule_aio_write_and_X(connection_struct *conn, /* Only do this on non-chained and non-chaining reads not using the * write cache. */ - if (chain_size !=0 || (CVAL(inbuf,smb_vwv0) != 0xFF) + if (chain_size !=0 || (CVAL(req->inbuf,smb_vwv0) != 0xFF) || (lp_write_cache_size(SNUM(conn)) != 0) ) { return False; } @@ -320,23 +319,25 @@ BOOL schedule_aio_write_and_X(connection_struct *conn, "(mid = %u)\n", fsp->fsp_name, (double)startpos, (unsigned int)numtowrite, - (unsigned int)SVAL(inbuf,smb_mid) )); + (unsigned int)req->mid )); return False; } - inbufsize = smb_len(inbuf) + 4; - outbufsize = smb_len(outbuf) + 4; + inbufsize = smb_len(req->inbuf) + 4; + reply_outbuf(req, 6, 0); + outbufsize = smb_len(req->outbuf) + 4; if (!(aio_ex = create_aio_ex_write(fsp, inbufsize, outbufsize, - SVAL(inbuf,smb_mid)))) { + req->mid))) { DEBUG(0,("schedule_aio_write_and_X: malloc fail.\n")); return False; } /* Copy the SMB header already setup in outbuf. */ - memcpy(aio_ex->inbuf, inbuf, inbufsize); + memcpy(aio_ex->inbuf, req->inbuf, inbufsize); /* Copy the SMB header already setup in outbuf. */ - memcpy(aio_ex->outbuf, outbuf, outbufsize); + memcpy(aio_ex->outbuf, req->outbuf, outbufsize); + TALLOC_FREE(req->outbuf); SCVAL(aio_ex->outbuf,smb_vwv0,0xFF); /* Never a chained reply. */ a = &aio_ex->acb; @@ -344,7 +345,7 @@ BOOL schedule_aio_write_and_X(connection_struct *conn, /* Now set up the aio record for the write call. */ a->aio_fildes = fsp->fh->fd; - a->aio_buf = aio_ex->inbuf + (PTR_DIFF(data, inbuf)); + a->aio_buf = aio_ex->inbuf + (PTR_DIFF(data, req->inbuf)); a->aio_nbytes = numtowrite; a->aio_offset = startpos; a->aio_sigevent.sigev_notify = SIGEV_SIGNAL; @@ -633,11 +634,10 @@ BOOL schedule_aio_read_and_X(connection_struct *conn, } BOOL schedule_aio_write_and_X(connection_struct *conn, - char *inbuf, char *outbuf, - int length, int len_outbuf, - files_struct *fsp, char *data, - SMB_OFF_T startpos, - size_t numtowrite) + struct smb_request *req, + files_struct *fsp, char *data, + SMB_OFF_T startpos, + size_t numtowrite) { return False; } |