From: Stefan Metzmacher Date: Thu, 8 Aug 2019 22:47:39 +0000 (+0200) Subject: s3:locking: add share_mode_wakeup_waiters() helper function X-Git-Tag: talloc-2.3.1~979 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd8884e5722cbbb7783fb4ae53e4f35b31031b01;p=thirdparty%2Fsamba.git s3:locking: add share_mode_wakeup_waiters() helper function BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- diff --git a/source3/locking/proto.h b/source3/locking/proto.h index a2363ebdb8f..847d95b0cfa 100644 --- a/source3/locking/proto.h +++ b/source3/locking/proto.h @@ -138,6 +138,7 @@ NTSTATUS share_mode_do_locked( bool *modified_dependent, void *private_data), void *private_data); +NTSTATUS share_mode_wakeup_waiters(struct file_id id); struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx, struct file_id id); diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 5c997bd61a0..fada7e5691e 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -771,6 +771,18 @@ NTSTATUS share_mode_do_locked( return NT_STATUS_OK; } +static void share_mode_wakeup_waiters_fn(struct db_record *rec, + bool *modified_dependent, + void *private_data) +{ + *modified_dependent = true; +} + +NTSTATUS share_mode_wakeup_waiters(struct file_id id) +{ + return share_mode_do_locked(id, share_mode_wakeup_waiters_fn, NULL); +} + struct fetch_share_mode_unlocked_state { TALLOC_CTX *mem_ctx; struct share_mode_lock *lck;