Lines Matching refs:offset
49 * Given <page, offset> pair, provide a derefrencable pointer.
53 static void *get_ptr_atomic(struct page *page, u16 offset, enum km_type type)
58 return base + offset;
111 * @offset: offset within the page where block is located.
115 * <page, offset> to identify this block and returns index
117 * Otherwise, returns 0 and <page, offset> params are not touched.
120 struct page **page, u32 *offset)
140 *offset = pool->freelist[slindex].offset;
157 *offset = pool->freelist[slindex].offset;
172 *offset = pool->freelist[slindex].offset;
178 * Insert block at <page, offset> in freelist of given pool.
181 static void insert_block(struct xv_pool *pool, struct page *page, u32 offset,
193 block->link.next_offset = pool->freelist[slindex].offset;
195 pool->freelist[slindex].offset = offset;
201 nextblock->link.prev_offset = offset;
219 pool->freelist[slindex].offset = block->link.next_offset;
234 pool->freelist[slindex].offset, KM_USER1);
244 static void remove_block(struct xv_pool *pool, struct page *page, u32 offset,
251 && pool->freelist[slindex].offset == offset) {
334 * @offset: location of object within page
336 * On success, <page, offset> identifies block allocated
337 * and 0 is returned. On failure, <page, offset> is set to
343 u32 *offset, gfp_t flags)
350 *offset = 0;
360 index = find_block(pool, size, page, offset);
371 index = find_block(pool, size, page, offset);
379 block = get_ptr_atomic(*page, *offset, KM_USER0);
384 tmpoffset = *offset + size + XV_ALIGN;
392 set_blockprev(tmpblock, *offset);
412 *offset += XV_ALIGN;
418 * Free block identified with <page, offset>
420 void xv_free(struct xv_pool *pool, struct page *page, u32 offset)
425 offset -= XV_ALIGN;
430 block = (struct block_header *)((char *)page_start + offset);
438 if (offset + block->size + XV_ALIGN == PAGE_SIZE)
449 offset + block->size + XV_ALIGN, tmpblock,
459 offset = offset - tmpblock->size - XV_ALIGN;
462 remove_block(pool, page, offset, tmpblock,
481 insert_block(pool, page, offset, block);
483 if (offset + block->size + XV_ALIGN != PAGE_SIZE) {
486 set_blockprev(tmpblock, offset);