summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-01-09 05:49:51 +0000
committerTim Potter <tpot@samba.org>2003-01-09 05:49:51 +0000
commit642fad95ef95406b40e318c672b73d0ca72c8ebe (patch)
treea7519c82f8d5ebd5d4cec95543c26e4fb6ccb38a /source3/smbd
parent413e58e9a721e588a730fca253f160c8042f463c (diff)
downloadsamba-642fad95ef95406b40e318c672b73d0ca72c8ebe.tar.gz
samba-642fad95ef95406b40e318c672b73d0ca72c8ebe.tar.bz2
samba-642fad95ef95406b40e318c672b73d0ca72c8ebe.zip
Moved smbd process counting functions from smbd/server.c to smbd/process.c
so that bin/vfstest can link. (This used to be commit 812ce0368c69922612ac001560a111016d0e568e)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/process.c26
-rw-r--r--source3/smbd/server.c30
2 files changed, 26 insertions, 30 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 03b1e007ba..06cedea573 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -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;
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index a69f4c8c54..e8d92bf064 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -527,36 +527,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.
****************************************************************************/