terom@30: /* terom@30: * On-disk structs terom@30: */ terom@30: terom@30: #pragma pack(push) terom@30: #pragma pack(1) terom@30: terom@30: struct cache_nest_header { terom@30: u_int32_t next_offset; terom@30: }; terom@30: terom@30: int _cache_nest_assign_op (struct cache *ctx, struct cache_op *op_info, struct cache_nest **nest_info) { terom@30: for (int i = 0; i < CACHE_NEST_COUNT; i++) { terom@30: if (ctx->nests[i].op == NULL) { terom@30: // found an unused nest terom@30: ctx->nests[i].op = op_info; terom@30: *nest_info = ctx->nests[i].op; terom@30: terom@30: return 0; terom@30: } terom@30: } terom@30: terom@30: // no unused nests terom@30: return -1; terom@30: } terom@30: