qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, vsementsov@virtuozzo.com,
	qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com
Subject: [PATCH 1/6] block: bdrv_co_do_pwrite_zeroes: 64 bit 'bytes' parameter
Date: Wed, 20 Nov 2019 15:03:14 +0100	[thread overview]
Message-ID: <20191120140319.1505-2-kwolf@redhat.com> (raw)
In-Reply-To: <20191120140319.1505-1-kwolf@redhat.com>

bdrv_co_do_pwrite_zeroes() can already cope with maximum request sizes
by calling the driver in a loop until everything is done. Make the small
remaining change that is necessary to let it accept a 64 bit byte count.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/io.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/block/io.c b/block/io.c
index f75777f5ea..003f4ea38c 100644
--- a/block/io.c
+++ b/block/io.c
@@ -42,7 +42,7 @@
 
 static void bdrv_parent_cb_resize(BlockDriverState *bs);
 static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs,
-    int64_t offset, int bytes, BdrvRequestFlags flags);
+    int64_t offset, int64_t bytes, BdrvRequestFlags flags);
 
 static void bdrv_parent_drained_begin(BlockDriverState *bs, BdrvChild *ignore,
                                       bool ignore_bds_parents)
@@ -1730,7 +1730,7 @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child,
 }
 
 static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs,
-    int64_t offset, int bytes, BdrvRequestFlags flags)
+    int64_t offset, int64_t bytes, BdrvRequestFlags flags)
 {
     BlockDriver *drv = bs->drv;
     QEMUIOVector qiov;
@@ -1760,7 +1760,7 @@ static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs,
     assert(max_write_zeroes >= bs->bl.request_alignment);
 
     while (bytes > 0 && !ret) {
-        int num = bytes;
+        int num = MIN(bytes, BDRV_REQUEST_MAX_BYTES);
 
         /* Align request.  Block drivers can expect the "bulk" of the request
          * to be aligned, and that unaligned requests do not cross cluster
-- 
2.20.1



  reply	other threads:[~2019-11-20 14:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 14:03 [PATCH for-4.2? 0/6] block: Fix resize (extending) of short overlays Kevin Wolf
2019-11-20 14:03 ` Kevin Wolf [this message]
2019-11-20 14:14   ` [PATCH 1/6] block: bdrv_co_do_pwrite_zeroes: 64 bit 'bytes' parameter Eric Blake
2019-11-20 14:27   ` Vladimir Sementsov-Ogievskiy
2019-11-20 16:18   ` Alberto Garcia
2019-11-20 14:03 ` [PATCH 2/6] block: truncate: Don't make backing file data visible Kevin Wolf
2019-11-20 14:20   ` Eric Blake
2019-11-20 14:47   ` Vladimir Sementsov-Ogievskiy
2019-11-20 15:12     ` Kevin Wolf
2019-11-20 18:01   ` Vladimir Sementsov-Ogievskiy
2019-11-25 11:06     ` Kevin Wolf
2019-11-20 14:03 ` [PATCH 3/6] iotests: Add qemu_io_log() Kevin Wolf
2019-11-20 14:26   ` Eric Blake
2019-11-20 14:49   ` Vladimir Sementsov-Ogievskiy
2019-11-20 14:03 ` [PATCH 4/6] iotests: Fix timeout in run_job() Kevin Wolf
2019-11-20 14:29   ` Eric Blake
2019-11-20 14:51   ` Vladimir Sementsov-Ogievskiy
2019-11-20 14:03 ` [PATCH 5/6] iotests: Support job-complete " Kevin Wolf
2019-11-20 14:46   ` Eric Blake
2019-11-20 14:56   ` Vladimir Sementsov-Ogievskiy
2019-11-20 14:03 ` [PATCH 6/6] iotests: Test committing to short backing file Kevin Wolf
2019-11-20 14:52   ` Eric Blake
2019-11-20 15:41   ` Vladimir Sementsov-Ogievskiy
2019-11-20 16:11     ` Kevin Wolf
2019-11-20 16:29       ` Vladimir Sementsov-Ogievskiy
2019-11-20 16:10   ` Vladimir Sementsov-Ogievskiy
2019-11-20 15:49 ` [PATCH for-4.2? 0/6] block: Fix resize (extending) of short overlays Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191120140319.1505-2-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).