-static int file_write_open(struct writer_node *wn)
-{
- struct private_file_write_data *pfwd = para_calloc(
- sizeof(struct private_file_write_data));
- struct file_write_args_info *conf = wn->conf;
- char *filename;
-
- if (conf->filename_given)
- filename = conf->filename_arg;
- else
- filename = random_filename();
- wn->private_data = pfwd;
- pfwd->fd = open(filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
- if (!conf->filename_given)
- free(filename);
- if (pfwd->fd >= 0)
- return 1;
- free(pfwd);
- return -E_FW_OPEN;
-}
-
-static int file_write_pre_select(struct sched *s, struct writer_node *wn)
-{
- struct private_file_write_data *pfwd = wn->private_data;
- struct writer_node_group *wng = wn->wng;
-
- pfwd->check_fd = 0;
- if (pfwd->fd <= 0)
- return -E_FW_NO_FILE;
- if (!*wng->loaded)
- return 1;
- para_fd_set(pfwd->fd, &s->wfds, &s->max_fileno);
- pfwd->check_fd = 1;
- return 1;
-}
-
-static void file_write_pre_select_btr(struct sched *s, struct task *t)