summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorZack Kirsch <zack.kirsch@isilon.com>2009-05-11 17:10:43 +0000
committerTim Prouty <tprouty@samba.org>2009-05-12 17:53:16 -0700
commit3627ceb5e25cdecd1a8113a5028cc898a1424349 (patch)
tree25206a4c69768b82bb1aa3ff75fd196a4548a286 /source3
parentc2482d6b23f769d8a5fa4141f9540a25c985d7cc (diff)
downloadsamba-3627ceb5e25cdecd1a8113a5028cc898a1424349.tar.gz
samba-3627ceb5e25cdecd1a8113a5028cc898a1424349.tar.bz2
samba-3627ceb5e25cdecd1a8113a5028cc898a1424349.zip
s3 onefs: Self-contend level2 oplocks on BRL
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/onefs_cbrl.c15
-rw-r--r--source3/smbd/oplock_onefs.c1
2 files changed, 14 insertions, 2 deletions
diff --git a/source3/modules/onefs_cbrl.c b/source3/modules/onefs_cbrl.c
index a196511427..f7cb26ccd0 100644
--- a/source3/modules/onefs_cbrl.c
+++ b/source3/modules/onefs_cbrl.c
@@ -150,6 +150,11 @@ static void onefs_cbrl_async_success(uint64_t id)
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();
}
@@ -215,7 +220,7 @@ static void onefs_init_cbrl(void)
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,
@@ -366,6 +371,10 @@ failure:
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);
@@ -400,6 +409,10 @@ bool onefs_brl_unlock_windows(vfs_handle_struct *handle,
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;
diff --git a/source3/smbd/oplock_onefs.c b/source3/smbd/oplock_onefs.c
index b69d937915..d359f9c6f2 100644
--- a/source3/smbd/oplock_onefs.c
+++ b/source3/smbd/oplock_onefs.c
@@ -526,7 +526,6 @@ static void onefs_semlock_write(int fd, enum level2_contention_type type,
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));