]>
Commit | Line | Data |
---|---|---|
cb5b3ef4 MV |
1 | #ifndef _XFS_REPAIR_PREFETCH_H |
2 | #define _XFS_REPAIR_PREFETCH_H | |
3 | ||
2556c98b BN |
4 | #include <semaphore.h> |
5 | #include "incore.h" | |
2556c98b | 6 | |
62843f36 | 7 | struct workqueue; |
2556c98b BN |
8 | |
9 | extern int do_prefetch; | |
10 | ||
11 | #define PF_THREAD_COUNT 4 | |
12 | ||
13 | typedef struct prefetch_args { | |
14 | pthread_mutex_t lock; | |
15 | pthread_t queuing_thread; | |
16 | pthread_t io_threads[PF_THREAD_COUNT]; | |
bb34c934 | 17 | struct btree_root *io_queue; |
2556c98b BN |
18 | pthread_cond_t start_reading; |
19 | pthread_cond_t start_processing; | |
20 | int agno; | |
21 | int dirs_only; | |
22 | volatile int can_start_reading; | |
23 | volatile int can_start_processing; | |
24 | volatile int prefetch_done; | |
25 | volatile int queuing_done; | |
26 | volatile int inode_bufs_queued; | |
27 | volatile xfs_fsblock_t last_bno_read; | |
28 | sem_t ra_count; | |
29 | struct prefetch_args *next_args; | |
30 | } prefetch_args_t; | |
31 | ||
32 | ||
33 | ||
34 | void | |
35 | init_prefetch( | |
36 | xfs_mount_t *pmp); | |
37 | ||
38 | prefetch_args_t * | |
39 | start_inode_prefetch( | |
40 | xfs_agnumber_t agno, | |
41 | int dirs_only, | |
42 | prefetch_args_t *prev_args); | |
43 | ||
1164bde5 DC |
44 | void |
45 | do_inode_prefetch( | |
46 | struct xfs_mount *mp, | |
47 | int stride, | |
62843f36 | 48 | void (*func)(struct workqueue *, |
1164bde5 DC |
49 | xfs_agnumber_t, void *), |
50 | bool check_cache, | |
51 | bool dirs_only); | |
52 | ||
2556c98b BN |
53 | void |
54 | wait_for_inode_prefetch( | |
55 | prefetch_args_t *args); | |
56 | ||
57 | void | |
58 | cleanup_inode_prefetch( | |
59 | prefetch_args_t *args); | |
60 | ||
61 | ||
62 | #ifdef XR_PF_TRACE | |
4c0a98ae BN |
63 | void pftrace_init(void); |
64 | void pftrace_done(void); | |
65 | ||
2556c98b BN |
66 | #define pftrace(msg...) _pftrace(__FUNCTION__, ## msg) |
67 | void _pftrace(const char *, const char *, ...); | |
4c0a98ae BN |
68 | #else |
69 | static inline void pftrace_init(void) { }; | |
70 | static inline void pftrace_done(void) { }; | |
71 | static inline void pftrace(const char *msg, ...) { }; | |
2556c98b | 72 | #endif |
cb5b3ef4 MV |
73 | |
74 | #endif /* _XFS_REPAIR_PREFETCH_H */ |