]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Make remove_oplock_under_lock static
authorVolker Lendecke <vl@samba.org>
Mon, 5 Aug 2019 15:05:20 +0000 (17:05 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 6 Aug 2019 21:49:29 +0000 (21:49 +0000)
We have support for nested get_share_mode_lock calls, so we can avoid
this additional function.

It's one more talloc/free per close, but I hope this can't be
measurable. Our open/close path is pretty expensive anyway.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/close.c
source3/smbd/oplock.c
source3/smbd/proto.h

index 69d291bf614e6ba7e57f139b8d99bd6b5e85c48a..04c19cf32c0dd949fc2d7065d3cdea8bfc43205f 100644 (file)
@@ -306,7 +306,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
 
        /* Remove the oplock before potentially deleting the file. */
        if(fsp->oplock_type) {
-               remove_oplock_under_lock(fsp, lck);
+               remove_oplock(fsp);
        }
 
        if (fsp->write_time_forced) {
index fe88adc980699aa88e72f79fa34f4c008427345f..3a99c9fc473477b019b8cb4f98613569f99cf61a 100644 (file)
@@ -199,7 +199,7 @@ uint32_t get_lease_type(const struct share_mode_data *d,
  Remove a file oplock with lock already held. Copes with level II and exclusive.
 ****************************************************************************/
 
-bool remove_oplock_under_lock(files_struct *fsp, struct share_mode_lock *lck)
+static bool remove_oplock_under_lock(files_struct *fsp, struct share_mode_lock *lck)
 {
        bool ret;
 
index 7103b2cef298c19dcd8094a45c445e8454355889..6d3a10f9d7500e6fbaeeedddcd65df05743f4675 100644 (file)
@@ -719,7 +719,6 @@ uint32_t get_lease_type(const struct share_mode_data *d,
 
 void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp);
 NTSTATUS set_file_oplock(files_struct *fsp);
-bool remove_oplock_under_lock(files_struct *fsp, struct share_mode_lock *lck);
 bool remove_oplock(files_struct *fsp);
 bool downgrade_oplock(files_struct *fsp);
 bool fsp_lease_update(struct files_struct *fsp);