From: Volker Lendecke Date: Mon, 5 Aug 2019 15:05:20 +0000 (+0200) Subject: smbd: Make remove_oplock_under_lock static X-Git-Tag: tdb-1.4.2~287 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e28c2ee903855627bc71924a6449267725a7f75d;p=thirdparty%2Fsamba.git smbd: Make remove_oplock_under_lock static 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 69d291bf614..04c19cf32c0 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -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) { diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index fe88adc9806..3a99c9fc473 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -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; diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 7103b2cef29..6d3a10f9d75 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -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);