#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,
+ uint16_t,
void *))
{
struct tevent_fd *sock_event = NULL;
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 {
static void aio_open_handle_completion(struct tevent_context *event_ctx,
struct tevent_fd *event,
- uint16 flags,
+ uint16_t flags,
void *p)
{
struct aio_open_private_data *opd = NULL;
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;
#endif
};
-NTSTATUS vfs_aio_pthread_init(void);
-NTSTATUS vfs_aio_pthread_init(void)
+NTSTATUS vfs_aio_pthread_init(TALLOC_CTX *);
+NTSTATUS vfs_aio_pthread_init(TALLOC_CTX *ctx)
{
return smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
"aio_pthread", &vfs_aio_pthread_fns);