7 * The type of object we are working on
10 FIO_TYPE_FILE = 1, /* plain file */
11 FIO_TYPE_BD, /* block device */
12 FIO_TYPE_CHAR, /* character device */
13 FIO_TYPE_PIPE, /* pipe */
17 FIO_FILE_open = 1 << 0, /* file is open */
18 FIO_FILE_closing = 1 << 1, /* file being closed */
19 FIO_FILE_extend = 1 << 2, /* needs extend */
20 FIO_FILE_done = 1 << 3, /* io completed to this file */
21 FIO_FILE_size_known = 1 << 4, /* size has been set */
22 FIO_FILE_hashed = 1 << 5, /* file is on hash */
32 * Each thread_data structure has a number of files associated with it,
33 * this structure holds state information for a single file.
36 struct flist_head hash_list;
37 enum fio_filetype filetype;
40 * A file may not be a file descriptor, let the io engine decide
43 unsigned long file_data;
48 * filename and possible memory mapping
51 unsigned int major, minor;
58 * size of the file, offset into file, and io size from that offset
60 unsigned long long real_file_size;
61 unsigned long long file_offset;
62 unsigned long long io_size;
64 unsigned long long last_pos;
67 * if io is protected by a semaphore, this is set
69 struct fio_mutex *lock;
71 unsigned int lock_batch;
72 enum fio_ddir lock_ddir;
75 * block map for random io
77 unsigned int *file_map;
78 unsigned int num_maps;
79 unsigned int last_free_lookup;
82 enum fio_file_flags flags;
87 #define FILE_FLAG_FNS(name) \
88 static inline void fio_file_set_##name(struct fio_file *f) \
90 (f)->flags |= FIO_FILE_##name; \
92 static inline void fio_file_clear_##name(struct fio_file *f) \
94 (f)->flags &= ~FIO_FILE_##name; \
96 static inline int fio_file_##name(struct fio_file *f) \
98 return ((f)->flags & FIO_FILE_##name) != 0; \
102 FILE_FLAG_FNS(closing);
103 FILE_FLAG_FNS(extend);
105 FILE_FLAG_FNS(size_known);
106 FILE_FLAG_FNS(hashed);