1 // SPDX-License-Identifier: GPL-2.0
3 #ifndef _XFS_REPAIR_PREFETCH_H
4 #define _XFS_REPAIR_PREFETCH_H
11 extern int do_prefetch
;
13 #define PF_THREAD_COUNT 4
15 typedef struct prefetch_args
{
17 pthread_t queuing_thread
;
18 pthread_t io_threads
[PF_THREAD_COUNT
];
19 struct btree_root
*io_queue
;
20 pthread_cond_t start_reading
;
21 pthread_cond_t start_processing
;
24 volatile int can_start_reading
;
25 volatile int can_start_processing
;
26 volatile int prefetch_done
;
27 volatile int queuing_done
;
28 volatile int inode_bufs_queued
;
29 volatile xfs_fsblock_t last_bno_read
;
31 struct prefetch_args
*next_args
;
44 prefetch_args_t
*prev_args
);
50 void (*func
)(struct workqueue
*,
51 xfs_agnumber_t
, void *),
56 wait_for_inode_prefetch(
57 prefetch_args_t
*args
);
60 cleanup_inode_prefetch(
61 prefetch_args_t
*args
);
65 void pftrace_init(void);
66 void pftrace_done(void);
68 #define pftrace(msg...) _pftrace(__FUNCTION__, ## msg)
69 void _pftrace(const char *, const char *, ...);
71 static inline void pftrace_init(void) { };
72 static inline void pftrace_done(void) { };
73 static inline void pftrace(const char *msg
, ...) { };
76 #endif /* _XFS_REPAIR_PREFETCH_H */