1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _LINUX_VHOST_TASK_H 3 #define _LINUX_VHOST_TASK_H 4 5 #include <linux/completion.h> 6 7 struct task_struct; 8 9 struct vhost_task { 10 int (*fn)(void *data); 11 void *data; 12 struct completion exited; 13 unsigned long flags; 14 struct task_struct *task; 15 }; 16 17 struct vhost_task *vhost_task_create(int (*fn)(void *), void *arg, 18 const char *name); 19 void vhost_task_start(struct vhost_task *vtsk); 20 void vhost_task_stop(struct vhost_task *vtsk); 21 bool vhost_task_should_stop(struct vhost_task *vtsk); 22 23 #endif 24