void makeflow_gc( struct dag *d, struct batch_queue *queue, makeflow_gc_method_t method, uint64_t size, int count ) { if(size == 0) size = MAKEFLOW_MIN_SPACE; switch (method) { case MAKEFLOW_GC_NONE: break; case MAKEFLOW_GC_COUNT: debug(D_MAKEFLOW_RUN, "Performing incremental file (%d) garbage collection", count); makeflow_gc_all(d, queue, count); break; case MAKEFLOW_GC_ON_DEMAND: if(d->completed_files - d->deleted_files > count || directory_low_disk(".",size)){ debug(D_MAKEFLOW_RUN, "Performing on demand (%d) garbage collection", count); makeflow_gc_all(d, queue, INT_MAX); } break; case MAKEFLOW_GC_SIZE: if(directory_low_disk(".", size)) { debug(D_MAKEFLOW_RUN, "Performing size (%d) garbage collection", count); makeflow_gc_all(d, queue, INT_MAX); } break; case MAKEFLOW_GC_ALL: makeflow_gc_all(d, queue, INT_MAX); break; } }
void makeflow_gc( struct dag *d, makeflow_gc_method_t method, int count ) { switch (method) { case MAKEFLOW_GC_NONE: break; case MAKEFLOW_GC_REF_COUNT: debug(D_MAKEFLOW_RUN, "Performing incremental file (%d) garbage collection", count); makeflow_gc_all(d, count); break; case MAKEFLOW_GC_ON_DEMAND: if(directory_inode_count(".") >= count || directory_low_disk(".")) { debug(D_MAKEFLOW_RUN, "Performing on demand (%d) garbage collection", count); makeflow_gc_all(d, INT_MAX); } break; case MAKEFLOW_GC_FORCE: makeflow_gc_all(d,INT_MAX); break; } }