s3:locking: add share_mode_wakeup_waiters() helper function
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Aug 2019 22:47:39 +0000 (00:47 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 9 Sep 2019 14:23:39 +0000 (14:23 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/locking/proto.h
source3/locking/share_mode_lock.c

index a2363ebdb8f92a63898a9d4f53a440bc30bbedc6..847d95b0cfa8c6ff0a611d87ade2c691e12288ed 100644 (file)
@@ -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);
index 5c997bd61a094d5e131cdd4728645464391b2be1..fada7e5691e40c22a4a1facff95889b0bdb227ce 100644 (file)
@@ -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;