diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 5227e95e302..8021319592d 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -33,6 +33,7 @@ #include "lib/asys/asys.h" #include "lib/util/tevent_ntstatus.h" #include "lib/util/sys_rw.h" +#include "lib/pthreadpool/pthreadpool_tevent.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_VFS @@ -750,6 +751,20 @@ fail: return false; } +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_asys_state { struct asys_context *asys_ctx; struct tevent_req *req; diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 8ba564d0e9f..61d85cbca20 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -854,6 +854,8 @@ struct user_struct { struct smbXsrv_session *session; }; +struct pthreadpool_tevent; + struct smbd_server_connection { const struct tsocket_address *local_address; const struct tsocket_address *remote_address; @@ -925,6 +927,8 @@ struct smbd_server_connection { struct asys_context *asys_ctx; struct tevent_fd *asys_fde; + struct pthreadpool_tevent *pool; + struct smbXsrv_client *client; };