projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Support residual io counts from io engines
[fio.git]
/
engines
/
splice.c
diff --git
a/engines/splice.c
b/engines/splice.c
index fa4a6ee1db21ff192d811f1a95dfacc05de35483..026a82bb053b538ac61f83ed721f8ca4448fb8a1 100644
(file)
--- a/
engines/splice.c
+++ b/
engines/splice.c
@@
-57,8
+57,8
@@
static int fio_splice_read(struct thread_data *td, struct io_u *io_u)
void *p;
offset = io_u->offset;
void *p;
offset = io_u->offset;
- buflen = io_u->buflen;
- p = io_u->buf;
+ buflen = io_u->
xfer_
buflen;
+ p = io_u->
xfer_
buf;
while (buflen) {
int this_len = buflen;
while (buflen) {
int this_len = buflen;
@@
-85,7
+85,7
@@
static int fio_splice_read(struct thread_data *td, struct io_u *io_u)
}
}
}
}
- return io_u->buflen;
+ return io_u->
xfer_
buflen;
}
/*
}
/*
@@
-97,8
+97,8
@@
static int fio_splice_write(struct thread_data *td, struct io_u *io_u)
struct spliceio_data *sd = td->io_ops->data;
struct iovec iov[1] = {
{
struct spliceio_data *sd = td->io_ops->data;
struct iovec iov[1] = {
{
- .iov_base = io_u->buf,
- .iov_len = io_u->buflen,
+ .iov_base = io_u->
xfer_
buf,
+ .iov_len = io_u->
xfer_
buflen,
}
};
struct pollfd pfd = { .fd = sd->pipe[1], .events = POLLOUT, };
}
};
struct pollfd pfd = { .fd = sd->pipe[1], .events = POLLOUT, };
@@
-126,13
+126,13
@@
static int fio_splice_write(struct thread_data *td, struct io_u *io_u)
}
}
}
}
- return io_u->buflen;
+ return io_u->
xfer_
buflen;
}
static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u)
{
struct spliceio_data *sd = td->io_ops->data;
}
static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u)
{
struct spliceio_data *sd = td->io_ops->data;
-
unsigned
int ret;
+ int ret;
if (io_u->ddir == DDIR_READ)
ret = fio_splice_read(td, io_u);
if (io_u->ddir == DDIR_READ)
ret = fio_splice_read(td, io_u);
@@
-141,10
+141,11
@@
static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u)
else
ret = fsync(io_u->file->fd);
else
ret = fsync(io_u->file->fd);
- if (ret !=
io_u->
buflen) {
+ if (ret !=
(int) io_u->xfer_
buflen) {
if (ret > 0) {
if (ret > 0) {
- io_u->resid = io_u->buflen - ret;
- io_u->error = ENODATA;
+ io_u->resid = io_u->xfer_buflen - ret;
+ io_u->error = 0;
+ return ret;
} else
io_u->error = errno;
}
} else
io_u->error = errno;
}