summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-07-18 10:39:50 -0400
committerAndreas Schneider <asn@samba.org>2011-08-10 18:14:04 +0200
commit2b33b438ba8cc6f89bf91e5a63bf0168d48be670 (patch)
treea4e459112d6c63a3155c3aabe05c61f94e065e37 /source3/lib
parent1155280a483e2a84e8baa27556c6ea066dbe6c8a (diff)
downloadsamba-2b33b438ba8cc6f89bf91e5a63bf0168d48be670.tar.gz
samba-2b33b438ba8cc6f89bf91e5a63bf0168d48be670.tar.bz2
samba-2b33b438ba8cc6f89bf91e5a63bf0168d48be670.zip
s3-prefork: Pass messaging context around too
Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/server_prefork.c11
-rw-r--r--source3/lib/server_prefork.h11
2 files changed, 17 insertions, 5 deletions
diff --git a/source3/lib/server_prefork.c b/source3/lib/server_prefork.c
index 26288f70fd..bc0f4c725e 100644
--- a/source3/lib/server_prefork.c
+++ b/source3/lib/server_prefork.c
@@ -54,7 +54,9 @@ static int prefork_pool_destructor(struct prefork_pool *pfp)
return 0;
}
-bool prefork_create_pool(struct tevent_context *ev_ctx, TALLOC_CTX *mem_ctx,
+bool prefork_create_pool(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev_ctx,
+ struct messaging_context *msg_ctx,
int listen_fd_size, int *listen_fds,
int min_children, int max_children,
prefork_main_fn_t *main_fn, void *private_data,
@@ -118,7 +120,8 @@ bool prefork_create_pool(struct tevent_context *ev_ctx, TALLOC_CTX *mem_ctx,
case 0: /* THE CHILD */
pfp->pool[i].status = PF_WORKER_IDLE;
- ret = pfp->main_fn(ev_ctx, &pfp->pool[i],
+ ret = pfp->main_fn(ev_ctx, msg_ctx,
+ &pfp->pool[i],
pfp->listen_fd_size,
pfp->listen_fds,
pfp->lock_fd,
@@ -175,6 +178,7 @@ int prefork_expand_pool(struct prefork_pool *pfp, int new_max)
}
int prefork_add_children(struct tevent_context *ev_ctx,
+ struct messaging_context *msg_ctx,
struct prefork_pool *pfp,
int num_children)
{
@@ -201,7 +205,8 @@ int prefork_add_children(struct tevent_context *ev_ctx,
case 0: /* THE CHILD */
pfp->pool[i].status = PF_WORKER_IDLE;
- ret = pfp->main_fn(ev_ctx, &pfp->pool[i],
+ ret = pfp->main_fn(ev_ctx, msg_ctx,
+ &pfp->pool[i],
pfp->listen_fd_size,
pfp->listen_fds,
pfp->lock_fd,
diff --git a/source3/lib/server_prefork.h b/source3/lib/server_prefork.h
index c45b96975a..2f25e557fa 100644
--- a/source3/lib/server_prefork.h
+++ b/source3/lib/server_prefork.h
@@ -62,6 +62,7 @@ struct pf_worker_data {
* cause the termination of the child.
*
* @param ev The event context
+* @param msg_ctx The messaging context
* @param pf The mmaped area used to communicate with parent
* @param listen_fd_size The number of file descriptors to monitor
* @param listen_fds The array of file descriptors
@@ -72,6 +73,7 @@ struct pf_worker_data {
* @return Returns the exit status to be reported to the parent via exit()
*/
typedef int (prefork_main_fn_t)(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
struct pf_worker_data *pf,
int listen_fd_size,
int *listen_fds,
@@ -94,8 +96,9 @@ typedef void (prefork_sigchld_fn_t)(struct tevent_context *ev_ctx,
/**
* @brief Creates the first pool of preforked processes
*
-* @param ev_ctx The event context
* @param mem_ctx The memory context used to hold the pool structure
+* @param ev_ctx The event context
+* @param msg_ctx The messaging context
* @param listen_fd_size The number of file descriptors to monitor
* @param listen_fds The array of file descriptors to monitor
* @param min_children Minimum number of children that must be available at
@@ -108,7 +111,9 @@ typedef void (prefork_sigchld_fn_t)(struct tevent_context *ev_ctx,
*
* @return True if it was successful, False otherwise.
*/
-bool prefork_create_pool(struct tevent_context *ev_ctx, TALLOC_CTX *mem_ctx,
+bool prefork_create_pool(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev_ctx,
+ struct messaging_context *msg_ctx,
int listen_fd_size, int *listen_fds,
int min_children, int max_children,
prefork_main_fn_t *main_fn, void *private_data,
@@ -132,6 +137,7 @@ int prefork_expand_pool(struct prefork_pool *pfp, int new_max);
* @brief Used to prefork a number of new children
*
* @param ev_ctx The event context
+* @param msg_ctx The messaging context
* @param pfp The pool structure
* @param num_children The number of children to be started
*
@@ -141,6 +147,7 @@ int prefork_expand_pool(struct prefork_pool *pfp, int new_max);
* has already been forked it will do nothing.
*/
int prefork_add_children(struct tevent_context *ev_ctx,
+ struct messaging_context *msg_ctx,
struct prefork_pool *pfp,
int num_children);
/**