smbd: Add pthreadpool_tevent to smbd_server_connection
authorVolker Lendecke <vl@samba.org>
Mon, 8 Aug 2016 13:07:30 +0000 (15:07 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 23 Aug 2016 23:33:49 +0000 (01:33 +0200)
Prerequisite to convert the vfs _send/recv functions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_default.c
source3/smbd/globals.h

index 5227e95e302978c6801a9332757e63b8a2dfa237..8021319592d7b7aaced81806aa81e02c2823afad 100644 (file)
@@ -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;
index 8ba564d0e9f4c130bb515bc01deaa2d751e94d1a..61d85cbca2009a1fff62367d6857b7193fdf87f8 100644 (file)
@@ -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;
 };