Lines Matching refs:size
31 * zbud pages are divided into "chunks". The size of the chunks is fixed at
63 * allocation granularity will be in chunks of size PAGE_SIZE/64. As one chunk
82 * the lists each zbud page is added to depends on the size of
108 * @first_chunks: the size of the first buddy in chunks, 0 if free
109 * @last_chunks: the size of the last buddy in chunks, 0 if free
126 /* Converts an allocation size in bytes to size in zbud chunks */
127 static int size_to_chunks(size_t size)
129 return (size + CHUNK_SIZE - 1) >> CHUNK_SHIFT;
228 * zbud_alloc() - allocates a region of a given size
230 * @size: size in bytes of the desired allocation
242 * Return: 0 if success and handle is set, otherwise -EINVAL if the size or
246 static int zbud_alloc(struct zbud_pool *pool, size_t size, gfp_t gfp,
254 if (!size || (gfp & __GFP_HIGHMEM))
256 if (size > PAGE_SIZE - ZHDR_SIZE_ALIGNED - CHUNK_SIZE)
258 chunks = size_to_chunks(size);
368 * zbud_get_pool_size() - gets the zbud pool size in pages
369 * @pool: pool whose size is being queried
371 * Returns: size in pages of the given pool. The pool lock need not be
393 static int zbud_zpool_malloc(void *pool, size_t size, gfp_t gfp,
396 return zbud_alloc(pool, size, gfp, handle);