]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - repair/threads.h
xfs: create bmbt update intent log items
[thirdparty/xfsprogs-dev.git] / repair / threads.h
1 #ifndef _XFS_REPAIR_THREADS_H_
2 #define _XFS_REPAIR_THREADS_H_
3
4 void thread_init(void);
5
6 struct work_queue;
7
8 typedef void work_func_t(struct work_queue *, xfs_agnumber_t, void *);
9
10 typedef struct work_item {
11 struct work_item *next;
12 work_func_t *function;
13 struct work_queue *queue;
14 xfs_agnumber_t agno;
15 void *arg;
16 } work_item_t;
17
18 typedef struct work_queue {
19 work_item_t *next_item;
20 work_item_t *last_item;
21 int item_count;
22 int thread_count;
23 pthread_t *threads;
24 xfs_mount_t *mp;
25 pthread_mutex_t lock;
26 pthread_cond_t wakeup;
27 int terminate;
28 } work_queue_t;
29
30 void
31 create_work_queue(
32 work_queue_t *wq,
33 xfs_mount_t *mp,
34 int nworkers);
35
36 void
37 queue_work(
38 work_queue_t *wq,
39 work_func_t func,
40 xfs_agnumber_t agno,
41 void *arg);
42
43 void
44 destroy_work_queue(
45 work_queue_t *wq);
46
47 #endif /* _XFS_REPAIR_THREADS_H_ */