From: Volker Lendecke Date: Fri, 21 Jul 2017 17:08:43 +0000 (+0200) Subject: messaging: Remove the "n_sent" arg from message_send_all X-Git-Tag: talloc-2.1.11~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc2f0023a0ea521c5bc392db8f635bc3f23f68b8;p=thirdparty%2Fsamba.git messaging: Remove the "n_sent" arg from message_send_all The only user of this is an informative message in smbcontrol. I don't think that's worth the effort. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/include/serverid.h b/source3/include/serverid.h index 749b950f2c8..a73a6f6986c 100644 --- a/source3/include/serverid.h +++ b/source3/include/serverid.h @@ -75,7 +75,6 @@ struct messaging_context; bool message_send_all(struct messaging_context *msg_ctx, int msg_type, - const void *buf, size_t len, - int *n_sent); + const void *buf, size_t len); #endif diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index 73004489bef..9fd506df5fd 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -371,15 +371,11 @@ static int traverse_fn(struct db_record *rec, const struct server_id *id, * applications that use it. When we need efficient broadcast we can add * it. * - * @param n_sent Set to the number of messages sent. This should be - * equal to the number of processes, but be careful for races. - * * @retval True for success. **/ bool message_send_all(struct messaging_context *msg_ctx, int msg_type, - const void *buf, size_t len, - int *n_sent) + const void *buf, size_t len) { struct msg_all msg_all; @@ -406,7 +402,5 @@ bool message_send_all(struct messaging_context *msg_ctx, msg_all.msg_ctx = msg_ctx; serverid_traverse(traverse_fn, &msg_all); - if (n_sent) - *n_sent = msg_all.n_sent; return true; } diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 49752dde659..9827046187e 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -651,8 +651,7 @@ NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct) message_send_all(server_messaging_context(), ID_CACHE_DELETE, msg_data, - strlen(msg_data) + 1, - NULL); + strlen(msg_data) + 1); TALLOC_FREE(msg_data); return status; diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c index e07aca036fa..381ef348805 100644 --- a/source3/printing/queue_process.c +++ b/source3/printing/queue_process.c @@ -144,7 +144,7 @@ static void reload_pcap_change_notify(struct tevent_context *ev, */ delete_and_reload_printers_full(ev, msg_ctx); - message_send_all(msg_ctx, MSG_PRINTER_PCAP, NULL, 0, NULL); + message_send_all(msg_ctx, MSG_PRINTER_PCAP, NULL, 0); } struct bq_state { diff --git a/source3/rpc_server/fss/srv_fss_agent.c b/source3/rpc_server/fss/srv_fss_agent.c index 0fc974bb455..c0bf7ddd11a 100644 --- a/source3/rpc_server/fss/srv_fss_agent.c +++ b/source3/rpc_server/fss/srv_fss_agent.c @@ -1235,7 +1235,7 @@ uint32_t _fss_ExposeShadowCopySet(struct pipes_struct *p, } unbecome_root(); - message_send_all(p->msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0, NULL); + message_send_all(p->msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0); for (sc = sc_set->scs; sc; sc = sc->next) { struct fss_sc_smap *sm; for (sm = sc->smaps; sm; sm = sm->next) @@ -1577,7 +1577,7 @@ static NTSTATUS sc_smap_unexpose(struct messaging_context *msg_ctx, ret = NT_STATUS_UNSUCCESSFUL; goto err_cancel; } - message_send_all(msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0, NULL); + message_send_all(msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0); } else { ret = NT_STATUS_OK; goto err_cancel; @@ -1661,7 +1661,7 @@ uint32_t _fss_DeleteShareMapping(struct pipes_struct *p, } message_send_all(p->msg_ctx, MSG_SMB_FORCE_TDIS, sc_smap->sc_share_name, - strlen(sc_smap->sc_share_name) + 1, NULL); + strlen(sc_smap->sc_share_name) + 1); if (sc->smaps_count > 1) { /* do not delete the underlying snapshot - still in use */ diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index 1476dc6bf15..d8b6023e5e9 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -368,7 +368,7 @@ static WERROR delete_printer_hook(TALLOC_CTX *ctx, struct security_token *token, ret = smbrun(command, NULL, NULL); if (ret == 0) { /* Tell everyone we updated smb.conf. */ - message_send_all(msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0, NULL); + message_send_all(msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0); } if ( is_print_op ) @@ -6433,7 +6433,7 @@ static bool add_printer_hook(TALLOC_CTX *ctx, struct security_token *token, ret = smbrun(command, &fd, NULL); if (ret == 0) { /* Tell everyone we updated smb.conf. */ - message_send_all(msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0, NULL); + message_send_all(msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0); } if ( is_print_op ) diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c index 2a8cf8de650..899feb22da9 100644 --- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c +++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c @@ -1909,7 +1909,7 @@ WERROR _srvsvc_NetShareSetInfo(struct pipes_struct *p, if (ret == 0) { /* Tell everyone we updated smb.conf. */ message_send_all(p->msg_ctx, MSG_SMB_CONF_UPDATED, - NULL, 0, NULL); + NULL, 0); } if ( is_disk_op ) @@ -2111,8 +2111,7 @@ WERROR _srvsvc_NetShareAdd(struct pipes_struct *p, ret = smbrun(command, NULL, NULL); if (ret == 0) { /* Tell everyone we updated smb.conf. */ - message_send_all(p->msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0, - NULL); + message_send_all(p->msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0); } if ( is_disk_op ) @@ -2219,8 +2218,7 @@ WERROR _srvsvc_NetShareDel(struct pipes_struct *p, ret = smbrun(command, NULL, NULL); if (ret == 0) { /* Tell everyone we updated smb.conf. */ - message_send_all(p->msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0, - NULL); + message_send_all(p->msg_ctx, MSG_SMB_CONF_UPDATED, NULL, 0); } if ( is_disk_op ) diff --git a/source3/smbd/smbd_cleanupd.c b/source3/smbd/smbd_cleanupd.c index 152f63c31ce..90c12cdcd7c 100644 --- a/source3/smbd/smbd_cleanupd.c +++ b/source3/smbd/smbd_cleanupd.c @@ -98,7 +98,7 @@ static void smbd_cleanupd_unlock(struct messaging_context *msg, DBG_WARNING("Cleaning up brl and lock database after unclean " "shutdown\n"); - message_send_all(msg, MSG_SMB_UNLOCK, NULL, 0, NULL); + message_send_all(msg, MSG_SMB_UNLOCK, NULL, 0); brl_revalidate(msg, private_data, msg_type, server_id, data); } diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c index 89a4a3d2237..2023d52fb84 100644 --- a/source3/smbd/statcache.c +++ b/source3/smbd/statcache.c @@ -357,8 +357,7 @@ void smbd_send_stat_cache_delete_message(struct messaging_context *msg_ctx, message_send_all(msg_ctx, MSG_SMB_STAT_CACHE_DELETE, name, - strlen(name)+1, - NULL); + strlen(name)+1); #endif } diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c index 4c4bfcb4e5b..08c1530cdff 100644 --- a/source3/utils/smbcontrol.c +++ b/source3/utils/smbcontrol.c @@ -62,16 +62,13 @@ static bool send_message(struct messaging_context *msg_ctx, const void *buf, int len) { bool ret; - int n_sent = 0; if (procid_to_pid(&pid) != 0) return NT_STATUS_IS_OK( messaging_send_buf(msg_ctx, pid, msg_type, (const uint8_t *)buf, len)); - ret = message_send_all(msg_ctx, msg_type, buf, len, &n_sent); - DEBUG(10,("smbcontrol/send_message: broadcast message to " - "%d processes\n", n_sent)); + ret = message_send_all(msg_ctx, msg_type, buf, len); return ret; }