summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-12-12 14:55:54 +0100
committerVolker Lendecke <vlendec@samba.org>2011-12-12 21:50:25 +0100
commit0f9d14820e222233d63b7a79b4b1ff044332ef41 (patch)
treed3e48dcf07b6d8364ac7cabf80391b626b5509fb /source3/lib
parent77dc976b53490e06dff649f199033fe799b714bf (diff)
downloadsamba-0f9d14820e222233d63b7a79b4b1ff044332ef41.tar.gz
samba-0f9d14820e222233d63b7a79b4b1ff044332ef41.tar.bz2
samba-0f9d14820e222233d63b7a79b4b1ff044332ef41.zip
s3: Remove a bunch of calls to procid_self()
All callers to messaging_[re]init only used procid_self()
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/g_lock.c7
-rw-r--r--source3/lib/messages.c8
-rw-r--r--source3/lib/messages_ctdbd.c2
-rw-r--r--source3/lib/server_contexts.c1
-rw-r--r--source3/lib/util.c3
5 files changed, 8 insertions, 13 deletions
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 65d7c44295..561617023f 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -748,7 +748,6 @@ NTSTATUS g_lock_get(struct g_lock_ctx *ctx, const char *name,
static bool g_lock_init_all(TALLOC_CTX *mem_ctx,
struct tevent_context **pev,
struct messaging_context **pmsg,
- const struct server_id self,
struct g_lock_ctx **pg_ctx)
{
struct tevent_context *ev = NULL;
@@ -760,7 +759,7 @@ static bool g_lock_init_all(TALLOC_CTX *mem_ctx,
d_fprintf(stderr, "ERROR: could not init event context\n");
goto fail;
}
- msg = messaging_init(mem_ctx, self, ev);
+ msg = messaging_init(mem_ctx, ev);
if (msg == NULL) {
d_fprintf(stderr, "ERROR: could not init messaging context\n");
goto fail;
@@ -783,7 +782,7 @@ fail:
}
NTSTATUS g_lock_do(const char *name, enum g_lock_type lock_type,
- struct timeval timeout, const struct server_id self,
+ struct timeval timeout,
void (*fn)(void *private_data), void *private_data)
{
struct tevent_context *ev = NULL;
@@ -791,7 +790,7 @@ NTSTATUS g_lock_do(const char *name, enum g_lock_type lock_type,
struct g_lock_ctx *g_ctx = NULL;
NTSTATUS status;
- if (!g_lock_init_all(talloc_tos(), &ev, &msg, self, &g_ctx)) {
+ if (!g_lock_init_all(talloc_tos(), &ev, &msg, &g_ctx)) {
status = NT_STATUS_ACCESS_DENIED;
goto done;
}
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index ab655af574..421d88375d 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -182,7 +182,6 @@ struct event_context *messaging_event_context(struct messaging_context *msg_ctx)
}
struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
- struct server_id server_id,
struct event_context *ev)
{
struct messaging_context *ctx;
@@ -192,7 +191,7 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
return NULL;
}
- ctx->id = server_id;
+ ctx->id = procid_self();
ctx->event_ctx = ev;
status = messaging_tdb_init(ctx, ctx, &ctx->local);
@@ -237,14 +236,13 @@ struct server_id messaging_server_id(const struct messaging_context *msg_ctx)
/*
* re-init after a fork
*/
-NTSTATUS messaging_reinit(struct messaging_context *msg_ctx,
- struct server_id id)
+NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
{
NTSTATUS status;
TALLOC_FREE(msg_ctx->local);
- msg_ctx->id = id;
+ msg_ctx->id = procid_self();
status = messaging_tdb_init(msg_ctx, msg_ctx, &msg_ctx->local);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/lib/messages_ctdbd.c b/source3/lib/messages_ctdbd.c
index 9e092bc699..b7db2a76f0 100644
--- a/source3/lib/messages_ctdbd.c
+++ b/source3/lib/messages_ctdbd.c
@@ -69,7 +69,7 @@ struct ctdbd_connection *messaging_ctdbd_connection(void)
DEBUG(0,("event_context_init failed\n"));
}
- msg = messaging_init(NULL, procid_self(), ev);
+ msg = messaging_init(NULL, ev);
if (!msg) {
DEBUG(0,("messaging_init failed\n"));
return NULL;
diff --git a/source3/lib/server_contexts.c b/source3/lib/server_contexts.c
index a95ea9acc2..d49e33402f 100644
--- a/source3/lib/server_contexts.c
+++ b/source3/lib/server_contexts.c
@@ -55,7 +55,6 @@ struct messaging_context *server_messaging_context(void)
* children exiting.
*/
server_msg_ctx = messaging_init(NULL,
- procid_self(),
server_event_context());
}
return server_msg_ctx;
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 9b9d34c22f..2e432ab18e 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -372,7 +372,6 @@ ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos
NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
struct event_context *ev_ctx,
- struct server_id id,
bool parent_longlived)
{
NTSTATUS status = NT_STATUS_OK;
@@ -399,7 +398,7 @@ NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
* For clustering, we need to re-init our ctdbd connection after the
* fork
*/
- status = messaging_reinit(msg_ctx, id);
+ status = messaging_reinit(msg_ctx);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("messaging_reinit() failed: %s\n",
nt_errstr(status)));