Use writev in libfio_sec_osd

This commit is contained in:
Vitaliy Filippov
2020-03-02 21:17:21 +03:00
parent 79839ec31d
commit 7eac7b6d55
3 changed files with 46 additions and 7 deletions
+10 -7
View File
@@ -261,15 +261,18 @@ static enum fio_q_status sec_queue(struct thread_data *td, struct io_u *io)
bsd->op_n++;
bsd->queue[n] = io;
if (write(bsd->connect_fd, op.buf, OSD_PACKET_SIZE) != OSD_PACKET_SIZE)
{
perror("write");
exit(1);
}
iovec iov[2] = { { .iov_base = op.buf, .iov_len = OSD_PACKET_SIZE } };
int iovcnt = 1, wtotal = OSD_PACKET_SIZE;
if (io->ddir == DDIR_WRITE)
{
// Send data
write_blocking(bsd->connect_fd, io->xfer_buf, io->xfer_buflen);
iov[1] = { .iov_base = io->xfer_buf, .iov_len = io->xfer_buflen };
wtotal += io->xfer_buflen;
iovcnt++;
}
if (writev_blocking(bsd->connect_fd, iov, iovcnt) != wtotal)
{
perror("writev");
exit(1);
}
if (io->error != 0)