+ if (!pfwd)
+ return;
+ close(pfwd->fd);
+ free(pfwd);
+}
+
+static void file_write_post_select(__a_unused struct sched *s,
+ struct task *t)
+{
+ struct writer_node *wn = container_of(t, struct writer_node, task);
+ struct private_file_write_data *pfwd = wn->private_data;
+ struct btr_node *btrn = wn->btrn;
+ int ret;
+ char *buf;
+ size_t bytes;
+
+ t->error = 0;
+ ret = btr_node_status(btrn, wn->min_iqs, BTR_NT_LEAF);
+ if (ret <= 0)
+ goto out;
+ if (!pfwd) {
+ ret = prepare_output_file(wn);
+ goto out;
+ }