Lines Matching refs:handle

38 static unsigned int vmci_resource_hash(struct vmci_handle handle)  in vmci_resource_hash()  argument
40 return hash_32(handle.resource, VMCI_RESOURCE_HASH_BITS); in vmci_resource_hash()
46 static struct vmci_resource *vmci_resource_lookup(struct vmci_handle handle, in vmci_resource_lookup() argument
50 unsigned int idx = vmci_resource_hash(handle); in vmci_resource_lookup()
55 u32 cid = r->handle.context; in vmci_resource_lookup()
56 u32 rid = r->handle.resource; in vmci_resource_lookup()
59 rid == handle.resource && in vmci_resource_lookup()
60 (cid == handle.context || cid == VMCI_INVALID_ID)) { in vmci_resource_lookup()
88 struct vmci_handle handle; in vmci_resource_find_id() local
97 handle = vmci_make_handle(context_id, current_rid); in vmci_resource_find_id()
98 if (!vmci_resource_lookup(handle, resource_type)) in vmci_resource_find_id()
108 struct vmci_handle handle) in vmci_resource_add() argument
116 if (handle.resource == VMCI_INVALID_ID) { in vmci_resource_add()
117 handle.resource = vmci_resource_find_id(handle.context, in vmci_resource_add()
119 if (handle.resource == VMCI_INVALID_ID) { in vmci_resource_add()
123 } else if (vmci_resource_lookup(handle, resource_type)) { in vmci_resource_add()
128 resource->handle = handle; in vmci_resource_add()
134 idx = vmci_resource_hash(resource->handle); in vmci_resource_add()
146 struct vmci_handle handle = resource->handle; in vmci_resource_remove() local
147 unsigned int idx = vmci_resource_hash(handle); in vmci_resource_remove()
154 if (vmci_handle_is_equal(r->handle, resource->handle)) { in vmci_resource_remove()
227 return resource->handle; in vmci_resource_handle()