• Home
  • Raw
  • Download

Lines Matching refs:lease

94 	struct lease *lease;  in alloc_lease()  local
96 lease = kmalloc(sizeof(struct lease), GFP_KERNEL); in alloc_lease()
97 if (!lease) in alloc_lease()
100 memcpy(lease->lease_key, lctx->lease_key, SMB2_LEASE_KEY_SIZE); in alloc_lease()
101 lease->state = lctx->req_state; in alloc_lease()
102 lease->new_state = 0; in alloc_lease()
103 lease->flags = lctx->flags; in alloc_lease()
104 lease->duration = lctx->duration; in alloc_lease()
105 lease->is_dir = lctx->is_dir; in alloc_lease()
106 memcpy(lease->parent_lease_key, lctx->parent_lease_key, SMB2_LEASE_KEY_SIZE); in alloc_lease()
107 lease->version = lctx->version; in alloc_lease()
108 lease->epoch = le16_to_cpu(lctx->epoch) + 1; in alloc_lease()
110 opinfo->o_lease = lease; in alloc_lease()
117 struct lease *lease; in free_lease() local
119 lease = opinfo->o_lease; in free_lease()
120 kfree(lease); in free_lease()
260 struct lease *lease = opinfo->o_lease; in opinfo_write_to_read() local
266 pr_err("lease state(0x%x)\n", lease->state); in opinfo_write_to_read()
272 lease->state = lease->new_state; in opinfo_write_to_read()
284 struct lease *lease = opinfo->o_lease; in opinfo_read_handle_to_read() local
286 lease->state = lease->new_state; in opinfo_read_handle_to_read()
299 struct lease *lease = opinfo->o_lease; in opinfo_write_to_none() local
305 pr_err("lease state(0x%x)\n", lease->state); in opinfo_write_to_none()
310 lease->state = lease->new_state; in opinfo_write_to_none()
322 struct lease *lease = opinfo->o_lease; in opinfo_read_to_none() local
327 pr_err("lease state(0x%x)\n", lease->state); in opinfo_read_to_none()
332 lease->state = lease->new_state; in opinfo_read_to_none()
344 struct lease *lease = opinfo->o_lease; in lease_read_to_write() local
346 if (!(lease->state & SMB2_LEASE_READ_CACHING_LE)) { in lease_read_to_write()
347 ksmbd_debug(OPLOCK, "bad lease state(0x%x)\n", lease->state); in lease_read_to_write()
351 lease->new_state = SMB2_LEASE_NONE_LE; in lease_read_to_write()
352 lease->state |= SMB2_LEASE_WRITE_CACHING_LE; in lease_read_to_write()
353 if (lease->state & SMB2_LEASE_HANDLE_CACHING_LE) in lease_read_to_write()
369 struct lease *lease = opinfo->o_lease; in lease_none_upgrade() local
371 if (!(lease->state == SMB2_LEASE_NONE_LE)) { in lease_none_upgrade()
372 ksmbd_debug(OPLOCK, "bad lease state(0x%x)\n", lease->state); in lease_none_upgrade()
376 lease->new_state = SMB2_LEASE_NONE_LE; in lease_none_upgrade()
377 lease->state = new_state; in lease_none_upgrade()
378 if (lease->state & SMB2_LEASE_HANDLE_CACHING_LE) in lease_none_upgrade()
379 if (lease->state & SMB2_LEASE_WRITE_CACHING_LE) in lease_none_upgrade()
383 else if (lease->state & SMB2_LEASE_WRITE_CACHING_LE) in lease_none_upgrade()
385 else if (lease->state & SMB2_LEASE_READ_CACHING_LE) in lease_none_upgrade()
434 struct lease *lease = opinfo_new->o_lease; in grant_write_oplock() local
442 lease->state = lctx->req_state; in grant_write_oplock()
443 memcpy(lease->lease_key, lctx->lease_key, SMB2_LEASE_KEY_SIZE); in grant_write_oplock()
457 struct lease *lease = opinfo_new->o_lease; in grant_read_oplock() local
462 lease->state = SMB2_LEASE_READ_CACHING_LE; in grant_read_oplock()
464 lease->state |= SMB2_LEASE_HANDLE_CACHING_LE; in grant_read_oplock()
465 memcpy(lease->lease_key, lctx->lease_key, SMB2_LEASE_KEY_SIZE); in grant_read_oplock()
479 struct lease *lease = opinfo_new->o_lease; in grant_none_oplock() local
484 lease->state = 0; in grant_none_oplock()
485 memcpy(lease->lease_key, lctx->lease_key, SMB2_LEASE_KEY_SIZE); in grant_none_oplock()
517 struct lease *lease; in same_client_has_lease() local
533 lease = opinfo->o_lease; in same_client_has_lease()
547 if (lease->state != SMB2_LEASE_NONE_LE && in same_client_has_lease()
548 lease->state == (lctx->req_state & lease->state)) { in same_client_has_lease()
549 lease->epoch++; in same_client_has_lease()
550 lease->state |= lctx->req_state; in same_client_has_lease()
561 lease->epoch++; in same_client_has_lease()
562 lease->state = lctx->req_state; in same_client_has_lease()
566 if (lctx->req_state && lease->state == in same_client_has_lease()
568 lease->epoch++; in same_client_has_lease()
811 struct lease *lease = opinfo->o_lease; in smb2_lease_break_noti() local
823 br_info->curr_state = lease->state; in smb2_lease_break_noti()
824 br_info->new_state = lease->new_state; in smb2_lease_break_noti()
825 if (lease->version == 2) in smb2_lease_break_noti()
826 br_info->epoch = cpu_to_le16(++lease->epoch); in smb2_lease_break_noti()
829 memcpy(br_info->lease_key, lease->lease_key, SMB2_LEASE_KEY_SIZE); in smb2_lease_break_noti()
886 struct lease *lease = brk_opinfo->o_lease; in oplock_break() local
899 lease->new_state = SMB2_LEASE_NONE_LE; in oplock_break()
901 if (lease->state & SMB2_LEASE_WRITE_CACHING_LE) { in oplock_break()
902 if (lease->state & SMB2_LEASE_HANDLE_CACHING_LE) in oplock_break()
903 lease->new_state = in oplock_break()
907 lease->new_state = in oplock_break()
910 if (lease->state & SMB2_LEASE_HANDLE_CACHING_LE && in oplock_break()
911 !lease->is_dir) in oplock_break()
912 lease->new_state = in oplock_break()
915 lease->new_state = SMB2_LEASE_NONE_LE; in oplock_break()
919 if (lease->state & (SMB2_LEASE_WRITE_CACHING_LE | in oplock_break()
1034 struct lease *lease1 = op1->o_lease; in copy_lease()
1035 struct lease *lease2 = op2->o_lease; in copy_lease()
1453 void create_lease_buf(u8 *rbuf, struct lease *lease) in create_lease_buf() argument
1455 if (lease->version == 2) { in create_lease_buf()
1459 memcpy(buf->lcontext.LeaseKey, lease->lease_key, in create_lease_buf()
1461 buf->lcontext.LeaseFlags = lease->flags; in create_lease_buf()
1462 buf->lcontext.Epoch = cpu_to_le16(lease->epoch); in create_lease_buf()
1463 buf->lcontext.LeaseState = lease->state; in create_lease_buf()
1464 memcpy(buf->lcontext.ParentLeaseKey, lease->parent_lease_key, in create_lease_buf()
1480 memcpy(buf->lcontext.LeaseKey, lease->lease_key, SMB2_LEASE_KEY_SIZE); in create_lease_buf()
1481 buf->lcontext.LeaseFlags = lease->flags; in create_lease_buf()
1482 buf->lcontext.LeaseState = lease->state; in create_lease_buf()