summaryrefslogtreecommitdiff
path: root/source3/smbd/oplock.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-01-27 16:13:35 -0800
committerTim Prouty <tprouty@samba.org>2009-02-09 23:47:45 -0800
commit16d2c2fa58c57539a9b540eb93825806caaea0b5 (patch)
treef9e36ba11388ece127fa82c7eb96bfbc6a853902 /source3/smbd/oplock.c
parent32d68b8ec3aee7853c7547296e829277515813d1 (diff)
downloadsamba-16d2c2fa58c57539a9b540eb93825806caaea0b5.tar.gz
samba-16d2c2fa58c57539a9b540eb93825806caaea0b5.tar.bz2
samba-16d2c2fa58c57539a9b540eb93825806caaea0b5.zip
s3 OneFS: Add kernel oplocks implementation
A few functions in oplocks_onefs.c need to be accessed from the onefs vfs module. It would be ideal if oplocks were implemented at the vfs layer, but since they aren't yet, a new header is added to source3/include to make these functions available to the onefs vfs module. oplocks_onefs.o doesn't need to be linked into the onefs vfs module explicitly, since it is already linked into smbd by default.
Diffstat (limited to 'source3/smbd/oplock.c')
-rw-r--r--source3/smbd/oplock.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index a6ec9cfa2d..b39e5bf634 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -122,6 +122,11 @@ void release_file_oplock(files_struct *fsp)
static void downgrade_file_oplock(files_struct *fsp)
{
+ if (!EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) {
+ DEBUG(0, ("trying to downgrade an already-downgraded oplock!\n"));
+ return;
+ }
+
if (koplocks) {
koplocks->ops->release_oplock(koplocks, fsp, LEVEL_II_OPLOCK);
}
@@ -916,6 +921,8 @@ bool init_oplocks(struct messaging_context *msg_ctx)
koplocks = irix_init_kernel_oplocks(talloc_autofree_context());
#elif HAVE_KERNEL_OPLOCKS_LINUX
koplocks = linux_init_kernel_oplocks(talloc_autofree_context());
+#elif HAVE_ONEFS
+ koplocks = onefs_init_kernel_oplocks(talloc_autofree_context());
#endif
}