From: Volker Lendecke Date: Mon, 5 Aug 2019 16:18:41 +0000 (+0200) Subject: smbd: Inline remove_oplock_under_lock() into its only caller X-Git-Tag: tdb-1.4.2~286 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d4e2ea24947c4d2eb647c98b36d9cebb54d434d;p=thirdparty%2Fsamba.git smbd: Inline remove_oplock_under_lock() into its only caller Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 3a99c9fc473..d3592f193e8 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -195,26 +195,6 @@ uint32_t get_lease_type(const struct share_mode_data *d, return map_oplock_to_lease_type(e->op_type); } -/**************************************************************************** - Remove a file oplock with lock already held. Copes with level II and exclusive. -****************************************************************************/ - -static bool remove_oplock_under_lock(files_struct *fsp, struct share_mode_lock *lck) -{ - bool ret; - - ret = remove_share_oplock(lck, fsp); - if (!ret) { - DBG_ERR("failed to remove share oplock for " - "file %s, %s, %s\n", - fsp_str_dbg(fsp), fsp_fnum_dbg(fsp), - file_id_string_tos(&fsp->file_id)); - } - release_file_oplock(fsp); - - return ret; -} - /**************************************************************************** Remove a file oplock. Copes with level II and exclusive. Locks then unlocks the share mode lock. Client can decide to go directly @@ -236,7 +216,14 @@ bool remove_oplock(files_struct *fsp) return false; } - ret = remove_oplock_under_lock(fsp, lck); + ret = remove_share_oplock(lck, fsp); + if (!ret) { + DBG_ERR("failed to remove share oplock for " + "file %s, %s, %s\n", + fsp_str_dbg(fsp), fsp_fnum_dbg(fsp), + file_id_string_tos(&fsp->file_id)); + } + release_file_oplock(fsp); TALLOC_FREE(lck); return ret;