From: Jens Axboe Date: Wed, 3 Jun 2009 07:29:28 +0000 (+0200) Subject: More fio.h cleanups X-Git-Tag: fio-1.27~4 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c592b9fe12d4739d99d5bece517e304804876df6 More fio.h cleanups Signed-off-by: Jens Axboe --- diff --git a/file.h b/file.h index 2b49a6b9..7024d5ee 100644 --- a/file.h +++ b/file.h @@ -140,4 +140,12 @@ extern void dup_files(struct thread_data *, struct thread_data *); extern int get_fileno(struct thread_data *, const char *); extern void free_release_files(struct thread_data *); +static inline void fio_file_reset(struct fio_file *f) +{ + f->last_free_lookup = 0; + f->last_pos = f->file_offset; + if (f->file_map) + memset(f->file_map, 0, f->num_maps * sizeof(int)); +} + #endif diff --git a/filesetup.c b/filesetup.c index 7ed47a25..c902bdf7 100644 --- a/filesetup.c +++ b/filesetup.c @@ -13,6 +13,12 @@ static int root_warn; +static inline void clear_error(struct thread_data *td) +{ + td->error = 0; + td->verror[0] = '\0'; +} + /* * Leaves f->fd open on success, caller must close */ diff --git a/fio.h b/fio.h index 9222c051..b2e40d22 100644 --- a/fio.h +++ b/fio.h @@ -553,39 +553,6 @@ extern int load_blktrace(struct thread_data *, const char *); } \ } while (0) -static inline void fio_file_reset(struct fio_file *f) -{ - f->last_free_lookup = 0; - f->last_pos = f->file_offset; - if (f->file_map) - memset(f->file_map, 0, f->num_maps * sizeof(int)); -} - -static inline void clear_error(struct thread_data *td) -{ - td->error = 0; - td->verror[0] = '\0'; -} - -#ifdef FIO_INC_DEBUG -static inline void dprint_io_u(struct io_u *io_u, const char *p) -{ - struct fio_file *f = io_u->file; - - dprint(FD_IO, "%s: io_u %p: off=%llu/len=%lu/ddir=%d", p, io_u, - (unsigned long long) io_u->offset, - io_u->buflen, io_u->ddir); - if (fio_debug & (1 << FD_IO)) { - if (f) - log_info("/%s", f->file_name); - - log_info("\n"); - } -} -#else -#define dprint_io_u(io_u, p) -#endif - static inline int fio_fill_issue_time(struct thread_data *td) { if (td->o.read_iolog_file || diff --git a/ioengine.h b/ioengine.h index 2caece72..18496c3a 100644 --- a/ioengine.h +++ b/ioengine.h @@ -149,4 +149,23 @@ extern void io_u_fill_buffer(struct thread_data *td, struct io_u *, unsigned int void io_u_mark_complete(struct thread_data *, unsigned int); void io_u_mark_submit(struct thread_data *, unsigned int); +#ifdef FIO_INC_DEBUG +static inline void dprint_io_u(struct io_u *io_u, const char *p) +{ + struct fio_file *f = io_u->file; + + dprint(FD_IO, "%s: io_u %p: off=%llu/len=%lu/ddir=%d", p, io_u, + (unsigned long long) io_u->offset, + io_u->buflen, io_u->ddir); + if (fio_debug & (1 << FD_IO)) { + if (f) + log_info("/%s", f->file_name); + + log_info("\n"); + } +} +#else +#define dprint_io_u(io_u, p) +#endif + #endif