messaging: Remove the "n_sent" arg from message_send_all
authorVolker Lendecke <vl@samba.org>
Fri, 21 Jul 2017 17:08:43 +0000 (19:08 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 4 Dec 2017 23:56:12 +0000 (00:56 +0100)
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 <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/serverid.h
source3/lib/serverid.c
source3/passdb/pdb_interface.c
source3/printing/queue_process.c
source3/rpc_server/fss/srv_fss_agent.c
source3/rpc_server/spoolss/srv_spoolss_nt.c
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/smbd/smbd_cleanupd.c
source3/smbd/statcache.c
source3/utils/smbcontrol.c

index 749b950f2c83bc7a8981393e93eceafd96b94545..a73a6f6986c6e958149b692c7a003adc92290d3f 100644 (file)
@@ -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
index 73004489befaa212f40a6642de36551fb046d582..9fd506df5fdd8d75c8ed9f0d7edef907bb260672 100644 (file)
@@ -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;
 }
index 49752dde659169d4ec08df90caccebd3fad435f2..9827046187e64f1eb5f2d642cf23bbe2c45541c0 100644 (file)
@@ -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;
index e07aca036fad52740f72b13f7e35b77630b82731..381ef3488051fa87a80eb68df276c706499a5af5 100644 (file)
@@ -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 {
index 0fc974bb455b1f43513839e6036ea0f1eb690bf8..c0bf7ddd11a812d855f60a6321ff2904cb8aaf66 100644 (file)
@@ -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 */
index 1476dc6bf159ce4f2a85052d6c1f78196fd19a9d..d8b6023e5e96a160a78ed2f008114931df69722e 100644 (file)
@@ -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 )
index 2a8cf8de650554bda64e0a812c0acd14b45cf4db..899feb22da997412ba7cd755085e5d3f50880eb6 100644 (file)
@@ -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 )
index 152f63c31ceee3a5f1081c565647401c61c6132b..90c12cdcd7c652c36858071a1a719830f75152cb 100644 (file)
@@ -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);
 }
index 89a4a3d22373a40280330a9b33584a6c0ac013e3..2023d52fb8410a546a6e2b7237c522e287ede2c6 100644 (file)
@@ -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
 }
 
index 4c4bfcb4e5b527c3626c1d4fcbb44fe764b5c853..08c1530cdff4d12371319f0994193d61294c0766 100644 (file)
@@ -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;
 }