1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Moved smbd process counting functions from smbd/server.c to smbd/process.c

so that bin/vfstest can link.  merge from head
(This used to be commit 9151cd7d64)
This commit is contained in:
Herb Lewis 2003-01-09 06:26:04 +00:00
parent a2cce2f075
commit 195ec103d6
2 changed files with 26 additions and 30 deletions

View File

@ -799,6 +799,32 @@ static int construct_reply(char *inbuf,char *outbuf,int size,int bufsize)
'hard' limit Samba overhead on resource constrained systems.
****************************************************************************/
static BOOL process_count_update_successful = False;
static int32 increment_smbd_process_count(void)
{
int32 total_smbds;
if (lp_max_smbd_processes()) {
total_smbds = 0;
if (tdb_change_int32_atomic(conn_tdb_ctx(), "INFO/total_smbds", &total_smbds, -1) == -1)
return 1;
process_count_update_successful = True;
return total_smbds + 1;
}
return 1;
}
void decrement_smbd_process_count(void)
{
int32 total_smbds;
if (lp_max_smbd_processes() && process_count_update_successful) {
total_smbds = 1;
tdb_change_int32_atomic(conn_tdb_ctx(), "INFO/total_smbds", &total_smbds, -1);
}
}
static BOOL smbd_process_limit(void)
{
int32 total_smbds;

View File

@ -522,36 +522,6 @@ static BOOL dump_core(void)
}
#endif
/****************************************************************************
update the current smbd process count
****************************************************************************/
static BOOL process_count_update_successful = False;
int32 increment_smbd_process_count(void)
{
int32 total_smbds;
if (lp_max_smbd_processes()) {
total_smbds = 0;
if (tdb_change_int32_atomic(conn_tdb_ctx(), "INFO/total_smbds", &total_smbds, -1) == -1)
return 1;
process_count_update_successful = True;
return total_smbds + 1;
}
return 1;
}
static void decrement_smbd_process_count(void)
{
int32 total_smbds;
if (lp_max_smbd_processes() && process_count_update_successful) {
total_smbds = 1;
tdb_change_int32_atomic(conn_tdb_ctx(), "INFO/total_smbds", &total_smbds, -1);
}
}
/****************************************************************************
Exit the server.
****************************************************************************/