Lines Matching refs:handle

240 		unsigned long handle;  member
305 static void free_handle(struct zs_pool *pool, unsigned long handle) in free_handle() argument
307 kmem_cache_free(pool->handle_cachep, (void *)handle); in free_handle()
310 static void record_obj(unsigned long handle, unsigned long obj) in record_obj() argument
317 WRITE_ONCE(*(unsigned long *)handle, obj); in record_obj()
337 unsigned long *handle) in zs_zpool_malloc() argument
339 *handle = zs_malloc(pool, size); in zs_zpool_malloc()
340 return *handle ? 0 : -1; in zs_zpool_malloc()
342 static void zs_zpool_free(void *pool, unsigned long handle) in zs_zpool_free() argument
344 zs_free(pool, handle); in zs_zpool_free()
353 static void *zs_zpool_map(void *pool, unsigned long handle, in zs_zpool_map() argument
371 return zs_map_object(pool, handle, zs_mm); in zs_zpool_map()
373 static void zs_zpool_unmap(void *pool, unsigned long handle) in zs_zpool_unmap() argument
375 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()
1467 void zs_free(struct zs_pool *pool, unsigned long handle) in zs_free() argument
1475 if (unlikely(!handle)) in zs_free()
1478 pin_tag(handle); in zs_free()
1479 obj = handle_to_obj(handle); in zs_free()
1497 unpin_tag(handle); in zs_free()
1499 free_handle(pool, handle); in zs_free()
1577 unsigned long handle = 0; in find_alloced_obj() local
1587 handle = head & ~OBJ_ALLOCATED_TAG; in find_alloced_obj()
1588 if (trypin_tag(handle)) in find_alloced_obj()
1590 handle = 0; in find_alloced_obj()
1598 return handle; in find_alloced_obj()
1616 unsigned long handle; in migrate_zspage() local
1623 handle = find_alloced_obj(s_page, index, class); in migrate_zspage()
1624 if (!handle) { in migrate_zspage()
1634 unpin_tag(handle); in migrate_zspage()
1639 used_obj = handle_to_obj(handle); in migrate_zspage()
1640 free_obj = obj_malloc(d_page, class, handle); in migrate_zspage()
1650 record_obj(handle, free_obj); in migrate_zspage()
1651 unpin_tag(handle); in migrate_zspage()