*/
uint32_t cookie;
/** The associated task structure. */
- struct task task;
+ struct task *task;
};
extern int mmd_mutex;
static void command_pre_select(struct sched *s, struct task *t)
{
- struct command_task *ct = container_of(t, struct command_task, task);
+ struct command_task *ct = task_context(t);
struct afs_client *client;
para_fd_set(server_socket, &s->rfds, &s->max_fileno);
static int command_post_select(struct sched *s, struct task *t)
{
- struct command_task *ct = container_of(t, struct command_task, task);
+ struct command_task *ct = task_context(t);
struct sockaddr_un unix_addr;
struct afs_client *client, *tmp;
int fd, ret;
ct->fd = setup_command_socket_or_die();
ct->cookie = cookie;
- ct->task.pre_select = command_pre_select;
- ct->task.post_select = command_post_select;
- sprintf(ct->task.status, "afs command task");
- register_task(s, &ct->task);
+ ct->task = task_register(&(struct task_info) {
+ .name = "afs command",
+ .pre_select = command_pre_select,
+ .post_select = command_post_select,
+ .context = ct,
+ }, s);
}
/**
s.default_timeout.tv_sec = 0;
s.default_timeout.tv_usec = 999 * 1000;
ret = schedule(&s);
+ sched_shutdown(&s);
out_close:
close_afs_tables();
out: