X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=write_common.c;h=b684661b4aa04ccdfd736b6319bf857c74080498;hb=fe37582752e4f874f03f303a0548db115e9542ee;hp=8fb6c3d10797c4fc7ea4119de5c990271f177482;hpb=002731cd3938f3be6b71651e56c062af1adcdec0;p=paraslash.git diff --git a/write_common.c b/write_common.c index 8fb6c3d1..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; @@ -61,7 +63,7 @@ static void wng_post_select(struct sched *s, struct task *t) } if (*g->loaded && min_written) { // PARA_INFO_LOG("moving %zd bytes\n", *g->loaded); - memmove(g->buf, g->buf + min_written, *g->loaded); + memmove(*g->bufp, *g->bufp + min_written, *g->loaded); } } @@ -86,8 +88,6 @@ int wng_open(struct writer_node_group *g) ret = wn->writer->open(wn); if (ret < 0) goto err_out; - wn->chunk_bytes = ret; - g->max_chunk_bytes = PARA_MAX(g->max_chunk_bytes, ret); } sprintf(g->task.status, "%s", "writer node group"); register_task(&g->task); @@ -144,9 +144,9 @@ struct writer_node_group *wng_new(unsigned num_writers) } /** - * call the init function of each supported paraslash writer + * Call the init function of each supported paraslash writer. */ -void init_supported_writers(void) +void writer_init(void) { int i;