-static void mark_random_map(struct thread_data *td, struct io_u *io_u)
+static uint64_t mark_random_map(struct thread_data *td, struct io_u *io_u,
+ uint64_t offset, uint64_t buflen)
- block = (io_u->offset - f->file_offset) / (uint64_t) min_bs;
- nr_blocks = (io_u->buflen + min_bs - 1) / min_bs;
+ block = (offset - f->file_offset) / (uint64_t) min_bs;
+ nr_blocks = (buflen + min_bs - 1) / min_bs;
+ assert(nr_blocks > 0);
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
{
struct fio_file *f = io_u->file;
return io_u->offset + buflen <= f->io_size + get_start_offset(td, f);
}
{
struct fio_file *f = io_u->file;
return io_u->offset + buflen <= f->io_size + get_start_offset(td, f);
}
- unsigned int buflen = 0;
- unsigned int minbs, maxbs;
+ unsigned long long buflen = 0;
+ unsigned long long minbs, maxbs;
+ const bool needs_lock = td_async_processing(td);
+
+ if (io_u->post_submit) {
+ io_u->post_submit(io_u, io_u->error == 0);
+ io_u->post_submit = NULL;
+ }
+
if (io_u->file && !(io_u->flags & IO_U_F_NO_FILE_PUT))
put_file_log(td, io_u->file);
if (io_u->file && !(io_u->flags & IO_U_F_NO_FILE_PUT))
put_file_log(td, io_u->file);
io_u_set(td, __io_u, IO_U_F_FREE);
if ((__io_u->flags & IO_U_F_FLIGHT) && ddir_rw(ddir))
io_u_set(td, __io_u, IO_U_F_FREE);
if ((__io_u->flags & IO_U_F_FLIGHT) && ddir_rw(ddir))
* Wrap from the beginning, if we exceed the file size
*/
if (f->file_offset >= f->real_file_size)
* Wrap from the beginning, if we exceed the file size
*/
if (f->file_offset >= f->real_file_size)
- * If zone_size > zone_range, then maintain the same zone until
- * zone_bytes >= zone_size.
- */
+ * If zone_size > zone_range, then maintain the same zone until
+ * zone_bytes >= zone_size.
+ */
if (f->last_pos[io_u->ddir] >= (f->file_offset + td->o.zone_range)) {
dprint(FD_IO, "io_u maintain zone offset=%" PRIu64 "/last_pos=%" PRIu64 "\n",
f->file_offset, f->last_pos[io_u->ddir]);
if (f->last_pos[io_u->ddir] >= (f->file_offset + td->o.zone_range)) {
dprint(FD_IO, "io_u maintain zone offset=%" PRIu64 "/last_pos=%" PRIu64 "\n",
f->file_offset, f->last_pos[io_u->ddir]);
* For random: if 'norandommap' is not set and zone_size > zone_range,
* map needs to be reset as it's done with zone_range everytime.
*/
* For random: if 'norandommap' is not set and zone_size > zone_range,
* map needs to be reset as it's done with zone_range everytime.
*/
- /*
- * When file is zoned zone_range is always positive
- */
- if (td->o.zone_range) {
- __fill_io_u_zone(td, io_u);
- }
+ if (td->o.zone_mode == ZONE_MODE_STRIDED)
+ setup_strided_zone_mode(td, io_u);
- dprint(FD_IO, "io_u %p, off=0x%llx + len=0x%lx exceeds file size=0x%llx\n",
+ dprint(FD_IO, "io_u %p, off=0x%llx + len=0x%llx exceeds file size=0x%llx\n",
io_u,
(unsigned long long) io_u->offset, io_u->buflen,
(unsigned long long) io_u->file->real_file_size);
io_u,
(unsigned long long) io_u->offset, io_u->buflen,
(unsigned long long) io_u->file->real_file_size);
* mark entry before potentially trimming io_u
*/
if (td_random(td) && file_randommap(td, io_u->file))
* mark entry before potentially trimming io_u
*/
if (td_random(td) && file_randommap(td, io_u->file))
io_u->file ? " on file " : "",
io_u->file ? io_u->file->file_name : "",
strerror(io_u->error),
io_u->file ? " on file " : "",
io_u->file ? io_u->file->file_name : "",
strerror(io_u->error),
-void fill_io_buffer(struct thread_data *td, void *buf, unsigned int min_write,
- unsigned int max_bs)
+void fill_io_buffer(struct thread_data *td, void *buf, unsigned long long min_write,
+ unsigned long long max_bs)
fill_random_buf_percentage(rs, buf, perc,
this_write, this_write,
fill_random_buf_percentage(rs, buf, perc,
this_write, this_write,
* "randomly" fill the buffer contents
*/
void io_u_fill_buffer(struct thread_data *td, struct io_u *io_u,
* "randomly" fill the buffer contents
*/
void io_u_fill_buffer(struct thread_data *td, struct io_u *io_u,
{
io_u->buf_filled_len = 0;
fill_io_buffer(td, io_u->buf, min_write, max_bs);
{
io_u->buf_filled_len = 0;
fill_io_buffer(td, io_u->buf, min_write, max_bs);