#include "system/shmem.h"
#include "smbd/smbd.h"
#include "smbd/globals.h"
-#include "lib/pthreadpool/pthreadpool.h"
+#include "../lib/pthreadpool/pthreadpool_pipe.h"
#ifdef HAVE_LINUX_FALLOC_H
#include <linux/falloc.h>
#endif
***********************************************************************/
static bool init_aio_threadpool(struct tevent_context *ev_ctx,
- struct pthreadpool **pp_pool,
+ struct pthreadpool_pipe **pp_pool,
void (*completion_fn)(struct tevent_context *,
struct tevent_fd *,
uint16_t,
return true;
}
- ret = pthreadpool_init(aio_pending_size, pp_pool);
+ ret = pthreadpool_pipe_init(lp_aio_max_threads(), pp_pool);
if (ret) {
errno = ret;
return false;
}
sock_event = tevent_add_fd(ev_ctx,
NULL,
- pthreadpool_signal_fd(*pp_pool),
+ pthreadpool_pipe_signal_fd(*pp_pool),
TEVENT_FD_READ,
completion_fn,
NULL);
if (sock_event == NULL) {
- pthreadpool_destroy(*pp_pool);
+ pthreadpool_pipe_destroy(*pp_pool);
*pp_pool = NULL;
return false;
}
DEBUG(10,("init_aio_threadpool: initialized with up to %d threads\n",
- aio_pending_size));
+ (int)lp_aio_max_threads()));
return true;
}
* process, as is the current jobid.
*/
-static struct pthreadpool *open_pool;
+static struct pthreadpool_pipe *open_pool;
static int aio_pthread_open_jobid;
struct aio_open_private_data {
return;
}
- ret = pthreadpool_finished_jobs(open_pool, &jobid, 1);
+ ret = pthreadpool_pipe_finished_jobs(open_pool, &jobid, 1);
if (ret != 1) {
smb_panic("aio_open_handle_completion");
/* notreached. */
}
talloc_set_destructor(opd, opd_destructor);
- DLIST_ADD_END(open_pd_list, opd, struct aio_open_private_data *);
+ DLIST_ADD_END(open_pd_list, opd);
return opd;
}
return -1;
}
- ret = pthreadpool_add_job(open_pool,
- opd->jobid,
- aio_open_worker,
- (void *)opd);
+ ret = pthreadpool_pipe_add_job(open_pool,
+ opd->jobid,
+ aio_open_worker,
+ (void *)opd);
if (ret) {
errno = ret;
return -1;