projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Remove debug fprintfs
[fio.git]
/
io_u.c
diff --git
a/io_u.c
b/io_u.c
index 8ec9dd9ecbfdd9b721b7a0b905fdbee9b89c5a84..834e5d214d5da390365858f36d67ed3fd67127a6 100644
(file)
--- a/
io_u.c
+++ b/
io_u.c
@@
-63,7
+63,7
@@
static int get_next_free_block(struct thread_data *td, struct fio_file *f,
*b = 0;
i = 0;
*b = 0;
i = 0;
- while ((*b) * td->rw_min_bs < f->file_size) {
+ while ((*b) * td->rw_min_bs < f->
real_
file_size) {
if (f->file_map[i] != -1UL) {
*b += ffz(f->file_map[i]);
return 0;
if (f->file_map[i] != -1UL) {
*b += ffz(f->file_map[i]);
return 0;
@@
-108,7
+108,7
@@
static int get_next_offset(struct thread_data *td, struct fio_file *f,
b = f->last_pos / td->min_bs[ddir];
*offset = (b * td->min_bs[ddir]) + f->file_offset;
b = f->last_pos / td->min_bs[ddir];
*offset = (b * td->min_bs[ddir]) + f->file_offset;
- if (*offset > f->file_size)
+ if (*offset > f->
real_
file_size)
return 1;
return 0;
return 1;
return 0;
@@
-123,7
+123,7
@@
static unsigned int get_next_buflen(struct thread_data *td, int ddir)
buflen = td->min_bs[ddir];
else {
r = os_random_long(&td->bsrange_state);
buflen = td->min_bs[ddir];
else {
r = os_random_long(&td->bsrange_state);
- buflen = (1 + (double) (td->max_bs[ddir] - 1) * r / (RAND_MAX + 1.0));
+ buflen = (
unsigned int) (
1 + (double) (td->max_bs[ddir] - 1) * r / (RAND_MAX + 1.0));
if (!td->bs_unaligned)
buflen = (buflen + td->min_bs[ddir] - 1) & ~(td->min_bs[ddir] - 1);
}
if (!td->bs_unaligned)
buflen = (buflen + td->min_bs[ddir] - 1) & ~(td->min_bs[ddir] - 1);
}
@@
-147,7
+147,7
@@
static unsigned int get_next_buflen(struct thread_data *td, int ddir)
* mixed read/write workload, check the rwmix cycle and switch if
* necessary.
*/
* mixed read/write workload, check the rwmix cycle and switch if
* necessary.
*/
-static
int
get_rw_ddir(struct thread_data *td)
+static
enum fio_ddir
get_rw_ddir(struct thread_data *td)
{
if (td_rw(td)) {
struct timeval now;
{
if (td_rw(td)) {
struct timeval now;
@@
-267,13
+267,13
@@
struct io_u *get_io_u(struct thread_data *td, struct fio_file *f)
return NULL;
}
return NULL;
}
- if (io_u->buflen + io_u->offset > f->file_size) {
+ if (io_u->buflen + io_u->offset > f->
real_
file_size) {
if (td->io_ops->flags & FIO_RAWIO) {
put_io_u(td, io_u);
return NULL;
}
if (td->io_ops->flags & FIO_RAWIO) {
put_io_u(td, io_u);
return NULL;
}
- io_u->buflen = f->file_size - io_u->offset;
+ io_u->buflen = f->
real_
file_size - io_u->offset;
}
if (io_u->ddir != DDIR_SYNC) {
}
if (io_u->ddir != DDIR_SYNC) {
@@
-314,7
+314,7
@@
void io_completed(struct thread_data *td, struct io_u *io_u,
if (!io_u->error) {
unsigned int bytes = io_u->buflen - io_u->resid;
if (!io_u->error) {
unsigned int bytes = io_u->buflen - io_u->resid;
- const
int
idx = io_u->ddir;
+ const
enum fio_ddir
idx = io_u->ddir;
td->io_blocks[idx]++;
td->io_bytes[idx] += bytes;
td->io_blocks[idx]++;
td->io_bytes[idx] += bytes;