]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:dbwrap_watch: add dbwrap_watched_watch_force_alerting()
authorStefan Metzmacher <metze@samba.org>
Sat, 10 Sep 2022 16:13:24 +0000 (18:13 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:35 +0000 (00:34 +0000)
This is useful when we want to wakeup the next watcher
without modifying the record.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/dbwrap/dbwrap_watch.c
source3/lib/dbwrap/dbwrap_watch.h

index 375d2effd531e4c0864775a1497f3d190b121929..df931192c21bb5bd59510a69c6985ebaeee44758 100644 (file)
@@ -1046,6 +1046,13 @@ void dbwrap_watched_watch_reset_alerting(struct db_record *rec)
        wrec->watchers.alerted = false;
 }
 
+void dbwrap_watched_watch_force_alerting(struct db_record *rec)
+{
+       struct db_watched_record *wrec = db_record_get_watched_record(rec);
+
+       dbwrap_watched_record_prepare_wakeup(wrec);
+}
+
 struct dbwrap_watched_watch_state {
        struct db_context *db;
        TDB_DATA key;
index 7b09487b87f4d0d729686026439f6d88e6b36b4e..1b93e13785349a731888ebef47cb103e7a2a06d5 100644 (file)
@@ -31,6 +31,7 @@ uint64_t dbwrap_watched_watch_add_instance(struct db_record *rec);
 void dbwrap_watched_watch_remove_instance(struct db_record *rec, uint64_t instance);
 void dbwrap_watched_watch_skip_alerting(struct db_record *rec);
 void dbwrap_watched_watch_reset_alerting(struct db_record *rec);
+void dbwrap_watched_watch_force_alerting(struct db_record *rec);
 struct tevent_req *dbwrap_watched_watch_send(TALLOC_CTX *mem_ctx,
                                             struct tevent_context *ev,
                                             struct db_record *rec,