janitor: add DIV_ROUND_UP and use it.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Pierre Habouzit
2009-07-22 23:34:35 +02:00
committed by Junio C Hamano
parent f630cfda88
commit 98cb6f30f7
3 changed files with 4 additions and 2 deletions

View File

@ -76,7 +76,7 @@ static void preload_index(struct index_state *index, const char **pathspec)
if (threads > MAX_PARALLEL)
threads = MAX_PARALLEL;
offset = 0;
work = (index->cache_nr + threads - 1) / threads;
work = DIV_ROUND_UP(index->cache_nr, threads);
for (i = 0; i < threads; i++) {
struct thread_data *p = data+i;
p->index = index;