Lines Matching refs:handle

37 static unsigned int vmci_resource_hash(struct vmci_handle handle)  in vmci_resource_hash()  argument
39 return hash_32(handle.resource, VMCI_RESOURCE_HASH_BITS); in vmci_resource_hash()
45 static struct vmci_resource *vmci_resource_lookup(struct vmci_handle handle, in vmci_resource_lookup() argument
49 unsigned int idx = vmci_resource_hash(handle); in vmci_resource_lookup()
54 u32 cid = r->handle.context; in vmci_resource_lookup()
55 u32 rid = r->handle.resource; in vmci_resource_lookup()
58 rid == handle.resource && in vmci_resource_lookup()
59 (cid == handle.context || cid == VMCI_INVALID_ID)) { in vmci_resource_lookup()
87 struct vmci_handle handle; in vmci_resource_find_id() local
96 handle = vmci_make_handle(context_id, current_rid); in vmci_resource_find_id()
97 if (!vmci_resource_lookup(handle, resource_type)) in vmci_resource_find_id()
107 struct vmci_handle handle) in vmci_resource_add() argument
115 if (handle.resource == VMCI_INVALID_ID) { in vmci_resource_add()
116 handle.resource = vmci_resource_find_id(handle.context, in vmci_resource_add()
118 if (handle.resource == VMCI_INVALID_ID) { in vmci_resource_add()
122 } else if (vmci_resource_lookup(handle, resource_type)) { in vmci_resource_add()
127 resource->handle = handle; in vmci_resource_add()
133 idx = vmci_resource_hash(resource->handle); in vmci_resource_add()
145 struct vmci_handle handle = resource->handle; in vmci_resource_remove() local
146 unsigned int idx = vmci_resource_hash(handle); in vmci_resource_remove()
153 if (vmci_handle_is_equal(r->handle, resource->handle)) { in vmci_resource_remove()
226 return resource->handle; in vmci_resource_handle()