Lines Matching refs:handle

245 		unsigned long handle;  member
302 static void free_handle(struct zs_pool *pool, unsigned long handle) in free_handle() argument
304 kmem_cache_free(pool->handle_cachep, (void *)handle); in free_handle()
307 static void record_obj(unsigned long handle, unsigned long obj) in record_obj() argument
314 WRITE_ONCE(*(unsigned long *)handle, obj); in record_obj()
332 unsigned long *handle) in zs_zpool_malloc() argument
334 *handle = zs_malloc(pool, size); in zs_zpool_malloc()
335 return *handle ? 0 : -1; in zs_zpool_malloc()
337 static void zs_zpool_free(void *pool, unsigned long handle) in zs_zpool_free() argument
339 zs_free(pool, handle); in zs_zpool_free()
348 static void *zs_zpool_map(void *pool, unsigned long handle, in zs_zpool_map() argument
366 return zs_map_object(pool, handle, zs_mm); in zs_zpool_map()
368 static void zs_zpool_unmap(void *pool, unsigned long handle) in zs_zpool_unmap() argument
370 zs_unmap_object(pool, handle); in zs_zpool_unmap()
831 static unsigned long handle_to_obj(unsigned long handle) in handle_to_obj() argument
833 return *(unsigned long *)handle; in handle_to_obj()
857 static inline int trypin_tag(unsigned long handle) in trypin_tag() argument
859 unsigned long *ptr = (unsigned long *)handle; in trypin_tag()
864 static void pin_tag(unsigned long handle) in pin_tag() argument
866 while (!trypin_tag(handle)); in pin_tag()
869 static void unpin_tag(unsigned long handle) in unpin_tag() argument
871 unsigned long *ptr = (unsigned long *)handle; in unpin_tag()
1261 void *zs_map_object(struct zs_pool *pool, unsigned long handle, in zs_map_object() argument
1274 BUG_ON(!handle); in zs_map_object()
1284 pin_tag(handle); in zs_map_object()
1286 obj = handle_to_obj(handle); in zs_map_object()
1315 void zs_unmap_object(struct zs_pool *pool, unsigned long handle) in zs_unmap_object() argument
1325 BUG_ON(!handle); in zs_unmap_object()
1327 obj = handle_to_obj(handle); in zs_unmap_object()
1346 unpin_tag(handle); in zs_unmap_object()
1351 struct size_class *class, unsigned long handle) in obj_malloc() argument
1360 handle |= OBJ_ALLOCATED_TAG; in obj_malloc()
1370 link->handle = handle; in obj_malloc()
1373 set_page_private(first_page, handle); in obj_malloc()
1393 unsigned long handle, obj; in zs_malloc() local
1400 handle = alloc_handle(pool); in zs_malloc()
1401 if (!handle) in zs_malloc()
1415 free_handle(pool, handle); in zs_malloc()
1428 obj = obj_malloc(first_page, class, handle); in zs_malloc()
1431 record_obj(handle, obj); in zs_malloc()
1434 return handle; in zs_malloc()
1470 void zs_free(struct zs_pool *pool, unsigned long handle) in zs_free() argument
1478 if (unlikely(!handle)) in zs_free()
1481 pin_tag(handle); in zs_free()
1482 obj = handle_to_obj(handle); in zs_free()
1500 unpin_tag(handle); in zs_free()
1502 free_handle(pool, handle); in zs_free()
1580 unsigned long handle = 0; in find_alloced_obj() local
1590 handle = head & ~OBJ_ALLOCATED_TAG; in find_alloced_obj()
1591 if (trypin_tag(handle)) in find_alloced_obj()
1593 handle = 0; in find_alloced_obj()
1601 return handle; in find_alloced_obj()
1621 unsigned long handle; in migrate_zspage() local
1629 handle = find_alloced_obj(s_page, index, class); in migrate_zspage()
1630 if (!handle) { in migrate_zspage()
1640 unpin_tag(handle); in migrate_zspage()
1645 used_obj = handle_to_obj(handle); in migrate_zspage()
1646 free_obj = obj_malloc(d_page, class, handle); in migrate_zspage()
1656 record_obj(handle, free_obj); in migrate_zspage()
1657 unpin_tag(handle); in migrate_zspage()