1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

SMB2 always have level2 oplock capability. Correct mapping from break messages to SMB2 oplock levels.

Jeremy.
This commit is contained in:
Jeremy Allison 2010-05-10 14:23:44 -07:00
parent a776933de6
commit ae9fe3cc8e
4 changed files with 6 additions and 3 deletions

View File

@ -324,7 +324,6 @@ void cancel_pending_lock_requests_by_fid_smb2(files_struct *fsp,
enum file_close_type close_type);
/* From smbd/smb2_create.c */
int map_smb2_oplock_levels_to_samba(uint8_t in_oplock_level);
uint8_t map_samba_oplock_levels_to_smb2(int oplock_type);
bool get_deferred_open_message_state_smb2(struct smbd_smb2_request *smb2req,
struct timeval *p_request_time,
void **pp_state);

View File

@ -252,7 +252,9 @@ static NTSTATUS smbd_smb2_oplock_break_recv(struct tevent_req *req,
void send_break_message_smb2(files_struct *fsp, int level)
{
uint8_t smb2_oplock_level = map_samba_oplock_levels_to_smb2(level);
uint8_t smb2_oplock_level = (level == OPLOCKLEVEL_II) ?
SMB2_OPLOCK_LEVEL_II :
SMB2_OPLOCK_LEVEL_NONE;
NTSTATUS status;
DEBUG(10,("send_break_message_smb2: sending oplock break "

View File

@ -46,7 +46,7 @@ int map_smb2_oplock_levels_to_samba(uint8_t in_oplock_level)
}
}
uint8_t map_samba_oplock_levels_to_smb2(int oplock_type)
static uint8_t map_samba_oplock_levels_to_smb2(int oplock_type)
{
if (BATCH_OPLOCK_TYPE(oplock_type)) {
return SMB2_OPLOCK_LEVEL_BATCH;

View File

@ -332,6 +332,8 @@ static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *req,
}
*out_session_id = session->vuid;
global_client_caps |= (CAP_LEVEL_II_OPLOCKS|CAP_STATUS32);
return status;
}