]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - repair/prefetch.h
xfs_repair: don't leak buffer on xattr remote buf verifier error
[thirdparty/xfsprogs-dev.git] / repair / prefetch.h
CommitLineData
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 7struct workqueue;
2556c98b
BN
8
9extern int do_prefetch;
10
11#define PF_THREAD_COUNT 4
12
13typedef 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
34void
35init_prefetch(
36 xfs_mount_t *pmp);
37
38prefetch_args_t *
39start_inode_prefetch(
40 xfs_agnumber_t agno,
41 int dirs_only,
42 prefetch_args_t *prev_args);
43
1164bde5
DC
44void
45do_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
53void
54wait_for_inode_prefetch(
55 prefetch_args_t *args);
56
57void
58cleanup_inode_prefetch(
59 prefetch_args_t *args);
60
61
62#ifdef XR_PF_TRACE
4c0a98ae
BN
63void pftrace_init(void);
64void pftrace_done(void);
65
2556c98b
BN
66#define pftrace(msg...) _pftrace(__FUNCTION__, ## msg)
67void _pftrace(const char *, const char *, ...);
4c0a98ae
BN
68#else
69static inline void pftrace_init(void) { };
70static inline void pftrace_done(void) { };
71static inline void pftrace(const char *msg, ...) { };
2556c98b 72#endif
cb5b3ef4
MV
73
74#endif /* _XFS_REPAIR_PREFETCH_H */