• Home
  • Raw
  • Download

Lines Matching refs:handle

248 		unsigned long handle;  member
353 static void cache_free_handle(struct zs_pool *pool, unsigned long handle) in cache_free_handle() argument
355 kmem_cache_free(pool->handle_cachep, (void *)handle); in cache_free_handle()
369 static void record_obj(unsigned long handle, unsigned long obj) in record_obj() argument
376 WRITE_ONCE(*(unsigned long *)handle, obj); in record_obj()
401 unsigned long *handle) in zs_zpool_malloc() argument
403 *handle = zs_malloc(pool, size, gfp); in zs_zpool_malloc()
404 return *handle ? 0 : -1; in zs_zpool_malloc()
406 static void zs_zpool_free(void *pool, unsigned long handle) in zs_zpool_free() argument
408 zs_free(pool, handle); in zs_zpool_free()
411 static void *zs_zpool_map(void *pool, unsigned long handle, in zs_zpool_map() argument
429 return zs_map_object(pool, handle, zs_mm); in zs_zpool_map()
431 static void zs_zpool_unmap(void *pool, unsigned long handle) in zs_zpool_unmap() argument
433 zs_unmap_object(pool, handle); in zs_zpool_unmap()
866 static unsigned long handle_to_obj(unsigned long handle) in handle_to_obj() argument
868 return *(unsigned long *)handle; in handle_to_obj()
880 static inline int testpin_tag(unsigned long handle) in testpin_tag() argument
882 return bit_spin_is_locked(HANDLE_PIN_BIT, (unsigned long *)handle); in testpin_tag()
885 static inline int trypin_tag(unsigned long handle) in trypin_tag() argument
887 return bit_spin_trylock(HANDLE_PIN_BIT, (unsigned long *)handle); in trypin_tag()
890 static void pin_tag(unsigned long handle) __acquires(bitlock) in pin_tag() argument
892 bit_spin_lock(HANDLE_PIN_BIT, (unsigned long *)handle); in pin_tag()
895 static void unpin_tag(unsigned long handle) __releases(bitlock) in unpin_tag() argument
897 bit_spin_unlock(HANDLE_PIN_BIT, (unsigned long *)handle); in unpin_tag()
1245 void *zs_map_object(struct zs_pool *pool, unsigned long handle, in zs_map_object() argument
1268 pin_tag(handle); in zs_map_object()
1270 obj = handle_to_obj(handle); in zs_map_object()
1304 void zs_unmap_object(struct zs_pool *pool, unsigned long handle) in zs_unmap_object() argument
1316 obj = handle_to_obj(handle); in zs_unmap_object()
1338 unpin_tag(handle); in zs_unmap_object()
1362 struct zspage *zspage, unsigned long handle) in obj_malloc() argument
1372 handle |= OBJ_ALLOCATED_TAG; in obj_malloc()
1388 link->handle = handle; in obj_malloc()
1391 zspage->first_page->index = handle; in obj_malloc()
1415 unsigned long handle, obj; in zs_malloc() local
1423 handle = cache_alloc_handle(pool, gfp); in zs_malloc()
1424 if (!handle) in zs_malloc()
1434 obj = obj_malloc(class, zspage, handle); in zs_malloc()
1437 record_obj(handle, obj); in zs_malloc()
1440 return handle; in zs_malloc()
1447 cache_free_handle(pool, handle); in zs_malloc()
1452 obj = obj_malloc(class, zspage, handle); in zs_malloc()
1456 record_obj(handle, obj); in zs_malloc()
1465 return handle; in zs_malloc()
1494 void zs_free(struct zs_pool *pool, unsigned long handle) in zs_free() argument
1505 if (unlikely(!handle)) in zs_free()
1508 pin_tag(handle); in zs_free()
1509 obj = handle_to_obj(handle); in zs_free()
1534 unpin_tag(handle); in zs_free()
1535 cache_free_handle(pool, handle); in zs_free()
1612 unsigned long handle = 0; in find_alloced_obj() local
1621 handle = head & ~OBJ_ALLOCATED_TAG; in find_alloced_obj()
1622 if (trypin_tag(handle)) in find_alloced_obj()
1624 handle = 0; in find_alloced_obj()
1635 return handle; in find_alloced_obj()
1653 unsigned long handle; in migrate_zspage() local
1660 handle = find_alloced_obj(class, s_page, &obj_idx); in migrate_zspage()
1661 if (!handle) { in migrate_zspage()
1671 unpin_tag(handle); in migrate_zspage()
1676 used_obj = handle_to_obj(handle); in migrate_zspage()
1677 free_obj = obj_malloc(class, get_zspage(d_page), handle); in migrate_zspage()
1687 record_obj(handle, free_obj); in migrate_zspage()
1688 unpin_tag(handle); in migrate_zspage()
1966 unsigned long handle, head; in zs_page_migrate() local
2005 handle = head & ~OBJ_ALLOCATED_TAG; in zs_page_migrate()
2006 if (!trypin_tag(handle)) in zs_page_migrate()
2023 handle = head & ~OBJ_ALLOCATED_TAG; in zs_page_migrate()
2024 if (!testpin_tag(handle)) in zs_page_migrate()
2027 old_obj = handle_to_obj(handle); in zs_page_migrate()
2032 record_obj(handle, new_obj); in zs_page_migrate()
2071 handle = head & ~OBJ_ALLOCATED_TAG; in zs_page_migrate()
2072 if (!testpin_tag(handle)) in zs_page_migrate()
2074 unpin_tag(handle); in zs_page_migrate()