#define DBGC_CLASS DBGC_LOCKING
#include "includes.h"
+#include "smbd/smbd.h"
#include "smbd/globals.h"
#include "librpc/gen_ndr/messaging.h"
msg, MSG_SMB_KERNEL_BREAK_SIZE);
}
-static bool file_has_brlocks(files_struct *fsp)
-{
- struct byte_range_lock *br_lck;
-
- br_lck = brl_get_locks_readonly(fsp);
- if (!br_lck)
- return false;
-
- return br_lck->num_locks > 0 ? true : false;
-}
-
/****************************************************************************
Attempt to set an oplock on a file. Succeeds if kernel oplocks are
disabled (just sets flags) and no byte-range locks in the file. Returns True
bool set_file_oplock(files_struct *fsp, int oplock_type)
{
if (fsp->oplock_type == LEVEL_II_OPLOCK) {
- if (lp_locking(fsp->conn->params) && file_has_brlocks(fsp)) {
- DEBUG(10, ("Refusing level2 oplock because of "
- "byte-range locks on the file\n"));
- return false;
- }
-
if (koplocks &&
!(koplocks->flags & KOPLOCKS_LEVEL2_SUPPORTED)) {
DEBUG(10, ("Refusing level2 oplock, kernel oplocks "
SIVAL(msg,OP_BREAK_MSG_UID_OFFSET,e->uid);
SSVAL(msg,OP_BREAK_MSG_FLAGS_OFFSET,e->flags);
SIVAL(msg,OP_BREAK_MSG_NAME_HASH_OFFSET,e->name_hash);
-#ifdef CLUSTER_SUPPORT
SIVAL(msg,OP_BREAK_MSG_VNN_OFFSET,e->pid.vnn);
-#endif
}
/****************************************************************************
e->uid = (uint32)IVAL(msg,OP_BREAK_MSG_UID_OFFSET);
e->flags = (uint16)SVAL(msg,OP_BREAK_MSG_FLAGS_OFFSET);
e->name_hash = IVAL(msg,OP_BREAK_MSG_NAME_HASH_OFFSET);
-#ifdef CLUSTER_SUPPORT
e->pid.vnn = IVAL(msg,OP_BREAK_MSG_VNN_OFFSET);
-#endif
}
/****************************************************************************