Lines Matching refs:handle
30 static unsigned int vmci_resource_hash(struct vmci_handle handle)
32 return hash_32(handle.resource, VMCI_RESOURCE_HASH_BITS);
36 * Gets a resource (if one exists) matching given handle from the hash table.
38 static struct vmci_resource *vmci_resource_lookup(struct vmci_handle handle,
42 unsigned int idx = vmci_resource_hash(handle);
47 u32 cid = r->handle.context;
48 u32 rid = r->handle.resource;
51 rid == handle.resource &&
52 (cid == handle.context || cid == VMCI_INVALID_ID ||
53 handle.context == VMCI_INVALID_ID)) {
81 struct vmci_handle handle;
90 handle = vmci_make_handle(context_id, current_rid);
91 if (!vmci_resource_lookup(handle, resource_type))
101 struct vmci_handle handle)
109 if (handle.resource == VMCI_INVALID_ID) {
110 handle.resource = vmci_resource_find_id(handle.context,
112 if (handle.resource == VMCI_INVALID_ID) {
116 } else if (vmci_resource_lookup(handle, resource_type)) {
121 resource->handle = handle;
127 idx = vmci_resource_hash(resource->handle);
139 struct vmci_handle handle = resource->handle;
140 unsigned int idx = vmci_resource_hash(handle);
147 if (vmci_handle_is_equal(r->handle, resource->handle)) {
220 return resource->handle;