From fc099a72f42768829d5e146720a9e2ce5a9032a4 Mon Sep 17 00:00:00 2001 From: Olaf Flebbe Date: Wed, 30 Sep 2009 14:55:58 +0200 Subject: [PATCH] allow for outstanding_aio_calls to be decremented --- source3/smbd/aio.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c index fbfec46..e5e522c 100644 --- a/source3/smbd/aio.c +++ b/source3/smbd/aio.c @@ -187,6 +187,7 @@ bool schedule_aio_read_and_X(connection_struct *conn, return False; } + outstanding_aio_calls++; aio_ex->req = talloc_move(aio_ex, &req); DEBUG(10,("schedule_aio_read_and_X: scheduled aio_read for file %s, " @@ -195,7 +196,6 @@ bool schedule_aio_read_and_X(connection_struct *conn, (unsigned int)aio_ex->req->mid )); srv_defer_sign_response(aio_ex->req->mid); - outstanding_aio_calls++; return True; } @@ -283,6 +283,7 @@ bool schedule_aio_write_and_X(connection_struct *conn, return False; } + outstanding_aio_calls++; aio_ex->req = talloc_move(aio_ex, &req); /* This should actually be improved to span the write. */ @@ -307,7 +308,6 @@ bool schedule_aio_write_and_X(connection_struct *conn, } else { srv_defer_sign_response(aio_ex->req->mid); } - outstanding_aio_calls++; DEBUG(10,("schedule_aio_write_and_X: scheduled aio_write for file " "%s, offset %.0f, len = %u (mid = %u) " @@ -523,6 +523,8 @@ void smbd_aio_complete_mid(unsigned int mid) struct aio_extra *aio_ex = find_aio_ex(mid); int ret = 0; + outstanding_aio_calls--; + DEBUG(10,("smbd_aio_complete_mid: mid[%u]\n", mid)); if (!aio_ex) { -- 1.6.0.2