Lines Matching refs:lctx
93 static int alloc_lease(struct oplock_info *opinfo, struct lease_ctx_info *lctx) in alloc_lease() argument
101 memcpy(lease->lease_key, lctx->lease_key, SMB2_LEASE_KEY_SIZE); in alloc_lease()
102 lease->state = lctx->req_state; in alloc_lease()
104 lease->flags = lctx->flags; in alloc_lease()
105 lease->duration = lctx->duration; in alloc_lease()
106 lease->is_dir = lctx->is_dir; in alloc_lease()
107 memcpy(lease->parent_lease_key, lctx->parent_lease_key, SMB2_LEASE_KEY_SIZE); in alloc_lease()
108 lease->version = lctx->version; in alloc_lease()
109 lease->epoch = le16_to_cpu(lctx->epoch) + 1; in alloc_lease()
419 struct lease_ctx_info *lctx) in grant_write_oplock() argument
428 if (lctx) { in grant_write_oplock()
429 lease->state = lctx->req_state; in grant_write_oplock()
430 memcpy(lease->lease_key, lctx->lease_key, SMB2_LEASE_KEY_SIZE); in grant_write_oplock()
442 struct lease_ctx_info *lctx) in grant_read_oplock() argument
448 if (lctx) { in grant_read_oplock()
450 if (lctx->req_state & SMB2_LEASE_HANDLE_CACHING_LE) in grant_read_oplock()
452 memcpy(lease->lease_key, lctx->lease_key, SMB2_LEASE_KEY_SIZE); in grant_read_oplock()
464 struct lease_ctx_info *lctx) in grant_none_oplock() argument
470 if (lctx) { in grant_none_oplock()
472 memcpy(lease->lease_key, lctx->lease_key, SMB2_LEASE_KEY_SIZE); in grant_none_oplock()
501 struct lease_ctx_info *lctx) in same_client_has_lease() argument
508 if (!lctx) in same_client_has_lease()
521 ret = compare_guid_key(opinfo, client_guid, lctx->lease_key); in same_client_has_lease()
532 lease->state == (lctx->req_state & lease->state)) { in same_client_has_lease()
534 lease->state |= lctx->req_state; in same_client_has_lease()
535 if (lctx->req_state & in same_client_has_lease()
542 if (lctx->req_state == in same_client_has_lease()
546 lease->state = lctx->req_state; in same_client_has_lease()
550 if (lctx->req_state && lease->state == in same_client_has_lease()
553 lease_none_upgrade(opinfo, lctx->req_state); in same_client_has_lease()
977 struct lease_ctx_info *lctx) in find_same_lease_key() argument
983 if (!lctx) in find_same_lease_key()
1010 lctx->lease_key); in find_same_lease_key()
1075 struct lease_ctx_info *lctx) in set_oplock_level() argument
1080 grant_write_oplock(opinfo, level, lctx); in set_oplock_level()
1083 grant_read_oplock(opinfo, lctx); in set_oplock_level()
1086 grant_none_oplock(opinfo, lctx); in set_oplock_level()
1092 struct lease_ctx_info *lctx) in smb_send_parent_lease_break_noti() argument
1097 if (lctx->version != 2) in smb_send_parent_lease_break_noti()
1110 (!(lctx->flags & SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET_LE) || in smb_send_parent_lease_break_noti()
1112 lctx->parent_lease_key))) { in smb_send_parent_lease_break_noti()
1178 struct lease_ctx_info *lctx, int share_ret) in smb_grant_oplock() argument
1189 if (!lctx || lctx->version != 2 || in smb_grant_oplock()
1190 (lctx->flags != SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET_LE && in smb_grant_oplock()
1191 !lctx->epoch)) in smb_grant_oplock()
1199 if (lctx) { in smb_grant_oplock()
1200 err = alloc_lease(opinfo, lctx); in smb_grant_oplock()
1218 if (lctx) { in smb_grant_oplock()
1223 lctx); in smb_grant_oplock()
1234 (prev_opinfo->level == SMB2_OPLOCK_LEVEL_NONE && lctx)) { in smb_grant_oplock()
1274 if (prev_op_has_lease && !lctx) in smb_grant_oplock()
1278 if (!prev_op_has_lease && lctx) { in smb_grant_oplock()
1280 lctx->req_state = SMB2_LEASE_READ_CACHING_LE; in smb_grant_oplock()
1284 set_oplock_level(opinfo, req_op_level, lctx); in smb_grant_oplock()
1807 struct lease_ctx_info *lctx, in smb2_check_durable_oplock() argument
1817 if (lctx) { in smb2_check_durable_oplock()
1838 if (!lctx) { in smb2_check_durable_oplock()
1844 if (memcmp(opinfo->o_lease->lease_key, lctx->lease_key, in smb2_check_durable_oplock()
1858 if (opinfo->o_lease->version != lctx->version) { in smb2_check_durable_oplock()