From: Stefan Metzmacher Date: Sat, 10 Sep 2022 16:13:24 +0000 (+0200) Subject: s3:dbwrap_watch: add dbwrap_watched_watch_force_alerting() X-Git-Tag: talloc-2.4.0~857 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f2ce1fd34642e56a68b0997decbf50255063ea4;p=thirdparty%2Fsamba.git s3:dbwrap_watch: add dbwrap_watched_watch_force_alerting() 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/dbwrap/dbwrap_watch.c b/source3/lib/dbwrap/dbwrap_watch.c index 375d2effd53..df931192c21 100644 --- a/source3/lib/dbwrap/dbwrap_watch.c +++ b/source3/lib/dbwrap/dbwrap_watch.c @@ -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; diff --git a/source3/lib/dbwrap/dbwrap_watch.h b/source3/lib/dbwrap/dbwrap_watch.h index 7b09487b87f..1b93e137853 100644 --- a/source3/lib/dbwrap/dbwrap_watch.h +++ b/source3/lib/dbwrap/dbwrap_watch.h @@ -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,