summaryrefslogtreecommitdiff
path: root/source3/smbd/aio.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-07-17 22:24:51 +0200
committerJeremy Allison <jra@samba.org>2012-07-18 15:57:53 -0700
commit3e9f58be7e56b7990417e3f97a2d215f3591289e (patch)
tree2bc154d5c7c2a2bbeb4ac6ab948c427dab340a60 /source3/smbd/aio.c
parent3da86cc23f20e5b852d08aa05dacabb2d6e496e2 (diff)
downloadsamba-3e9f58be7e56b7990417e3f97a2d215f3591289e.tar.gz
samba-3e9f58be7e56b7990417e3f97a2d215f3591289e.tar.bz2
samba-3e9f58be7e56b7990417e3f97a2d215f3591289e.zip
s3-smb1: Postpone close_file until all aio is handled
Thanks to Jeremy for this simple idea Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd/aio.c')
-rw-r--r--source3/smbd/aio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 1923ef889f..9f7390bba3 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -23,6 +23,7 @@
#include "smbd/globals.h"
#include "../lib/util/tevent_ntstatus.h"
#include "../lib/util/tevent_unix.h"
+#include "lib/tevent_wait.h"
/****************************************************************************
The buffer we keep around whilst an aio request is in process.
@@ -107,6 +108,10 @@ static int aio_del_req_from_fsp(struct aio_req_fsp_link *lnk)
}
fsp->num_aio_requests -= 1;
fsp->aio_requests[i] = fsp->aio_requests[fsp->num_aio_requests];
+
+ if (fsp->num_aio_requests == 0) {
+ tevent_wait_done(fsp->deferred_close);
+ }
return 0;
}