else
bs->state = ONEFS_CBRL_NONE;
+ /* Self contend our own level 2 oplock. The kernel handles
+ * contention of other opener's level 2 oplocks. */
+ contend_level2_oplocks_begin(blr->fsp,
+ LEVEL2_CONTEND_WINDOWS_BRL);
+
/* Process the queue, to try the next lock or finish up. */
process_blocking_lock_queue();
}
DEBUG(10, ("cbrl_event_fd = %d\n", cbrl_event_fd));
- /* Register the oplock event_fd with samba's event system */
+ /* Register the CBRL event_fd with samba's event system */
cbrl_fde = event_add_fd(smbd_event_context(),
NULL,
cbrl_event_fd,
return status;
success:
+ /* Self contend our own level 2 oplock. The kernel handles
+ * contention of other opener's level 2 oplocks. */
+ contend_level2_oplocks_begin(br_lck->fsp,
+ LEVEL2_CONTEND_WINDOWS_BRL);
END_PROFILE(syscall_brl_lock);
return false;
}
+ /* For symmetry purposes, end our oplock contention even though its
+ * currently a no-op. */
+ contend_level2_oplocks_end(br_lck->fsp, LEVEL2_CONTEND_WINDOWS_BRL);
+
DEBUG(10, ("returning true.\n"));
return true;
switch (type) {
case LEVEL2_CONTEND_ALLOC_GROW:
- case LEVEL2_CONTEND_WINDOWS_BRL:
case LEVEL2_CONTEND_POSIX_BRL:
DEBUG(10, ("Taking %d write semlock for cmd %d on fd: %d\n",
semlock_op, type, fd));