]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Inline remove_oplock_under_lock() into its only caller
authorVolker Lendecke <vl@samba.org>
Mon, 5 Aug 2019 16:18:41 +0000 (18:18 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 6 Aug 2019 21:49:30 +0000 (21:49 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/oplock.c

index 3a99c9fc473477b019b8cb4f98613569f99cf61a..d3592f193e8adc7b3fd69ebb8a748c73c249f6f5 100644 (file)
@@ -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;