Signed-off-by: Jens Axboe <axboe@fb.com>
extern struct thread_data *threads;
extern struct thread_data *threads;
-static inline void fio_ro_check(struct thread_data *td, struct io_u *io_u)
+static inline void fio_ro_check(const struct thread_data *td, struct io_u *io_u)
{
assert(!(io_u->ddir == DDIR_WRITE && !td_write(td)));
}
{
assert(!(io_u->ddir == DDIR_WRITE && !td_write(td)));
}
* If latency target is enabled, we might be ramping up or down and not
* using the full queue depth available.
*/
* If latency target is enabled, we might be ramping up or down and not
* using the full queue depth available.
*/
-int queue_full(struct thread_data *td)
+int queue_full(const struct thread_data *td)
{
const int qempty = io_u_qempty(&td->io_u_freelist);
{
const int qempty = io_u_qempty(&td->io_u_freelist);
q->io_us[q->nr++] = io_u;
}
q->io_us[q->nr++] = io_u;
}
-static inline int io_u_qempty(struct io_u_queue *q)
+static inline int io_u_qempty(const struct io_u_queue *q)
extern void io_u_fill_buffer(struct thread_data *td, struct io_u *, unsigned int, unsigned int);
void io_u_mark_complete(struct thread_data *, unsigned int);
void io_u_mark_submit(struct thread_data *, unsigned int);
extern void io_u_fill_buffer(struct thread_data *td, struct io_u *, unsigned int, unsigned int);
void io_u_mark_complete(struct thread_data *, unsigned int);
void io_u_mark_submit(struct thread_data *, unsigned int);
-int queue_full(struct thread_data *);
+int queue_full(const struct thread_data *);
-int do_io_u_sync(struct thread_data *, struct io_u *);
-int do_io_u_trim(struct thread_data *, struct io_u *);
+int do_io_u_sync(const struct thread_data *, struct io_u *);
+int do_io_u_trim(const struct thread_data *, struct io_u *);
#ifdef FIO_INC_DEBUG
static inline void dprint_io_u(struct io_u *io_u, const char *p)
#ifdef FIO_INC_DEBUG
static inline void dprint_io_u(struct io_u *io_u, const char *p)
return td->io_ops->get_file_size(td, f);
}
return td->io_ops->get_file_size(td, f);
}
-static int do_sync_file_range(struct thread_data *td, struct fio_file *f)
+static int do_sync_file_range(const struct thread_data *td,
+ struct fio_file *f)
{
off64_t offset, nbytes;
{
off64_t offset, nbytes;
return sync_file_range(f->fd, offset, nbytes, td->o.sync_file_range);
}
return sync_file_range(f->fd, offset, nbytes, td->o.sync_file_range);
}
-int do_io_u_sync(struct thread_data *td, struct io_u *io_u)
+int do_io_u_sync(const struct thread_data *td, struct io_u *io_u)
-int do_io_u_trim(struct thread_data *td, struct io_u *io_u)
+int do_io_u_trim(const struct thread_data *td, struct io_u *io_u)
{
#ifndef FIO_HAVE_TRIM
io_u->error = EINVAL;
{
#ifndef FIO_HAVE_TRIM
io_u->error = EINVAL;