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