[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-test-2512-g8f86f7f
Volker Lendecke
vl at samba.org
Sun Feb 24 11:18:10 GMT 2008
The branch, v3-2-test has been updated
via 8f86f7f25c4eb71bbdfcc6bf2d12eaaae9a8d9ec (commit)
via 9a069d306bb6f8a2cd51b8ba87b433884942d13f (commit)
from 213ba3a719e77979c04b872f1d82f68e87287cb0 (commit)
http://gitweb.samba.org/?samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 8f86f7f25c4eb71bbdfcc6bf2d12eaaae9a8d9ec
Author: Volker Lendecke <vl at samba.org>
Date: Sun Feb 24 11:32:22 2008 +0100
Allow "max mux" async i/o requests
In the negprot reply, we allowed the client to issued "max mux" concurrent
requests. The OS might allow less, for example AFAIK AIX has a configurable
limit of concurrent AIO requests. We will fall back to sync operation for the
requests that are too many when aio_read/aio_write return an error.
Jeremy, please check!
commit 9a069d306bb6f8a2cd51b8ba87b433884942d13f
Author: Volker Lendecke <vl at samba.org>
Date: Sun Feb 24 11:39:57 2008 +0100
Export aio_request_done()
This is for external modules implementing the Posix AIO API that not
necessarily depend on the signal mechanism to indicate completion.
-----------------------------------------------------------------------
Summary of changes:
source/smbd/aio.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/smbd/aio.c b/source/smbd/aio.c
index 59dd9a9..2889e3c 100644
--- a/source/smbd/aio.c
+++ b/source/smbd/aio.c
@@ -141,21 +141,27 @@ static struct aio_extra *find_aio_ex(uint16 mid)
We can have these many aio buffers in flight.
*****************************************************************************/
-#define AIO_PENDING_SIZE 10
+static int aio_pending_size;
static sig_atomic_t signals_received;
static int outstanding_aio_calls;
-static uint16 aio_pending_array[AIO_PENDING_SIZE];
+static uint16 *aio_pending_array;
/****************************************************************************
Signal handler when an aio request completes.
*****************************************************************************/
-static void signal_handler(int sig, siginfo_t *info, void *unused)
+void aio_request_done(uint16_t mid)
{
- if (signals_received < AIO_PENDING_SIZE) {
- aio_pending_array[signals_received] = info->si_value.sival_int;
+ if (signals_received < aio_pending_size) {
+ aio_pending_array[signals_received] = mid;
signals_received++;
- } /* Else signal is lost. */
+ }
+ /* Else signal is lost. */
+}
+
+static void signal_handler(int sig, siginfo_t *info, void *unused)
+{
+ aio_request_done(info->si_value.sival_int);
sys_select_signal(RT_SIGNAL_AIO);
}
@@ -176,6 +182,10 @@ void initialize_async_io_handler(void)
{
struct sigaction act;
+ aio_pending_size = lp_maxmux();
+ aio_pending_array = SMB_MALLOC_ARRAY(uint16, aio_pending_size);
+ SMB_ASSERT(aio_pending_array != NULL);
+
ZERO_STRUCT(act);
act.sa_sigaction = signal_handler;
act.sa_flags = SA_SIGINFO;
@@ -225,7 +235,7 @@ bool schedule_aio_read_and_X(connection_struct *conn,
return False;
}
- if (outstanding_aio_calls >= AIO_PENDING_SIZE) {
+ if (outstanding_aio_calls >= aio_pending_size) {
DEBUG(10,("schedule_aio_read_and_X: Already have %d aio "
"activities outstanding.\n",
outstanding_aio_calls ));
@@ -314,7 +324,7 @@ bool schedule_aio_write_and_X(connection_struct *conn,
return False;
}
- if (outstanding_aio_calls >= AIO_PENDING_SIZE) {
+ if (outstanding_aio_calls >= aio_pending_size) {
DEBUG(3,("schedule_aio_write_and_X: Already have %d aio "
"activities outstanding.\n",
outstanding_aio_calls ));
--
Samba Shared Repository
More information about the samba-cvs
mailing list