root / synthbench / bonnie++ / bon_file.h
History | View | Annotate | Download (1.5 kB)
1 | 0:839f52ef7657 | louridas | #ifndef BON_IO
|
---|---|---|---|
2 | 0:839f52ef7657 | louridas | #define BON_IO
|
3 | 0:839f52ef7657 | louridas | |
4 | 0:839f52ef7657 | louridas | #include "bonnie.h" |
5 | 0:839f52ef7657 | louridas | class BonTimer; |
6 | 0:839f52ef7657 | louridas | |
7 | 0:839f52ef7657 | louridas | typedef unsigned long MASK_TYPE; |
8 | 0:839f52ef7657 | louridas | |
9 | 0:839f52ef7657 | louridas | class COpenTest |
10 | 0:839f52ef7657 | louridas | { |
11 | 0:839f52ef7657 | louridas | public:
|
12 | 0:839f52ef7657 | louridas | COpenTest(int chunk_size, bool use_sync, bool *doExit); |
13 | 0:839f52ef7657 | louridas | ~COpenTest(); |
14 | 0:839f52ef7657 | louridas | |
15 | 0:839f52ef7657 | louridas | int create(CPCCHAR dirname, BonTimer &timer, int num, int max_size |
16 | 0:839f52ef7657 | louridas | , int min_size, int num_directories, bool do_random); |
17 | 0:839f52ef7657 | louridas | int delete_random(BonTimer &timer);
|
18 | 0:839f52ef7657 | louridas | int delete_sequential(BonTimer &timer);
|
19 | 0:839f52ef7657 | louridas | int stat_random(BonTimer &timer);
|
20 | 0:839f52ef7657 | louridas | int stat_sequential(BonTimer &timer);
|
21 | 0:839f52ef7657 | louridas | |
22 | 0:839f52ef7657 | louridas | private:
|
23 | 0:839f52ef7657 | louridas | void make_names(bool do_random); |
24 | 0:839f52ef7657 | louridas | int stat_file(CPCCHAR file);
|
25 | 0:839f52ef7657 | louridas | int create_a_file(const char *filename, char *buf, int size, int dir); |
26 | 0:839f52ef7657 | louridas | int create_a_link(const char *original, const char *filename, int dir); |
27 | 0:839f52ef7657 | louridas | |
28 | 0:839f52ef7657 | louridas | const int m_chunk_size; |
29 | 0:839f52ef7657 | louridas | int m_number; // the total number of files to create |
30 | 0:839f52ef7657 | louridas | int m_number_directories; // the number of directories to store files in |
31 | 0:839f52ef7657 | louridas | int m_max; // maximum file size (negative for links) |
32 | 0:839f52ef7657 | louridas | int m_min; // minimum file size |
33 | 0:839f52ef7657 | louridas | int m_size_range; // m_max - m_min |
34 | 0:839f52ef7657 | louridas | char *m_dirname; // name of the master directory |
35 | 0:839f52ef7657 | louridas | char *m_file_name_buf; // buffer to store all file names |
36 | 0:839f52ef7657 | louridas | char **m_file_names; // pointer to entries in m_file_name_buf |
37 | 0:839f52ef7657 | louridas | bool m_sync; // do we sync after every significant operation? |
38 | 0:839f52ef7657 | louridas | FILE_TYPE *m_directoryHandles; // handles to the directories for m_sync
|
39 | 0:839f52ef7657 | louridas | int *m_dirIndex; // which directory we are in |
40 | 0:839f52ef7657 | louridas | char *m_buf;
|
41 | 0:839f52ef7657 | louridas | bool *m_exit;
|
42 | 0:839f52ef7657 | louridas | bool m_sync_dir;
|
43 | 0:839f52ef7657 | louridas | |
44 | 0:839f52ef7657 | louridas | void random_sort();
|
45 | 0:839f52ef7657 | louridas | |
46 | 0:839f52ef7657 | louridas | COpenTest(const COpenTest &t);
|
47 | 0:839f52ef7657 | louridas | COpenTest & operator =(const COpenTest &t);
|
48 | 0:839f52ef7657 | louridas | }; |
49 | 0:839f52ef7657 | louridas | |
50 | 0:839f52ef7657 | louridas | #endif |