1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

smbd: Remove unused KOPLOCK flags

This effectively reverts commit 17eba16b. It looks like these flags have
been introduced as part of the onefs support which has been removed
again. As there is no other use for the flags, remove them.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Sat Aug 25 03:23:05 CEST 2018 on sn-devel-144
This commit is contained in:
Christof Schmitt 2018-08-23 22:12:23 -07:00
parent 7c89edfe54
commit e5e66191f2
2 changed files with 5 additions and 39 deletions

View File

@ -660,26 +660,9 @@ enum smbd_capability {
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;
};

View File

@ -59,13 +59,10 @@ NTSTATUS set_file_oplock(files_struct *fsp)
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) &&
@ -747,20 +744,6 @@ static void oplock_timeout_handler(struct tevent_context *ctx,
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"));
@ -877,7 +860,7 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
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;
}