DAC_OVERRIDE_CAPABILITY
};
-/*
- * Kernel oplocks capability flags.
- */
-
-/* Level 2 oplocks are supported natively by kernel oplocks. */
-#define KOPLOCKS_LEVEL2_SUPPORTED 0x1
-
-/* The kernel notifies deferred openers when they can retry the open. */
-#define KOPLOCKS_DEFERRED_OPEN_NOTIFICATION 0x2
-
-/* The kernel notifies smbds when an oplock break times out. */
-#define KOPLOCKS_TIMEOUT_NOTIFICATION 0x4
-
-/* The kernel notifies smbds when an oplock is broken. */
-#define KOPLOCKS_OPLOCK_BROKEN_NOTIFICATION 0x8
-
struct kernel_oplocks_ops;
struct kernel_oplocks {
const struct kernel_oplocks_ops *ops;
- uint32_t flags;
void *private_data;
};
bool use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) &&
(koplocks != NULL);
- if (fsp->oplock_type == LEVEL_II_OPLOCK) {
- if (use_kernel &&
- !(koplocks->flags & KOPLOCKS_LEVEL2_SUPPORTED)) {
- DEBUG(10, ("Refusing level2 oplock, kernel oplocks "
- "don't support them\n"));
- return NT_STATUS_NOT_SUPPORTED;
- }
+ if (fsp->oplock_type == LEVEL_II_OPLOCK && use_kernel) {
+ DEBUG(10, ("Refusing level2 oplock, kernel oplocks "
+ "don't support them\n"));
+ return NT_STATUS_NOT_SUPPORTED;
}
if ((fsp->oplock_type != NO_OPLOCK) &&
static void add_oplock_timeout_handler(files_struct *fsp)
{
- struct smbd_server_connection *sconn = fsp->conn->sconn;
- struct kernel_oplocks *koplocks = sconn->oplocks.kernel_ops;
- bool use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) &&
- (koplocks != NULL);
-
- /*
- * If kernel oplocks already notifies smbds when an oplock break times
- * out, just return.
- */
- if (use_kernel &&
- (koplocks->flags & KOPLOCKS_TIMEOUT_NOTIFICATION)) {
- return;
- }
-
if (fsp->oplock_timeout != NULL) {
DEBUG(0, ("Logic problem -- have an oplock event hanging "
"around\n"));
use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) &&
(koplocks != NULL);
- if (use_kernel && !(koplocks->flags & KOPLOCKS_LEVEL2_SUPPORTED)) {
+ if (use_kernel) {
DEBUG(10, ("Kernel oplocks don't allow level2\n"));
break_to &= ~SMB2_LEASE_READ;
}