Lines Matching refs:chunk

79 	struct objset_dnode_chunk *chunk;  in objset_alloc()  local
91 chunk = ecalloc(1, sizeof(*chunk)); in objset_alloc()
92 chunk->nextfree = 1; in objset_alloc()
93 STAILQ_INSERT_HEAD(&os->dnodechunks, chunk, next); in objset_alloc()
113 struct objset_dnode_chunk *chunk, *tmp; in _objset_write() local
121 STAILQ_FOREACH_SAFE(chunk, &os->dnodechunks, next, tmp) { in _objset_write()
124 assert(chunk->nextfree > 0); in _objset_write()
125 assert(chunk->nextfree <= os->dnodecount); in _objset_write()
126 assert(chunk->nextfree <= DNODES_PER_CHUNK); in _objset_write()
128 for (i = 0; i < chunk->nextfree; i += DNODES_PER_BLOCK) { in _objset_write()
132 if (chunk->nextfree - i < DNODES_PER_BLOCK) in _objset_write()
133 fill = DNODES_PER_BLOCK - (chunk->nextfree - i); in _objset_write()
139 0, fill, chunk->buf + i, DNODE_BLOCK_SIZE, loc, bp); in _objset_write()
144 free(chunk); in _objset_write()
197 struct objset_dnode_chunk *chunk; in objset_dnode_bonus_alloc() local
203 chunk = STAILQ_LAST(&os->dnodechunks, objset_dnode_chunk, next); in objset_dnode_bonus_alloc()
204 if (chunk->nextfree == DNODES_PER_CHUNK) { in objset_dnode_bonus_alloc()
205 chunk = ecalloc(1, sizeof(*chunk)); in objset_dnode_bonus_alloc()
206 STAILQ_INSERT_TAIL(&os->dnodechunks, chunk, next); in objset_dnode_bonus_alloc()
209 dnode = &chunk->buf[chunk->nextfree++]; in objset_dnode_bonus_alloc()
228 struct objset_dnode_chunk *chunk; in objset_dnode_lookup() local
233 STAILQ_FOREACH(chunk, &os->dnodechunks, next) { in objset_dnode_lookup()
235 return (&chunk->buf[id]); in objset_dnode_lookup()