summaryrefslogtreecommitdiff
path: root/source3/smbd/aio.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-04-08 20:11:53 +0200
committerVolker Lendecke <vl@samba.org>2012-04-09 18:04:55 +0200
commiteff36099c12e936a880c9f2e102b9cf8a7166d40 (patch)
tree34fc3d16d4e9199926eebf9dc2b81cd488949577 /source3/smbd/aio.c
parent7da56a1e37f20d1674e2f1208e4b1f3ca1aad380 (diff)
downloadsamba-eff36099c12e936a880c9f2e102b9cf8a7166d40.tar.gz
samba-eff36099c12e936a880c9f2e102b9cf8a7166d40.tar.bz2
samba-eff36099c12e936a880c9f2e102b9cf8a7166d40.zip
s3: Move the aio signal init to the vfs module
On platforms that don't have an RT signal space, signal initialization fails. aio_fork and aio_pthread don't need the signal, so this would block them from running as well.
Diffstat (limited to 'source3/smbd/aio.c')
-rw-r--r--source3/smbd/aio.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 000206a985..e5347a45a4 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -71,7 +71,7 @@ static void smbd_aio_signal_handler(struct tevent_context *ev_ctx,
}
-static bool initialize_async_io_handler(void)
+bool initialize_async_io_handler(void)
{
static bool tried_signal_setup = false;
@@ -156,11 +156,6 @@ NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
size_t min_aio_read_size = lp_aio_read_size(SNUM(conn));
int ret;
- /* Ensure aio is initialized. */
- if (!initialize_async_io_handler()) {
- return NT_STATUS_RETRY;
- }
-
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
DEBUG(10, ("AIO on streams not yet supported\n"));
@@ -263,11 +258,6 @@ NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
size_t min_aio_write_size = lp_aio_write_size(SNUM(conn));
int ret;
- /* Ensure aio is initialized. */
- if (!initialize_async_io_handler()) {
- return NT_STATUS_RETRY;
- }
-
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
DEBUG(10, ("AIO on streams not yet supported\n"));
@@ -426,11 +416,6 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
size_t min_aio_read_size = lp_aio_read_size(SNUM(conn));
int ret;
- /* Ensure aio is initialized. */
- if (!initialize_async_io_handler()) {
- return NT_STATUS_RETRY;
- }
-
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
DEBUG(10, ("AIO on streams not yet supported\n"));
@@ -532,11 +517,6 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
size_t min_aio_write_size = lp_aio_write_size(SNUM(conn));
int ret;
- /* Ensure aio is initialized. */
- if (!initialize_async_io_handler()) {
- return NT_STATUS_RETRY;
- }
-
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
DEBUG(10, ("AIO on streams not yet supported\n"));
@@ -1058,6 +1038,12 @@ void cancel_aio_by_fsp(files_struct *fsp)
}
#else
+
+bool initialize_async_io_handler(void)
+{
+ return false;
+}
+
NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
struct smb_request *smbreq,
files_struct *fsp, off_t startpos,