/** * ubifs_compressors_init - initialize UBIFS compressors. * * This function initializes the compressor which were compiled in. Returns * zero in case of success and a negative error code in case of failure. */ int __init ubifs_compressors_init(void) { int err; err = compr_init(&lzo_compr); if (err) return err; err = compr_init(&lzo999_compr); if (err) goto out_lzo; err = compr_init(&zlib_compr); if (err) goto out_lzo999; ubifs_compressors[UBIFS_COMPR_NONE] = &none_compr; return 0; out_lzo999: compr_exit(&lzo999_compr); out_lzo: compr_exit(&lzo_compr); return err; }
/** * ubifs_compressors_init - initialize UBIFS compressors. * * This function initializes the compressor which were compiled in. Returns * zero in case of success and a negative error code in case of failure. */ int __init ubifs_compressors_init(void) { int err; err = compr_init(&lzo_compr); if (err) return err; err = compr_init(&zlib_compr); if (err) return err; err = compr_init(&none_compr); if (err) return err; return 0; }
int scfs_compressors_init(void) { int err; err = compr_init(&lzo_compr); if (err) return err; err = compr_init(&zlib_compr); if (err) goto out_lzo; scfs_compressors[SCFS_COMP_NONE] = &none_compr; return 0; out_lzo: compr_exit(&lzo_compr); return err; }
/** * ubifs_compressors_init - initialize UBIFS compressors. * * This function initializes the compressor which were compiled in. Returns * zero in case of success and a negative error code in case of failure. */ int __init ubifs_compressors_init(void) { int err; err = compr_init(&lzo_compr); if (err) return err; #ifdef CONFIG_GZIP // MSTAR err = compr_init(&zlib_compr); if (err) return err; #endif //CONFIG_GZIP err = compr_init(&none_compr); if (err) return err; return 0; }
void* worker_dowork(void* varg) { worker_t* w = (worker_t*) varg; if (!w) { return NULL; } qitem_t* qi; compr_t c; while ((qi = llbqueue_deq(w->q))) { if (qitem_isvalid(qi)) { if (compr_init(&c, qi)) { compr_compr(&c); } compr_free(&c); w->filec++; } qitem_free(qi); } pthread_exit(NULL); }