root / drivers / tapdisk-filter.h @ abdb293f
History | View | Annotate | Download (988 Bytes)
1 |
/* Copyright (c) 2007, XenSource Inc.
|
---|---|
2 |
* All rights reserved.
|
3 |
*/
|
4 |
|
5 |
#ifndef TAPDISK_FILTER_H
|
6 |
#define TAPDISK_FILTER_H
|
7 |
|
8 |
#include <libaio.h> |
9 |
#include <inttypes.h> |
10 |
#include <time.h> |
11 |
|
12 |
#define TD_INJECT_FAULTS 0x00001 /* simulate random IO failures */ |
13 |
#define TD_CHECK_INTEGRITY 0x00002 /* check data integrity */ |
14 |
|
15 |
#define TD_FAULT_RATE 5 |
16 |
|
17 |
struct dhash {
|
18 |
uint64_t hash; |
19 |
struct timeval time;
|
20 |
}; |
21 |
|
22 |
struct fiocb {
|
23 |
size_t bytes; |
24 |
void *data;
|
25 |
}; |
26 |
|
27 |
struct tfilter {
|
28 |
int mode;
|
29 |
uint64_t secs; |
30 |
int iocbs;
|
31 |
|
32 |
struct dhash *dhash;
|
33 |
|
34 |
int ffree;
|
35 |
struct fiocb *fiocbs;
|
36 |
struct fiocb **flist;
|
37 |
}; |
38 |
|
39 |
struct tfilter *tapdisk_init_tfilter(int mode, int iocbs, uint64_t secs); |
40 |
void tapdisk_free_tfilter(struct tfilter *); |
41 |
void tapdisk_filter_iocbs(struct tfilter *, struct iocb **, int); |
42 |
void tapdisk_filter_events(struct tfilter *, struct io_event *, int); |
43 |
|
44 |
#endif
|