return result;
}
-static int vfswrap_init_pool(struct smbd_server_connection *conn)
-{
- int ret;
-
- if (conn->pool != NULL) {
- return 0;
- }
-
- ret = pthreadpool_tevent_init(conn, lp_aio_max_threads(),
- &conn->pool);
- return ret;
-}
-
struct vfswrap_pread_state {
ssize_t ret;
int fd;
{
struct tevent_req *req, *subreq;
struct vfswrap_pread_state *state;
- int ret;
req = tevent_req_create(mem_ctx, &state, struct vfswrap_pread_state);
if (req == NULL) {
return NULL;
}
- ret = vfswrap_init_pool(handle->conn->sconn);
- if (tevent_req_error(req, ret)) {
- return tevent_req_post(req, ev);
- }
-
state->ret = -1;
state->fd = fsp->fh->fd;
state->buf = data;
{
struct tevent_req *req, *subreq;
struct vfswrap_pwrite_state *state;
- int ret;
req = tevent_req_create(mem_ctx, &state, struct vfswrap_pwrite_state);
if (req == NULL) {
return NULL;
}
- ret = vfswrap_init_pool(handle->conn->sconn);
- if (tevent_req_error(req, ret)) {
- return tevent_req_post(req, ev);
- }
-
state->ret = -1;
state->fd = fsp->fh->fd;
state->buf = data;
{
struct tevent_req *req, *subreq;
struct vfswrap_fsync_state *state;
- int ret;
req = tevent_req_create(mem_ctx, &state, struct vfswrap_fsync_state);
if (req == NULL) {
return NULL;
}
- ret = vfswrap_init_pool(handle->conn->sconn);
- if (tevent_req_error(req, ret)) {
- return tevent_req_post(req, ev);
- }
-
state->ret = -1;
state->fd = fsp->fh->fd;
#include "lib/id_cache.h"
#include "lib/util/sys_rw_data.h"
#include "system/threads.h"
+#include "lib/pthreadpool/pthreadpool_tevent.h"
/* Internal message queue for deferred opens. */
struct pending_message_list {
sconn->ev_ctx = ev_ctx;
sconn->msg_ctx = msg_ctx;
+ ret = pthreadpool_tevent_init(sconn, lp_aio_max_threads(),
+ &sconn->pool);
+ if (ret != 0) {
+ exit_server("pthreadpool_tevent_init() failed.");
+ }
+
if (lp_server_max_protocol() >= PROTOCOL_SMB2_02) {
/*
* We're not making the decision here,