mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
param: turn 'smb2 max credits' into generated option
This is achieved by moving the special treatment from the lp_smb2_max_credits() function in the the special handler that is called only once upon lp_load(). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
ea6d35ccdd
commit
44619ad261
@ -1,7 +1,7 @@
|
||||
<samba:parameter name="smb2 max credits"
|
||||
type="integer"
|
||||
context="G"
|
||||
generated_function="0"
|
||||
handler="handle_smb2_max_credits"
|
||||
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
|
||||
<description>
|
||||
<para>This option controls the maximum number of outstanding simultaneous SMB2 operations
|
||||
|
@ -1366,6 +1366,21 @@ bool handle_smb_ports(struct loadparm_context *lp_ctx, struct loadparm_service *
|
||||
return true;
|
||||
}
|
||||
|
||||
bool handle_smb2_max_credits(struct loadparm_context *lp_ctx,
|
||||
struct loadparm_service *service,
|
||||
const char *pszParmValue, char **ptr)
|
||||
{
|
||||
int value = lp_int(pszParmValue);
|
||||
|
||||
if (value <= 0) {
|
||||
value = DEFAULT_SMB2_MAX_CREDITS;
|
||||
}
|
||||
|
||||
*(int *)ptr = value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Initialise a copymap.
|
||||
***************************************************************************/
|
||||
|
@ -253,8 +253,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
|
||||
char *szIdmapUID; \
|
||||
char *szIdmapGID; \
|
||||
char *szIdmapBackend; \
|
||||
int winbindMaxDomainConnections; \
|
||||
int ismb2_max_credits;
|
||||
int winbindMaxDomainConnections;
|
||||
|
||||
const char* server_role_str(uint32_t role);
|
||||
int lp_find_server_role(int server_role, int security, int domain_logons, int domain_master);
|
||||
|
@ -1877,8 +1877,8 @@ struct parm_struct parm_table[] = {
|
||||
.label = "smb2 max credits",
|
||||
.type = P_INTEGER,
|
||||
.p_class = P_GLOBAL,
|
||||
.offset = GLOBAL_VAR(ismb2_max_credits),
|
||||
.special = NULL,
|
||||
.offset = GLOBAL_VAR(smb2_max_credits),
|
||||
.special = handle_smb2_max_credits,
|
||||
.enum_list = NULL,
|
||||
},
|
||||
{
|
||||
|
@ -858,7 +858,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
|
||||
Globals.smb2_max_read = DEFAULT_SMB2_MAX_READ;
|
||||
Globals.smb2_max_write = DEFAULT_SMB2_MAX_WRITE;
|
||||
Globals.smb2_max_trans = DEFAULT_SMB2_MAX_TRANSACT;
|
||||
Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
|
||||
Globals.smb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
|
||||
Globals.smb2_leases = false;
|
||||
|
||||
string_set(Globals.ctx, &Globals.ncalrpc_dir, get_dyn_NCALRPCDIR());
|
||||
@ -1033,13 +1033,6 @@ int lp_winbind_max_domain_connections(void)
|
||||
return MAX(1, lp_winbind_max_domain_connections_int());
|
||||
}
|
||||
|
||||
int lp_smb2_max_credits(void)
|
||||
{
|
||||
if (Globals.ismb2_max_credits <= 0) {
|
||||
Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
|
||||
}
|
||||
return Globals.ismb2_max_credits;
|
||||
}
|
||||
int lp_cups_encrypt(void)
|
||||
{
|
||||
int result = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user