/*
- * Copyright (C) 2011-2013 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2011-2014 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
if (x >= pard->afhi.chunks_total)
return -ERRNO_TO_PARA_ERROR(EINVAL);
pard->first_chunk = pard->current_chunk = x;
- rn->task.error = 0;
return 1;
}
return -E_BTR_NAVAIL;
{
struct afh_recv_args_info *tmp = para_calloc(sizeof(*tmp));
- if (!afh_recv_cmdline_parser(argc, argv, tmp))
- return tmp;
- free(tmp);
- return NULL;
+ afh_recv_cmdline_parser(argc, argv, tmp);
+ return tmp;
}
static void afh_recv_free_config(void *conf)
static void afh_recv_pre_select(struct sched *s, struct task *t)
{
- struct receiver_node *rn = container_of(t, struct receiver_node, task);
+ struct receiver_node *rn = task_context(t);
struct private_afh_recv_data *pard = rn->private_data;
struct afh_info *afhi = &pard->afhi;
struct afh_recv_args_info *conf = rn->conf;
static int afh_recv_post_select(__a_unused struct sched *s, struct task *t)
{
- struct receiver_node *rn = container_of(t, struct receiver_node, task);
+ struct receiver_node *rn = task_context(t);
struct afh_recv_args_info *conf = rn->conf;
struct private_afh_recv_data *pard = rn->private_data;
struct btr_node *btrn = rn->btrn;
r->open = afh_recv_open;
r->close = afh_recv_close;
r->pre_select = afh_recv_pre_select;
- r->new_post_select = afh_recv_post_select;
+ r->post_select = afh_recv_post_select;
r->parse_config = afh_recv_parse_config;
r->free_config = afh_recv_free_config;
r->execute = afh_execute;
- r->help = (struct ggo_help) {
- .short_help = afh_recv_args_info_help,
- .detailed_help = afh_recv_args_info_detailed_help
- };
+ r->help = (struct ggo_help)DEFINE_GGO_HELP(afh_recv);
afh_recv_cmdline_parser_free(&dummy);
}