/external/fio/engines/ |
D | sync.c | 25 struct io_u **io_us; 57 static int fio_syncio_prep(struct thread_data *td, struct io_u *io_u) in fio_syncio_prep() argument 59 struct fio_file *f = io_u->file; in fio_syncio_prep() 61 if (!ddir_rw(io_u->ddir)) in fio_syncio_prep() 64 if (LAST_POS(f) != -1ULL && LAST_POS(f) == io_u->offset) in fio_syncio_prep() 67 if (lseek(f->fd, io_u->offset, SEEK_SET) == -1) { in fio_syncio_prep() 75 static int fio_io_end(struct thread_data *td, struct io_u *io_u, int ret) in fio_io_end() argument 77 if (io_u->file && ret >= 0 && ddir_rw(io_u->ddir)) in fio_io_end() 78 LAST_POS(io_u->file) = io_u->offset + ret; in fio_io_end() 80 if (ret != (int) io_u->xfer_buflen) { in fio_io_end() [all …]
|
D | glusterfs_async.c | 10 struct io_u *io_u; member 14 static struct io_u *fio_gf_event(struct thread_data *td, int event) in fio_gf_event() 27 struct io_u *io_u; in fio_gf_getevents() local 32 io_u_qiter(&td->io_u_all, io_u, i) { in fio_gf_getevents() 35 if (!(io_u->flags & IO_U_F_FLIGHT)) in fio_gf_getevents() 38 io = io_u->engine_data; in fio_gf_getevents() 41 g->aio_events[events] = io_u; in fio_gf_getevents() 59 static void fio_gf_io_u_free(struct thread_data *td, struct io_u *io_u) in fio_gf_io_u_free() argument 61 struct fio_gf_iou *io = io_u->engine_data; in fio_gf_io_u_free() 66 io_u->engine_data = NULL; in fio_gf_io_u_free() [all …]
|
D | guasi.c | 37 struct io_u **io_us; 42 static int fio_guasi_prep(struct thread_data fio_unused *td, struct io_u *io_u) in fio_guasi_prep() argument 45 GDBG_PRINT(("fio_guasi_prep(%p)\n", io_u)); in fio_guasi_prep() 46 io_u->greq = NULL; in fio_guasi_prep() 51 static struct io_u *fio_guasi_event(struct thread_data *td, int event) in fio_guasi_event() 54 struct io_u *io_u; in fio_guasi_event() local 62 io_u = rinf.asid; in fio_guasi_event() 63 io_u->error = EINPROGRESS; in fio_guasi_event() 64 GDBG_PRINT(("fio_guasi_event(%d) -> %p\n", event, io_u)); in fio_guasi_event() 66 io_u->error = rinf.result; in fio_guasi_event() [all …]
|
D | solarisaio.c | 16 struct io_u **aio_events; 23 struct io_u *io_u) in fio_solarisaio_cancel() argument 25 return aiocancel(&io_u->resultp); in fio_solarisaio_cancel() 29 struct io_u *io_u) in fio_solarisaio_prep() argument 33 io_u->resultp.aio_return = AIO_INPROGRESS; in fio_solarisaio_prep() 34 io_u->engine_data = sd; in fio_solarisaio_prep() 41 struct io_u *io_u; in wait_for_event() local 56 io_u = container_of(res, struct io_u, resultp); in wait_for_event() 57 sd = io_u->engine_data; in wait_for_event() 59 if (io_u->resultp.aio_return >= 0) { in wait_for_event() [all …]
|
D | glusterfs_sync.c | 11 static int fio_gf_prep(struct thread_data *td, struct io_u *io_u) in fio_gf_prep() argument 13 struct fio_file *f = io_u->file; in fio_gf_prep() 18 if (!ddir_rw(io_u->ddir)) in fio_gf_prep() 21 if (LAST_POS(f) != -1ULL && LAST_POS(f) == io_u->offset) in fio_gf_prep() 24 if (glfs_lseek(g->fd, io_u->offset, SEEK_SET) < 0) { in fio_gf_prep() 32 static int fio_gf_queue(struct thread_data *td, struct io_u *io_u) in fio_gf_queue() argument 37 dprint(FD_FILE, "fio queue len %lu\n", io_u->xfer_buflen); in fio_gf_queue() 38 fio_ro_check(td, io_u); in fio_gf_queue() 40 if (io_u->ddir == DDIR_READ) in fio_gf_queue() 41 ret = glfs_read(g->fd, io_u->xfer_buf, io_u->xfer_buflen, 0); in fio_gf_queue() [all …]
|
D | mmap.c | 84 static int fio_mmapio_prep_limited(struct thread_data *td, struct io_u *io_u) in fio_mmapio_prep_limited() argument 86 struct fio_file *f = io_u->file; in fio_mmapio_prep_limited() 89 if (io_u->buflen > mmap_map_size) { in fio_mmapio_prep_limited() 98 fmd->mmap_off = io_u->offset; in fio_mmapio_prep_limited() 106 static int fio_mmapio_prep_full(struct thread_data *td, struct io_u *io_u) in fio_mmapio_prep_full() argument 108 struct fio_file *f = io_u->file; in fio_mmapio_prep_full() 114 if (io_u->offset != (size_t) io_u->offset || in fio_mmapio_prep_full() 130 static int fio_mmapio_prep(struct thread_data *td, struct io_u *io_u) in fio_mmapio_prep() argument 132 struct fio_file *f = io_u->file; in fio_mmapio_prep() 139 if (io_u->offset >= fmd->mmap_off && in fio_mmapio_prep() [all …]
|
D | posixaio.c | 16 struct io_u **aio_events; 64 struct io_u *io_u) in fio_posixaio_cancel() argument 66 struct fio_file *f = io_u->file; in fio_posixaio_cancel() 67 int r = aio_cancel(f->fd, &io_u->aiocb); in fio_posixaio_cancel() 76 struct io_u *io_u) in fio_posixaio_prep() argument 78 os_aiocb_t *aiocb = &io_u->aiocb; in fio_posixaio_prep() 79 struct fio_file *f = io_u->file; in fio_posixaio_prep() 82 aiocb->aio_buf = io_u->xfer_buf; in fio_posixaio_prep() 83 aiocb->aio_nbytes = io_u->xfer_buflen; in fio_posixaio_prep() 84 aiocb->aio_offset = io_u->offset; in fio_posixaio_prep() [all …]
|
D | rbd.c | 23 struct io_u *io_u; member 36 struct io_u **aio_events; 37 struct io_u **sort_events; 120 rbd->aio_events = calloc(td->o.iodepth, sizeof(struct io_u *)); in _fio_setup_rbd_data() 124 rbd->sort_events = calloc(td->o.iodepth, sizeof(struct io_u *)); in _fio_setup_rbd_data() 283 struct io_u *io_u = fri->io_u; in _fio_rbd_finish_aiocb() local 293 io_u->error = -ret; in _fio_rbd_finish_aiocb() 294 io_u->resid = io_u->xfer_buflen; in _fio_rbd_finish_aiocb() 296 io_u->error = 0; in _fio_rbd_finish_aiocb() 301 static struct io_u *fio_rbd_event(struct thread_data *td, int event) in fio_rbd_event() [all …]
|
D | splice.c | 29 static int fio_splice_read_old(struct thread_data *td, struct io_u *io_u) in fio_splice_read_old() argument 32 struct fio_file *f = io_u->file; in fio_splice_read_old() 37 offset = io_u->offset; in fio_splice_read_old() 38 buflen = io_u->xfer_buflen; in fio_splice_read_old() 39 p = io_u->xfer_buf; in fio_splice_read_old() 66 return io_u->xfer_buflen; in fio_splice_read_old() 73 static int fio_splice_read(struct thread_data *td, struct io_u *io_u) in fio_splice_read() argument 76 struct fio_file *f = io_u->file; in fio_splice_read() 83 offset = io_u->offset; in fio_splice_read() 84 mmap_len = buflen = io_u->xfer_buflen; in fio_splice_read() [all …]
|
D | libaio.c | 24 struct io_u **io_us; 70 static int fio_libaio_prep(struct thread_data fio_unused *td, struct io_u *io_u) in fio_libaio_prep() argument 72 struct fio_file *f = io_u->file; in fio_libaio_prep() 74 if (io_u->ddir == DDIR_READ) in fio_libaio_prep() 75 io_prep_pread(&io_u->iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset); in fio_libaio_prep() 76 else if (io_u->ddir == DDIR_WRITE) in fio_libaio_prep() 77 io_prep_pwrite(&io_u->iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset); in fio_libaio_prep() 78 else if (ddir_sync(io_u->ddir)) in fio_libaio_prep() 79 io_prep_fsync(&io_u->iocb, f->fd); in fio_libaio_prep() 84 static struct io_u *fio_libaio_event(struct thread_data *td, int event) in fio_libaio_event() [all …]
|
D | windowsaio.c | 21 struct io_u *io_u; member 26 struct io_u **aio_events; 41 static struct io_u *fio_windowsaio_event(struct thread_data *td, int event); 43 struct io_u *io_u); 62 wd->aio_events = malloc(td->o.iodepth * sizeof(struct io_u*)); in fio_windowsaio_init() 257 static struct io_u* fio_windowsaio_event(struct thread_data *td, int event) in fio_windowsaio_event() 269 struct io_u *io_u; in fio_windowsaio_getevents() local 284 io_u_qiter(&td->io_u_all, io_u, i) { in fio_windowsaio_getevents() 285 if (!(io_u->flags & IO_U_F_FLIGHT)) in fio_windowsaio_getevents() 288 fov = (struct fio_overlapped*)io_u->engine_data; in fio_windowsaio_getevents() [all …]
|
D | mtd.c | 27 struct io_u *io_u, int eb) in fio_mtd_maybe_mark_bad() argument 31 ret = mtd_mark_bad(&fmd->info, io_u->file->fd, eb); in fio_mtd_maybe_mark_bad() 33 io_u->error = errno; in fio_mtd_maybe_mark_bad() 43 struct io_u *io_u, int eb) in fio_mtd_is_bad() argument 45 int ret = mtd_is_bad(&fmd->info, io_u->file->fd, eb); in fio_mtd_is_bad() 47 io_u->error = errno; in fio_mtd_is_bad() 50 io_u->error = EIO; /* Silent failure--don't flood stderr */ in fio_mtd_is_bad() 54 static int fio_mtd_queue(struct thread_data *td, struct io_u *io_u) in fio_mtd_queue() argument 56 struct fio_file *f = io_u->file; in fio_mtd_queue() 61 fio_ro_check(td, io_u); in fio_mtd_queue() [all …]
|
D | dev-dax.c | 103 static int fio_devdax_prep_limited(struct thread_data *td, struct io_u *io_u) in fio_devdax_prep_limited() argument 105 struct fio_file *f = io_u->file; in fio_devdax_prep_limited() 108 if (io_u->buflen > f->real_file_size) { in fio_devdax_prep_limited() 117 fdd->devdax_off = io_u->offset; in fio_devdax_prep_limited() 125 static int fio_devdax_prep_full(struct thread_data *td, struct io_u *io_u) in fio_devdax_prep_full() argument 127 struct fio_file *f = io_u->file; in fio_devdax_prep_full() 134 if (io_u->offset != (size_t) io_u->offset || in fio_devdax_prep_full() 150 static int fio_devdax_prep(struct thread_data *td, struct io_u *io_u) in fio_devdax_prep() argument 152 struct fio_file *f = io_u->file; in fio_devdax_prep() 159 if (io_u->offset >= fdd->devdax_off && in fio_devdax_prep() [all …]
|
D | net.c | 332 static int fio_netio_prep(struct thread_data *td, struct io_u *io_u) in fio_netio_prep() argument 342 if ((o->listen && io_u->ddir == DDIR_WRITE) || in fio_netio_prep() 343 (!o->listen && io_u->ddir == DDIR_READ)) { in fio_netio_prep() 377 static int splice_in(struct thread_data *td, struct io_u *io_u) in splice_in() argument 381 return splice_io_u(io_u->file->fd, nd->pipes[1], io_u->xfer_buflen); in splice_in() 387 static int splice_out(struct thread_data *td, struct io_u *io_u, in splice_out() argument 392 return splice_io_u(nd->pipes[0], io_u->file->fd, len); in splice_out() 395 static int vmsplice_io_u(struct io_u *io_u, int fd, unsigned int len) in vmsplice_io_u() argument 398 .iov_base = io_u->xfer_buf, in vmsplice_io_u() 425 static int vmsplice_io_u_out(struct thread_data *td, struct io_u *io_u, in vmsplice_io_u_out() argument [all …]
|
D | sg.c | 30 struct io_u **events; 39 struct io_u *io_u, int fs) in sgio_hdr_init() argument 41 struct sgio_cmd *sc = &sd->cmds[io_u->index]; in sgio_hdr_init() 51 hdr->pack_id = io_u->index; in sgio_hdr_init() 52 hdr->usr_ptr = io_u; in sgio_hdr_init() 55 hdr->dxferp = io_u->xfer_buf; in sgio_hdr_init() 56 hdr->dxfer_len = io_u->xfer_buflen; in sgio_hdr_init() 185 struct io_u *io_u; in fio_sgio_getevents() local 186 io_u = (struct io_u *)(hdr->usr_ptr); in fio_sgio_getevents() 187 memcpy((void*)&(io_u->hdr), (void*)hdr, sizeof(struct sg_io_hdr)); in fio_sgio_getevents() [all …]
|
D | binject.c | 24 struct io_u **events; 35 static void binject_buc_init(struct binject_data *bd, struct io_u *io_u) in binject_buc_init() argument 37 struct b_user_cmd *buc = &io_u->buc; in binject_buc_init() 42 buc->buf = (unsigned long) io_u->xfer_buf; in binject_buc_init() 43 buc->len = io_u->xfer_buflen; in binject_buc_init() 44 buc->offset = io_u->offset; in binject_buc_init() 45 buc->usr_ptr = (unsigned long) io_u; in binject_buc_init() 150 bd->events[ev_index] = (struct io_u *) (unsigned long) buc->usr_ptr; in fio_binject_getevents() 173 static int fio_binject_doio(struct thread_data *td, struct io_u *io_u) in fio_binject_doio() argument 175 struct b_user_cmd *buc = &io_u->buc; in fio_binject_doio() [all …]
|
D | e4defrag.c | 134 static int fio_e4defrag_queue(struct thread_data *td, struct io_u *io_u) in fio_e4defrag_queue() argument 140 struct fio_file *f = io_u->file; in fio_e4defrag_queue() 144 fio_ro_check(td, io_u); in fio_e4defrag_queue() 150 if (io_u->ddir != DDIR_WRITE) { in fio_e4defrag_queue() 151 io_u->error = EINVAL; in fio_e4defrag_queue() 156 ret = fallocate(ed->donor_fd, 0, io_u->offset, io_u->xfer_buflen); in fio_e4defrag_queue() 163 me.orig_start = io_u->offset / ed->bsz; in fio_e4defrag_queue() 165 len = (io_u->offset + io_u->xfer_buflen + ed->bsz -1); in fio_e4defrag_queue() 171 if (len > io_u->xfer_buflen) in fio_e4defrag_queue() 172 len = io_u->xfer_buflen; in fio_e4defrag_queue() [all …]
|
D | libhdfs.c | 123 static int fio_hdfsio_prep(struct thread_data *td, struct io_u *io_u) in fio_hdfsio_prep() argument 132 f_id = floor(io_u->offset / options-> chunck_size); in fio_hdfsio_prep() 147 if (io_u->ddir == DDIR_READ || io_u->ddir == DDIR_SYNC) { in fio_hdfsio_prep() 149 } else if (io_u->ddir == DDIR_WRITE) { in fio_hdfsio_prep() 156 get_chunck_name(fname, io_u->file->file_name, f_id); in fio_hdfsio_prep() 168 static int fio_hdfsio_queue(struct thread_data *td, struct io_u *io_u) in fio_hdfsio_queue() argument 175 offset = io_u->offset % options->chunck_size; in fio_hdfsio_queue() 177 if( (io_u->ddir == DDIR_READ || io_u->ddir == DDIR_WRITE) && in fio_hdfsio_queue() 180 io_u->error = errno; in fio_hdfsio_queue() 185 if (io_u->ddir == DDIR_READ) { in fio_hdfsio_queue() [all …]
|
/external/fio/ |
D | io_u.c | 38 static void mark_random_map(struct thread_data *td, struct io_u *io_u) in mark_random_map() argument 41 struct fio_file *f = io_u->file; in mark_random_map() 45 block = (io_u->offset - f->file_offset) / (uint64_t) min_bs; in mark_random_map() 46 nr_blocks = (io_u->buflen + min_bs - 1) / min_bs; in mark_random_map() 48 if (!(io_u->flags & IO_U_F_BUSY_OK)) in mark_random_map() 51 if ((nr_blocks * min_bs) < io_u->buflen) in mark_random_map() 52 io_u->buflen = nr_blocks * min_bs; in mark_random_map() 404 static int get_next_block(struct thread_data *td, struct io_u *io_u, in get_next_block() argument 408 struct fio_file *f = io_u->file; in get_next_block() 423 io_u_set(td, io_u, IO_U_F_BUSY_OK); in get_next_block() [all …]
|
D | io_u.h | 33 struct io_u { struct 99 int (*end_io)(struct thread_data *, struct io_u **); argument 130 extern struct io_u *__get_io_u(struct thread_data *); 131 extern struct io_u *get_io_u(struct thread_data *); 132 extern void put_io_u(struct thread_data *, struct io_u *); 133 extern void clear_io_u(struct thread_data *, struct io_u *); 134 extern void requeue_io_u(struct thread_data *, struct io_u **); 135 extern int __must_check io_u_sync_complete(struct thread_data *, struct io_u *); 137 extern void io_u_queued(struct thread_data *, struct io_u *); 139 extern void io_u_log_error(struct thread_data *, struct io_u *); [all …]
|
D | io_u_queue.h | 6 struct io_u; 9 struct io_u **io_us; 14 static inline struct io_u *io_u_qpop(struct io_u_queue *q) in io_u_qpop() 18 struct io_u *io_u = q->io_us[next]; in io_u_qpop() local 21 return io_u; in io_u_qpop() 27 static inline void io_u_qpush(struct io_u_queue *q, struct io_u *io_u) in io_u_qpush() argument 30 q->io_us[q->nr++] = io_u; in io_u_qpush() 42 #define io_u_qiter(q, io_u, i) \ argument 43 for (i = 0; i < (q)->nr && (io_u = (q)->io_us[i]); i++) 52 struct io_u **ring; [all …]
|
D | trim.c | 14 bool get_next_trim(struct thread_data *td, struct io_u *io_u) in get_next_trim() argument 21 if (io_u->file) in get_next_trim() 30 io_u->offset = ipo->offset; in get_next_trim() 31 io_u->buflen = ipo->len; in get_next_trim() 32 io_u->file = ipo->file; in get_next_trim() 50 if (!fio_file_open(io_u->file)) { in get_next_trim() 51 int r = td_io_open_file(td, io_u->file); in get_next_trim() 55 io_u->file->file_name); in get_next_trim() 60 get_file(io_u->file); in get_next_trim() 61 assert(fio_file_open(io_u->file)); in get_next_trim() [all …]
|
D | verify.c | 30 static void populate_hdr(struct thread_data *td, struct io_u *io_u, 33 static void fill_hdr(struct thread_data *td, struct io_u *io_u, 36 static void __fill_hdr(struct thread_data *td, struct io_u *io_u, 61 struct io_u *io_u, unsigned long seed, int use_seed) in fill_verify_pattern() argument 71 io_u->rand_seed = fill_buffer(td, p, len); in fill_verify_pattern() 77 if (!td->o.verify_fmt_sz && io_u->buf_filled_len >= len) { in fill_verify_pattern() 85 p, len, io_u); in fill_verify_pattern() 86 io_u->buf_filled_len = len; in fill_verify_pattern() 89 static unsigned int get_hdr_inc(struct thread_data *td, struct io_u *io_u) in get_hdr_inc() argument 93 hdr_inc = io_u->buflen; in get_hdr_inc() [all …]
|
D | backend.c | 259 struct io_u *io_u; in cleanup_pending_aio() local 262 io_u_qiter(&td->io_u_all, io_u, i) { in cleanup_pending_aio() 263 if (io_u->flags & IO_U_F_FLIGHT) { in cleanup_pending_aio() 264 r = td->io_ops->cancel(td, io_u); in cleanup_pending_aio() 266 put_io_u(td, io_u); in cleanup_pending_aio() 281 struct io_u *io_u = __get_io_u(td); in fio_io_sync() local 284 if (!io_u) in fio_io_sync() 287 io_u->ddir = DDIR_SYNC; in fio_io_sync() 288 io_u->file = f; in fio_io_sync() 290 if (td_io_prep(td, io_u)) { in fio_io_sync() [all …]
|
D | ioengines.c | 191 int td_io_prep(struct thread_data *td, struct io_u *io_u) in td_io_prep() argument 193 dprint_io_u(io_u, "prep"); in td_io_prep() 194 fio_ro_check(td, io_u); in td_io_prep() 196 lock_file(td, io_u->file, io_u->ddir); in td_io_prep() 199 int ret = td->io_ops->prep(td, io_u); in td_io_prep() 201 dprint(FD_IO, "->prep(%p)=%d\n", io_u, ret); in td_io_prep() 203 unlock_file(td, io_u->file); in td_io_prep() 253 int td_io_queue(struct thread_data *td, struct io_u *io_u) in td_io_queue() argument 255 const enum fio_ddir ddir = acct_ddir(io_u); in td_io_queue() 256 unsigned long buflen = io_u->xfer_buflen; in td_io_queue() [all …]
|