svn commit: samba r20541 - in branches: SAMBA_3_0/source/smbd
SAMBA_3_0_24/source/smbd
vlendec at samba.org
vlendec at samba.org
Fri Jan 5 11:19:00 GMT 2007
Author: vlendec
Date: 2007-01-05 11:18:59 +0000 (Fri, 05 Jan 2007)
New Revision: 20541
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20541
Log:
Fix some obvious glitches in wait_for_aio_completion. Hmmm. It seems
reply_close() at its heart is going to be an async call :-)
Volker
Modified:
branches/SAMBA_3_0/source/smbd/aio.c
branches/SAMBA_3_0_24/source/smbd/aio.c
Changeset:
Modified: branches/SAMBA_3_0/source/smbd/aio.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/aio.c 2007-01-05 10:31:54 UTC (rev 20540)
+++ branches/SAMBA_3_0/source/smbd/aio.c 2007-01-05 11:18:59 UTC (rev 20541)
@@ -580,14 +580,13 @@
#define SMB_TIME_FOR_AIO_COMPLETE_WAIT 29
-BOOL wait_for_aio_completion(files_struct *fsp)
+int wait_for_aio_completion(files_struct *fsp)
{
struct aio_extra *aio_ex;
const SMB_STRUCT_AIOCB **aiocb_list;
int aio_completion_count = 0;
time_t start_time = time(NULL);
int seconds_left;
- int ret = 0;
for (seconds_left = SMB_TIME_FOR_AIO_COMPLETE_WAIT; seconds_left >= 0;) {
int err = 0;
@@ -602,7 +601,7 @@
}
if (!aio_completion_count) {
- return ret;
+ return 0;
}
DEBUG(3,("wait_for_aio_completion: waiting for %d aio events to complete.\n",
@@ -610,7 +609,7 @@
aiocb_list = SMB_MALLOC_ARRAY(const SMB_STRUCT_AIOCB *, aio_completion_count);
if (!aiocb_list) {
- return False;
+ return ENOMEM;
}
for( i = 0, aio_ex = aio_list_head; aio_ex; aio_ex = aio_ex->next) {
@@ -637,7 +636,7 @@
/* Timeout. */
cancel_aio_by_fsp(fsp);
SAFE_FREE(aiocb_list);
- return ret ? ret : EIO;
+ return EIO;
}
/* One or more events might have completed - process them if so. */
@@ -666,7 +665,7 @@
DEBUG(10,("wait_for_aio_completion: aio_suspend timed out waiting for %d events\n",
aio_completion_count));
- return ret ? ret : EIO;
+ return EIO;
}
/****************************************************************************
Modified: branches/SAMBA_3_0_24/source/smbd/aio.c
===================================================================
--- branches/SAMBA_3_0_24/source/smbd/aio.c 2007-01-05 10:31:54 UTC (rev 20540)
+++ branches/SAMBA_3_0_24/source/smbd/aio.c 2007-01-05 11:18:59 UTC (rev 20541)
@@ -580,14 +580,13 @@
#define SMB_TIME_FOR_AIO_COMPLETE_WAIT 29
-BOOL wait_for_aio_completion(files_struct *fsp)
+int wait_for_aio_completion(files_struct *fsp)
{
struct aio_extra *aio_ex;
const SMB_STRUCT_AIOCB **aiocb_list;
int aio_completion_count = 0;
time_t start_time = time(NULL);
int seconds_left;
- int ret = 0;
for (seconds_left = SMB_TIME_FOR_AIO_COMPLETE_WAIT; seconds_left >= 0;) {
int err = 0;
@@ -602,7 +601,7 @@
}
if (!aio_completion_count) {
- return ret;
+ return 0;
}
DEBUG(3,("wait_for_aio_completion: waiting for %d aio events to complete.\n",
@@ -610,7 +609,7 @@
aiocb_list = SMB_MALLOC_ARRAY(const SMB_STRUCT_AIOCB *, aio_completion_count);
if (!aiocb_list) {
- return False;
+ return ENOMEM;
}
for( i = 0, aio_ex = aio_list_head; aio_ex; aio_ex = aio_ex->next) {
@@ -637,7 +636,7 @@
/* Timeout. */
cancel_aio_by_fsp(fsp);
SAFE_FREE(aiocb_list);
- return ret ? ret : EIO;
+ return EIO;
}
/* One or more events might have completed - process them if so. */
@@ -666,7 +665,7 @@
DEBUG(10,("wait_for_aio_completion: aio_suspend timed out waiting for %d events\n",
aio_completion_count));
- return ret ? ret : EIO;
+ return EIO;
}
/****************************************************************************
More information about the samba-cvs
mailing list