* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define SOCKET_WRAPPER_NOT_REPLACE
+
#include "includes.h"
#include "system/filesys.h"
#include "system/shmem.h"
return data;
}
-static void aio_child_loop(int sockfd, struct mmap_area *map)
+static void aio_child_loop(int sockfd, struct mmap_area *map, int snum)
{
while (true) {
int fd = -1;
cmd_struct.read_cmd ? "read" : "write",
(int)cmd_struct.n, (int)cmd_struct.offset, fd));
-#ifdef ENABLE_BUILD_FARM_HACKS
+#if 1
+ //def ENABLE_BUILD_FARM_HACKS
{
+#if 1
/*
* In the build farm, we want erratic behaviour for
* async I/O times
*/
generate_random_buffer(&randval, sizeof(randval));
msecs = randval + 20;
+#endif
+ msecs = lp_parm_int(snum, "aio_fork", "sleep", 0);
DEBUG(10, ("delaying for %u msecs\n", msecs));
smb_msleep(msecs);
}
return NULL;
}
-static NTSTATUS create_aio_child(struct smbd_server_connection *sconn,
+static NTSTATUS create_aio_child(struct connection_struct *conn,
struct aio_child_list *children,
size_t map_size,
struct aio_child **presult)
{
+ struct smbd_server_connection *sconn = conn->sconn;
struct aio_child *result;
int fdpair[2];
NTSTATUS status;
close(fdpair[0]);
result->sockfd = fdpair[1];
files_forall(sconn, close_fsp_fd, NULL);
- aio_child_loop(result->sockfd, result->map);
+ aio_child_loop(result->sockfd, result->map, SNUM(conn));
}
DEBUG(10, ("Child %d created with sockfd %d\n",
if (child == NULL) {
DEBUG(10, ("no idle child found, creating new one\n"));
- status = create_aio_child(handle->conn->sconn, children,
+ status = create_aio_child(handle->conn, children,
128*1024, &child);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("create_aio_child failed: %s\n",