summaryrefslogtreecommitdiff
path: root/source3/smbd/aio.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-11 16:28:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:30 -0500
commit921fbb25eb4a6097a1e960abadc4dc4b11d32cf6 (patch)
treebb264bb4be703daea814ee143cb19a031bac93e4 /source3/smbd/aio.c
parentef6c3a3c7a62188112561781449f05e25ccee58e (diff)
downloadsamba-921fbb25eb4a6097a1e960abadc4dc4b11d32cf6.tar.gz
samba-921fbb25eb4a6097a1e960abadc4dc4b11d32cf6.tar.bz2
samba-921fbb25eb4a6097a1e960abadc4dc4b11d32cf6.zip
r24332: schedule_aio_read_and_X does not need InBuf/OutBuf
(This used to be commit 9ad91bd20592850d7b6393e1ac7f0e0919d69668)
Diffstat (limited to 'source3/smbd/aio.c')
-rw-r--r--source3/smbd/aio.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 0ba857e2e5..49855796b7 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -51,7 +51,7 @@ static struct aio_extra *aio_list_head;
static struct aio_extra *create_aio_ex_read(files_struct *fsp,
size_t buflen,
uint16 mid,
- const char *inbuf)
+ const uint8 *inbuf)
{
struct aio_extra *aio_ex = SMB_MALLOC_P(struct aio_extra);
@@ -203,8 +203,7 @@ void initialize_async_io_handler(void)
*****************************************************************************/
BOOL schedule_aio_read_and_X(connection_struct *conn,
- char *inbuf, char *outbuf,
- int length, int len_outbuf,
+ struct smb_request *req,
files_struct *fsp, SMB_OFF_T startpos,
size_t smb_maxcnt)
{
@@ -224,7 +223,7 @@ BOOL schedule_aio_read_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;
}
@@ -236,18 +235,19 @@ BOOL schedule_aio_read_and_X(connection_struct *conn,
return False;
}
- /* The following is safe from integer wrap as we've already
- checked smb_maxcnt is 128k or less. */
- bufsize = PTR_DIFF(smb_buf(outbuf),outbuf) + smb_maxcnt;
+ /* The following is safe from integer wrap as we've already checked
+ smb_maxcnt is 128k or less. Wct is 12 for read replies */
+
+ bufsize = smb_size + 12 * 2 + smb_maxcnt;
- if ((aio_ex = create_aio_ex_read(fsp, bufsize,
- SVAL(inbuf,smb_mid), inbuf)) == NULL) {
+ if (!(aio_ex = create_aio_ex_read(fsp, bufsize, req->mid,
+ req->inbuf))) {
DEBUG(10,("schedule_aio_read_and_X: malloc fail.\n"));
return False;
}
- /* Copy the SMB header already setup in outbuf. */
- memcpy(aio_ex->outbuf, outbuf, smb_buf(outbuf) - outbuf);
+ construct_reply_common((char *)req->inbuf, aio_ex->outbuf);
+ set_message((char *)req->inbuf, aio_ex->outbuf, 12, 0, True);
SCVAL(aio_ex->outbuf,smb_vwv0,0xFF); /* Never a chained reply. */
a = &aio_ex->acb;
@@ -625,8 +625,7 @@ int process_aio_queue(void)
}
BOOL schedule_aio_read_and_X(connection_struct *conn,
- char *inbuf, char *outbuf,
- int length, int len_outbuf,
+ struct smb_request *req,
files_struct *fsp, SMB_OFF_T startpos,
size_t smb_maxcnt)
{