From: Andre Noll Date: Fri, 8 May 2009 19:49:30 +0000 (+0200) Subject: Allow writers that have no pre_select functions. X-Git-Tag: v0.3.5~59 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=fe37582752e4f874f03f303a0548db115e9542ee;p=paraslash.git Allow writers that have no pre_select functions. Also, fix the pointer being printed in a debug message of the scheduler. --- diff --git a/sched.c b/sched.c index 9e346df2..daf6603f 100644 --- a/sched.c +++ b/sched.c @@ -50,7 +50,7 @@ static void sched_preselect(struct sched *s) { struct task *t, *tmp; list_for_each_entry_safe(t, tmp, &pre_select_list, pre_select_node) { - if (t->error >= 0) + if (t->error >= 0 && t->pre_select) t->pre_select(s, t); // PARA_INFO_LOG("%s \n", t->status); if (t->error >= 0) @@ -157,7 +157,7 @@ void register_task(struct task *t) list_add_tail(&t->pre_select_node, &pre_select_list); } if (t->post_select) { - PARA_DEBUG_LOG("post_select: %p\n", &t->pre_select); + PARA_DEBUG_LOG("post_select: %p\n", &t->post_select); list_add_tail(&t->post_select_node, &post_select_list); } } diff --git a/write_common.c b/write_common.c index dcf7bb16..b684661b 100644 --- a/write_common.c +++ b/write_common.c @@ -27,6 +27,8 @@ static void wng_pre_select(__a_unused struct sched *s, struct task *t) FOR_EACH_WRITER_NODE(i, g) { struct writer_node *wn = &g->writer_nodes[i]; + if (!wn->writer->pre_select) + continue; t->error = wn->writer->pre_select(s, wn); if (t->error < 0) return;