s3:smbd: use lp_smbd_max_async_dosmode()
authorRalph Boehme <slow@samba.org>
Sun, 2 Dec 2018 08:23:29 +0000 (09:23 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 6 Dec 2018 00:43:13 +0000 (01:43 +0100)
Parametric options have a performance impact, use the normal options
added in the previous commit.

"aio max threads" can only be calculated at run time and requires a
handle to a pthreadpool_tevent which loadparm will never have.

Because of that lp_smbd_max_async_dosmode() will always return 0 as
default and it's up to us to calculate "aio max threads * 2" if
lp_smbd_max_async_dosmode() returns 0.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_query_directory.c

index 5d8af5531cee772453593e4c4188e43337dd3d1f..68c00241a5108c79377cdaca027bf66dc22deb4a 100644 (file)
@@ -521,12 +521,10 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
 
                max_threads = pthreadpool_tevent_max_threads(state->tp_chdir_safe);
 
-               state->max_async_dosmode_active = lp_parm_ulong(
-                       SNUM(conn), "smbd", "max async dosmode",
-                       max_threads * 2);
-
+               state->max_async_dosmode_active = lp_smbd_max_async_dosmode(
+                                                       SNUM(conn));
                if (state->max_async_dosmode_active == 0) {
-                       state->max_async_dosmode_active = 1;
+                       state->max_async_dosmode_active = max_threads * 2;
                }
        }