qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: anthony@codemonkey.ws
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 14/27] block: drop aio_multiwrite in BlockDriver
Date: Wed, 29 Feb 2012 16:17:55 +0100	[thread overview]
Message-ID: <1330528688-21996-15-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1330528688-21996-1-git-send-email-kwolf@redhat.com>

From: Paolo Bonzini <pbonzini@redhat.com>

These were never used.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c     |   23 +++--------------------
 block_int.h |    6 ------
 2 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/block.c b/block.c
index 1150437..f23eccc 100644
--- a/block.c
+++ b/block.c
@@ -2791,7 +2791,6 @@ typedef struct MultiwriteCB {
         BlockDriverCompletionFunc *cb;
         void *opaque;
         QEMUIOVector *free_qiov;
-        void *free_buf;
     } callbacks[];
 } MultiwriteCB;
 
@@ -2805,7 +2804,6 @@ static void multiwrite_user_cb(MultiwriteCB *mcb)
             qemu_iovec_destroy(mcb->callbacks[i].free_qiov);
         }
         g_free(mcb->callbacks[i].free_qiov);
-        qemu_vfree(mcb->callbacks[i].free_buf);
     }
 }
 
@@ -2862,20 +2860,11 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs,
         int merge = 0;
         int64_t oldreq_last = reqs[outidx].sector + reqs[outidx].nb_sectors;
 
-        // This handles the cases that are valid for all block drivers, namely
-        // exactly sequential writes and overlapping writes.
+        // Handle exactly sequential writes and overlapping writes.
         if (reqs[i].sector <= oldreq_last) {
             merge = 1;
         }
 
-        // The block driver may decide that it makes sense to combine requests
-        // even if there is a gap of some sectors between them. In this case,
-        // the gap is filled with zeros (therefore only applicable for yet
-        // unused space in format like qcow2).
-        if (!merge && bs->drv->bdrv_merge_requests) {
-            merge = bs->drv->bdrv_merge_requests(bs, &reqs[outidx], &reqs[i]);
-        }
-
         if (reqs[outidx].qiov->niov + reqs[i].qiov->niov + 1 > IOV_MAX) {
             merge = 0;
         }
@@ -2891,14 +2880,8 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs,
             size = (reqs[i].sector - reqs[outidx].sector) << 9;
             qemu_iovec_concat(qiov, reqs[outidx].qiov, size);
 
-            // We might need to add some zeros between the two requests
-            if (reqs[i].sector > oldreq_last) {
-                size_t zero_bytes = (reqs[i].sector - oldreq_last) << 9;
-                uint8_t *buf = qemu_blockalign(bs, zero_bytes);
-                memset(buf, 0, zero_bytes);
-                qemu_iovec_add(qiov, buf, zero_bytes);
-                mcb->callbacks[i].free_buf = buf;
-            }
+            // We should need to add any zeros between the two requests
+            assert (reqs[i].sector <= oldreq_last);
 
             // Add the second request
             qemu_iovec_concat(qiov, reqs[i].qiov, reqs[i].qiov->size);
diff --git a/block_int.h b/block_int.h
index 25aff80..bd86af0 100644
--- a/block_int.h
+++ b/block_int.h
@@ -162,12 +162,6 @@ struct BlockDriver {
      */
     int coroutine_fn (*bdrv_co_flush_to_os)(BlockDriverState *bs);
 
-    int (*bdrv_aio_multiwrite)(BlockDriverState *bs, BlockRequest *reqs,
-        int num_reqs);
-    int (*bdrv_merge_requests)(BlockDriverState *bs, BlockRequest* a,
-        BlockRequest *b);
-
-
     const char *protocol_name;
     int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset);
     int64_t (*bdrv_getlength)(BlockDriverState *bs);
-- 
1.7.6.5

  parent reply	other threads:[~2012-02-29 15:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29 15:17 [Qemu-devel] [PULL 00/27] Block patches Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 01/27] fdc: take side count into account Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 02/27] fdc: set busy bit when starting a command Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 03/27] fdc: most control commands do not generate interrupts Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 04/27] fdc: handle read-only floppies (abort early on write commands) Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 05/27] fdc: add CCR (Configuration Control Register) write register Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 06/27] block: add a transfer rate for floppy types Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 07/27] fdc: add a 'check media rate' property. Not used yet Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 08/27] fdc: check if media rate is correct before doing any transfer Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 09/27] fdc: fix seek command, which shouldn't check tracks Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 10/27] fdc: DIR (Digital Input Register) should return status of current drive Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 11/27] ide: fail I/O to empty disk Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 12/27] qcow2: Fix build with DEBUG_EXT enabled Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 13/27] block: remove unused fields in BlockDriverState Kevin Wolf
2012-02-29 15:17 ` Kevin Wolf [this message]
2012-02-29 15:17 ` [Qemu-devel] [PATCH 15/27] qcow2: Fix offset in qcow2_read_extensions Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 16/27] qcow2: Reject too large header extensions Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 17/27] qapi: Introduce blockdev-group-snapshot-sync command Kevin Wolf
2012-02-29 15:17 ` [Qemu-devel] [PATCH 18/27] QMP: Add qmp command for blockdev-group-snapshot-sync Kevin Wolf
2012-02-29 15:18 ` [Qemu-devel] [PATCH 19/27] qemu-iotests: export TEST_DIR for non-bash tests Kevin Wolf
2012-02-29 15:18 ` [Qemu-devel] [PATCH 20/27] qemu-iotests: add iotests Python module Kevin Wolf
2012-02-29 15:18 ` [Qemu-devel] [PATCH 21/27] test: add image streaming tests Kevin Wolf
2012-02-29 15:18 ` [Qemu-devel] [PATCH 22/27] qemu-iotests: Filter out DOS line endings Kevin Wolf
2012-02-29 15:18 ` [Qemu-devel] [PATCH 23/27] qemu-iotests: 026: Reduce output changes for cache=none qcow2 Kevin Wolf
2012-02-29 15:18 ` [Qemu-devel] [PATCH 24/27] qemu-iotests: Test rebase with short backing file Kevin Wolf
2012-02-29 15:18 ` [Qemu-devel] [PATCH 25/27] qemu-tool: revert cpu_get_clock() abort(3) Kevin Wolf
2012-02-29 15:18 ` [Qemu-devel] [PATCH 26/27] qemu-io: fix segment fault when the image format is qed Kevin Wolf
2012-02-29 15:18 ` [Qemu-devel] [PATCH 27/27] qemu-img: " Kevin Wolf
2012-02-29 21:06 ` [Qemu-devel] [PULL 00/27] Block patches Anthony Liguori

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=1330528688-21996-15-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /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).