This inlines remove_oplock() into close_remove_share_mode() and
calls remove_share_oplock() and release_file_oplock() directly.
The idea is that we'll soon call remove_share_oplock()
under a tdb chainlock, while release_file_oplock() needs to be called outside.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
}
/* Remove the oplock before potentially deleting the file. */
- if(fsp->oplock_type) {
- remove_oplock(fsp);
+ if (fsp->oplock_type != NO_OPLOCK) {
+ bool ok;
+
+ ok = remove_share_oplock(lck, fsp);
+ if (!ok) {
+ struct file_id_buf buf;
+
+ DBG_ERR("failed to remove share oplock for "
+ "file %s, %s, %s\n",
+ fsp_str_dbg(fsp), fsp_fnum_dbg(fsp),
+ file_id_str_buf(fsp->file_id, &buf));
+ }
+ release_file_oplock(fsp);
}
if (fsp->fsp_flags.write_time_forced) {