From c8ae60ed65dcce9660ee39c75488f2838cf9a28b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 30 Jan 2007 22:22:06 +0000 Subject: r21064: The core of this patch is void message_register(int msg_type, void (*fn)(int msg_type, struct process_id pid, - void *buf, size_t len)) + void *buf, size_t len, + void *private_data), + void *private_data) { struct dispatch_fns *dfn; So this adds a (so far unused) private pointer that is passed from message_register to the message handler. A prerequisite to implement a tiny samba4-API compatible wrapper around our messaging system. That itself is necessary for the Samba4 notify system. Yes, I know, I could import the whole Samba4 messaging system, but I want to do it step by step and I think getting notify in is more important in this step. Volker --- source/lib/dmallocmsg.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source/lib/dmallocmsg.c') diff --git a/source/lib/dmallocmsg.c b/source/lib/dmallocmsg.c index 1b2308ecba6..fed7bf59c52 100644 --- a/source/lib/dmallocmsg.c +++ b/source/lib/dmallocmsg.c @@ -35,8 +35,10 @@ static unsigned long our_dm_mark = 0; * Respond to a POOL_USAGE message by sending back string form of memory * usage stats. **/ -static void msg_req_dmalloc_mark(int UNUSED(msg_type), struct process_id UNUSED(src_pid), - void *UNUSED(buf), size_t UNUSED(len)) +static void msg_req_dmalloc_mark(int UNUSED(msg_type), + struct process_id UNUSED(src_pid), + void *UNUSED(buf), size_t UNUSED(len), + void *private_data) { #ifdef ENABLE_DMALLOC our_dm_mark = dmalloc_mark(); @@ -50,7 +52,8 @@ static void msg_req_dmalloc_mark(int UNUSED(msg_type), struct process_id UNUSED( static void msg_req_dmalloc_log_changed(int UNUSED(msg_type), struct process_id UNUSED(src_pid), - void *UNUSED(buf), size_t UNUSED(len)) + void *UNUSED(buf), size_t UNUSED(len), + void *private_data) { #ifdef ENABLE_DMALLOC dmalloc_log_changed(our_dm_mark, True, True, True); @@ -66,7 +69,8 @@ static void msg_req_dmalloc_log_changed(int UNUSED(msg_type), **/ void register_dmalloc_msgs(void) { - message_register(MSG_REQ_DMALLOC_MARK, msg_req_dmalloc_mark); - message_register(MSG_REQ_DMALLOC_LOG_CHANGED, msg_req_dmalloc_log_changed); + message_register(MSG_REQ_DMALLOC_MARK, msg_req_dmalloc_mark, NULL); + message_register(MSG_REQ_DMALLOC_LOG_CHANGED, + msg_req_dmalloc_log_changed, NULL); DEBUG(2, ("Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED\n")); } -- cgit v1.2.1