notifyd: Trim down the noncluster case
authorVolker Lendecke <vl@samba.org>
Thu, 8 Sep 2016 13:23:59 +0000 (15:23 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 9 Sep 2016 09:58:07 +0000 (11:58 +0200)
Without a cluster, notifyd does not have to receive databases

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/notifyd/notifyd.c

index b34b89e3d7977fe0e6d2a39170292fa2f4359d67..ce2da547d5daa53a0d02a4545b6d46fb8dd6d24e 100644 (file)
@@ -130,11 +130,11 @@ static bool notifyd_trigger(struct messaging_context *msg_ctx,
 static bool notifyd_get_db(struct messaging_context *msg_ctx,
                           struct messaging_rec **prec,
                           void *private_data);
+
+#ifdef CLUSTER_SUPPORT
 static bool notifyd_got_db(struct messaging_context *msg_ctx,
                           struct messaging_rec **prec,
                           void *private_data);
-
-#ifdef CLUSTER_SUPPORT
 static void notifyd_broadcast_reclog(struct ctdbd_connection *ctdbd_conn,
                                     struct server_id src,
                                     struct messaging_reclog *log);
@@ -240,6 +240,7 @@ struct tevent_req *notifyd_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
        }
        tevent_req_set_callback(subreq, notifyd_handler_done, req);
 
+#ifdef CLUSTER_SUPPORT
        subreq = messaging_handler_send(state, ev, msg_ctx,
                                        MSG_SMB_NOTIFY_DB,
                                        notifyd_got_db, state);
@@ -247,6 +248,7 @@ struct tevent_req *notifyd_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                return tevent_req_post(req, ev);
        }
        tevent_req_set_callback(subreq, notifyd_handler_done, req);
+#endif
 
        names_db = messaging_names_db(msg_ctx);
 
@@ -901,6 +903,8 @@ static bool notifyd_get_db(struct messaging_context *msg_ctx,
        return true;
 }
 
+#ifdef CLUSTER_SUPPORT
+
 static int notifyd_add_proxy_syswatches(struct db_record *rec,
                                        void *private_data);
 
@@ -966,8 +970,6 @@ static bool notifyd_got_db(struct messaging_context *msg_ctx,
        return true;
 }
 
-#ifdef CLUSTER_SUPPORT
-
 static void notifyd_broadcast_reclog(struct ctdbd_connection *ctdbd_conn,
                                     struct server_id src,
                                     struct messaging_reclog *log)
@@ -1169,8 +1171,6 @@ static int notifyd_clean_peers_recv(struct tevent_req *req)
        return tevent_req_simple_recv_unix(req);
 }
 
-#endif
-
 static int notifyd_add_proxy_syswatches(struct db_record *rec,
                                        void *private_data)
 {
@@ -1216,8 +1216,6 @@ static int notifyd_add_proxy_syswatches(struct db_record *rec,
        return 0;
 }
 
-#ifdef CLUSTER_SUPPORT
-
 static int notifyd_db_del_syswatches(struct db_record *rec, void *private_data)
 {
        TDB_DATA key = dbwrap_record_get_key(rec);