diff options
author | Michael Tokarev <mjt@tls.msk.ru> | 2012-03-10 16:54:23 +0400 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2012-06-11 23:07:44 +0400 |
commit | 3d9b49254f893f2a3739400e536de25db1cdc5f9 (patch) | |
tree | 3d08dfabe658baba0b89a5ba675d903c3cdbbcb6 /block/qed.c | |
parent | 2278a69e7020d86a8c73a28474e7709d3e7d5081 (diff) | |
download | qemu-3d9b49254f893f2a3739400e536de25db1cdc5f9.zip qemu-3d9b49254f893f2a3739400e536de25db1cdc5f9.tar.gz qemu-3d9b49254f893f2a3739400e536de25db1cdc5f9.tar.bz2 |
consolidate qemu_iovec_memset{,_skip}() into single function and use existing iov_memset()
This patch combines two functions into one, and replaces
the implementation with already existing iov_memset() from
iov.c.
The new prototype of qemu_iovec_memset():
size_t qemu_iovec_memset(qiov, size_t offset, int fillc, size_t bytes)
It is different from former qemu_iovec_memset_skip(), and
I want to make other functions to be consistent with it
too: first how much to skip, second what, and 3rd how many
of it. It also returns actual number of bytes filled in,
which may be less than the requested `bytes' if qiov is
smaller than offset+bytes, in the same way iov_memset()
does.
While at it, use utility function iov_memset() from
iov.h in posix-aio-compat.c, where qiov was used.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'block/qed.c')
-rw-r--r-- | block/qed.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/qed.c b/block/qed.c index 30a31f9..40bdb53 100644 --- a/block/qed.c +++ b/block/qed.c @@ -736,7 +736,7 @@ static void qed_read_backing_file(BDRVQEDState *s, uint64_t pos, /* Zero all sectors if reading beyond the end of the backing file */ if (pos >= backing_length || pos + qiov->size > backing_length) { - qemu_iovec_memset(qiov, 0, qiov->size); + qemu_iovec_memset(qiov, 0, 0, qiov->size); } /* Complete now if there are no backing file sectors to read */ @@ -1251,7 +1251,7 @@ static void qed_aio_read_data(void *opaque, int ret, /* Handle zero cluster and backing file reads */ if (ret == QED_CLUSTER_ZERO) { - qemu_iovec_memset(&acb->cur_qiov, 0, acb->cur_qiov.size); + qemu_iovec_memset(&acb->cur_qiov, 0, 0, acb->cur_qiov.size); qed_aio_next_io(acb, 0); return; } else if (ret != QED_CLUSTER_FOUND) { |