MCPcopy Create free account
hub / github.com/F-Stack/f-stack / compressor_init

Function compressor_init

freebsd/kern/subr_compressor.c:510–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508}
509
510struct compressor *
511compressor_init(compressor_cb_t cb, int format, size_t maxiosize, int level,
512 void *arg)
513{
514 struct compressor_methods **iter;
515 struct compressor *s;
516 void *priv;
517
518 SET_FOREACH(iter, compressors) {
519 if ((*iter)->format == format)
520 break;
521 }
522 if (iter == SET_LIMIT(compressors))
523 return (NULL);
524
525 priv = (*iter)->init(maxiosize, level);
526 if (priv == NULL)
527 return (NULL);
528
529 s = malloc(sizeof(*s), M_COMPRESS, M_WAITOK | M_ZERO);
530 s->methods = (*iter);
531 s->priv = priv;
532 s->cb = cb;
533 s->arg = arg;
534 return (s);
535}
536
537void
538compressor_reset(struct compressor *stream)

Callers 2

__elfN(coredump)Function · 0.85
kerneldumpcomp_createFunction · 0.85

Calls 1

mallocFunction · 0.85

Tested by

no test coverage detected