• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/lib/

Lines Matching defs:chunk

42  * gen_pool_add - add a new chunk of special memory to the pool
43 * @pool: pool to add new memory chunk to
44 * @addr: starting address of memory chunk to add to pool
45 * @size: size in bytes of the memory chunk to add to pool
46 * @nid: node id of the node the chunk structure and bitmap should be
49 * Add a new chunk of special memory to the specified pool.
54 struct gen_pool_chunk *chunk;
59 chunk = kmalloc_node(nbytes, GFP_KERNEL | __GFP_ZERO, nid);
60 if (unlikely(chunk == NULL))
63 spin_lock_init(&chunk->lock);
64 chunk->start_addr = addr;
65 chunk->end_addr = addr + size;
68 list_add(&chunk->next_chunk, &pool->chunks);
85 struct gen_pool_chunk *chunk;
91 chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
92 list_del(&chunk->next_chunk);
94 end_bit = (chunk->end_addr - chunk->start_addr) >> order;
95 bit = find_next_bit(chunk->bits, end_bit, 0);
98 kfree(chunk);
116 struct gen_pool_chunk *chunk;
128 chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
130 end_bit = (chunk->end_addr - chunk->start_addr) >> order;
132 spin_lock_irqsave(&chunk->lock, flags);
133 start_bit = bitmap_find_next_zero_area(chunk->bits, end_bit, 0,
136 spin_unlock_irqrestore(&chunk->lock, flags);
140 addr = chunk->start_addr + ((unsigned long)start_bit << order);
142 bitmap_set(chunk->bits, start_bit, nbits);
143 spin_unlock_irqrestore(&chunk->lock, flags);
163 struct gen_pool_chunk *chunk;
172 chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
174 if (addr >= chunk->start_addr && addr < chunk->end_addr) {
175 BUG_ON(addr + size > chunk->end_addr);
176 spin_lock_irqsave(&chunk->lock, flags);
177 bit = (addr - chunk->start_addr) >> order;
179 __clear_bit(bit++, chunk->bits);
180 spin_unlock_irqrestore(&chunk->lock, flags);