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, pbonzini@redhat.com, eblake@redhat.com,
	stefanha@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v2 31/31] block: Remove bdrv_aio_readv/writev/flush()
Date: Fri, 16 Jun 2017 19:37:16 +0200	[thread overview]
Message-ID: <1497634636-20230-32-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1497634636-20230-1-git-send-email-kwolf@redhat.com>

These functions are unused now.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/io.c            | 171 --------------------------------------------------
 block/trace-events    |   3 -
 include/block/block.h |   8 ---
 3 files changed, 182 deletions(-)

diff --git a/block/io.c b/block/io.c
index faca3fa..eab72b6 100644
--- a/block/io.c
+++ b/block/io.c
@@ -34,14 +34,6 @@
 
 #define NOT_DONE 0x7fffffff /* used while emulated sync operation in progress */
 
-static BlockAIOCB *bdrv_co_aio_prw_vector(BdrvChild *child,
-                                          int64_t offset,
-                                          QEMUIOVector *qiov,
-                                          BdrvRequestFlags flags,
-                                          BlockCompletionFunc *cb,
-                                          void *opaque,
-                                          bool is_write);
-static void coroutine_fn bdrv_co_do_rw(void *opaque);
 static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs,
     int64_t offset, int count, BdrvRequestFlags flags);
 
@@ -2075,28 +2067,6 @@ int bdrv_readv_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos)
 /**************************************************************/
 /* async I/Os */
 
-BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num,
-                           QEMUIOVector *qiov, int nb_sectors,
-                           BlockCompletionFunc *cb, void *opaque)
-{
-    trace_bdrv_aio_readv(child->bs, sector_num, nb_sectors, opaque);
-
-    assert(nb_sectors << BDRV_SECTOR_BITS == qiov->size);
-    return bdrv_co_aio_prw_vector(child, sector_num << BDRV_SECTOR_BITS, qiov,
-                                  0, cb, opaque, false);
-}
-
-BlockAIOCB *bdrv_aio_writev(BdrvChild *child, int64_t sector_num,
-                            QEMUIOVector *qiov, int nb_sectors,
-                            BlockCompletionFunc *cb, void *opaque)
-{
-    trace_bdrv_aio_writev(child->bs, sector_num, nb_sectors, opaque);
-
-    assert(nb_sectors << BDRV_SECTOR_BITS == qiov->size);
-    return bdrv_co_aio_prw_vector(child, sector_num << BDRV_SECTOR_BITS, qiov,
-                                  0, cb, opaque, true);
-}
-
 void bdrv_aio_cancel(BlockAIOCB *acb)
 {
     qemu_aio_ref(acb);
@@ -2129,147 +2099,6 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb)
 }
 
 /**************************************************************/
-/* async block device emulation */
-
-typedef struct BlockRequest {
-    union {
-        /* Used during read, write, trim */
-        struct {
-            int64_t offset;
-            int bytes;
-            int flags;
-            QEMUIOVector *qiov;
-        };
-        /* Used during ioctl */
-        struct {
-            int req;
-            void *buf;
-        };
-    };
-    BlockCompletionFunc *cb;
-    void *opaque;
-
-    int error;
-} BlockRequest;
-
-typedef struct BlockAIOCBCoroutine {
-    BlockAIOCB common;
-    BdrvChild *child;
-    BlockRequest req;
-    bool is_write;
-    bool need_bh;
-    bool *done;
-} BlockAIOCBCoroutine;
-
-static const AIOCBInfo bdrv_em_co_aiocb_info = {
-    .aiocb_size         = sizeof(BlockAIOCBCoroutine),
-};
-
-static void bdrv_co_complete(BlockAIOCBCoroutine *acb)
-{
-    if (!acb->need_bh) {
-        bdrv_dec_in_flight(acb->common.bs);
-        acb->common.cb(acb->common.opaque, acb->req.error);
-        qemu_aio_unref(acb);
-    }
-}
-
-static void bdrv_co_em_bh(void *opaque)
-{
-    BlockAIOCBCoroutine *acb = opaque;
-
-    assert(!acb->need_bh);
-    bdrv_co_complete(acb);
-}
-
-static void bdrv_co_maybe_schedule_bh(BlockAIOCBCoroutine *acb)
-{
-    acb->need_bh = false;
-    if (acb->req.error != -EINPROGRESS) {
-        BlockDriverState *bs = acb->common.bs;
-
-        aio_bh_schedule_oneshot(bdrv_get_aio_context(bs), bdrv_co_em_bh, acb);
-    }
-}
-
-/* Invoke bdrv_co_do_readv/bdrv_co_do_writev */
-static void coroutine_fn bdrv_co_do_rw(void *opaque)
-{
-    BlockAIOCBCoroutine *acb = opaque;
-
-    if (!acb->is_write) {
-        acb->req.error = bdrv_co_preadv(acb->child, acb->req.offset,
-            acb->req.qiov->size, acb->req.qiov, acb->req.flags);
-    } else {
-        acb->req.error = bdrv_co_pwritev(acb->child, acb->req.offset,
-            acb->req.qiov->size, acb->req.qiov, acb->req.flags);
-    }
-
-    bdrv_co_complete(acb);
-}
-
-static BlockAIOCB *bdrv_co_aio_prw_vector(BdrvChild *child,
-                                          int64_t offset,
-                                          QEMUIOVector *qiov,
-                                          BdrvRequestFlags flags,
-                                          BlockCompletionFunc *cb,
-                                          void *opaque,
-                                          bool is_write)
-{
-    Coroutine *co;
-    BlockAIOCBCoroutine *acb;
-
-    /* Matched by bdrv_co_complete's bdrv_dec_in_flight.  */
-    bdrv_inc_in_flight(child->bs);
-
-    acb = qemu_aio_get(&bdrv_em_co_aiocb_info, child->bs, cb, opaque);
-    acb->child = child;
-    acb->need_bh = true;
-    acb->req.error = -EINPROGRESS;
-    acb->req.offset = offset;
-    acb->req.qiov = qiov;
-    acb->req.flags = flags;
-    acb->is_write = is_write;
-
-    co = qemu_coroutine_create(bdrv_co_do_rw, acb);
-    bdrv_coroutine_enter(child->bs, co);
-
-    bdrv_co_maybe_schedule_bh(acb);
-    return &acb->common;
-}
-
-static void coroutine_fn bdrv_aio_flush_co_entry(void *opaque)
-{
-    BlockAIOCBCoroutine *acb = opaque;
-    BlockDriverState *bs = acb->common.bs;
-
-    acb->req.error = bdrv_co_flush(bs);
-    bdrv_co_complete(acb);
-}
-
-BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs,
-        BlockCompletionFunc *cb, void *opaque)
-{
-    trace_bdrv_aio_flush(bs, opaque);
-
-    Coroutine *co;
-    BlockAIOCBCoroutine *acb;
-
-    /* Matched by bdrv_co_complete's bdrv_dec_in_flight.  */
-    bdrv_inc_in_flight(bs);
-
-    acb = qemu_aio_get(&bdrv_em_co_aiocb_info, bs, cb, opaque);
-    acb->need_bh = true;
-    acb->req.error = -EINPROGRESS;
-
-    co = qemu_coroutine_create(bdrv_aio_flush_co_entry, acb);
-    bdrv_coroutine_enter(bs, co);
-
-    bdrv_co_maybe_schedule_bh(acb);
-    return &acb->common;
-}
-
-/**************************************************************/
 /* Coroutine block device emulation */
 
 typedef struct FlushCo {
diff --git a/block/trace-events b/block/trace-events
index 9a71c7f..752de6a 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -9,9 +9,6 @@ blk_co_preadv(void *blk, void *bs, int64_t offset, unsigned int bytes, int flags
 blk_co_pwritev(void *blk, void *bs, int64_t offset, unsigned int bytes, int flags) "blk %p bs %p offset %"PRId64" bytes %u flags %x"
 
 # block/io.c
-bdrv_aio_flush(void *bs, void *opaque) "bs %p opaque %p"
-bdrv_aio_readv(void *bs, int64_t sector_num, int nb_sectors, void *opaque) "bs %p sector_num %"PRId64" nb_sectors %d opaque %p"
-bdrv_aio_writev(void *bs, int64_t sector_num, int nb_sectors, void *opaque) "bs %p sector_num %"PRId64" nb_sectors %d opaque %p"
 bdrv_co_readv(void *bs, int64_t sector_num, int nb_sector) "bs %p sector_num %"PRId64" nb_sectors %d"
 bdrv_co_writev(void *bs, int64_t sector_num, int nb_sector) "bs %p sector_num %"PRId64" nb_sectors %d"
 bdrv_co_pwrite_zeroes(void *bs, int64_t offset, int count, int flags) "bs %p offset %"PRId64" count %d flags %#x"
diff --git a/include/block/block.h b/include/block/block.h
index 9b355e9..c2dc243 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -353,14 +353,6 @@ BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs,
                                         const char *node_name, Error **errp);
 
 /* async block I/O */
-BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num,
-                           QEMUIOVector *iov, int nb_sectors,
-                           BlockCompletionFunc *cb, void *opaque);
-BlockAIOCB *bdrv_aio_writev(BdrvChild *child, int64_t sector_num,
-                            QEMUIOVector *iov, int nb_sectors,
-                            BlockCompletionFunc *cb, void *opaque);
-BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs,
-                           BlockCompletionFunc *cb, void *opaque);
 void bdrv_aio_cancel(BlockAIOCB *acb);
 void bdrv_aio_cancel_async(BlockAIOCB *acb);
 
-- 
1.8.3.1

  parent reply	other threads:[~2017-06-16 17:38 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 17:36 [Qemu-devel] [PATCH v2 00/31] qed: Convert to coroutines Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 01/31] qed: Use bottom half to resume waiting requests Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 02/31] qed: Make qed_read_table() synchronous Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 03/31] qed: Remove callback from qed_read_table() Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 04/31] qed: Remove callback from qed_read_l2_table() Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 05/31] qed: Remove callback from qed_find_cluster() Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 06/31] qed: Make qed_read_backing_file() synchronous Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 07/31] qed: Make qed_copy_from_backing_file() synchronous Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 08/31] qed: Remove callback from qed_copy_from_backing_file() Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 09/31] qed: Make qed_write_header() synchronous Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 10/31] qed: Remove callback from qed_write_header() Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 11/31] qed: Make qed_write_table() synchronous Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 12/31] qed: Remove GenericCB Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 13/31] qed: Remove callback from qed_write_table() Kevin Wolf
2017-06-16 17:36 ` [Qemu-devel] [PATCH v2 14/31] qed: Make qed_aio_read_data() synchronous Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 15/31] qed: Make qed_aio_write_main() synchronous Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 16/31] qed: Inline qed_commit_l2_update() Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 17/31] qed: Add return value to qed_aio_write_l1_update() Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 18/31] qed: Add return value to qed_aio_write_l2_update() Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 19/31] qed: Add return value to qed_aio_write_main() Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 20/31] qed: Add return value to qed_aio_write_cow() Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 21/31] qed: Add return value to qed_aio_write_inplace/alloc() Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 22/31] qed: Add return value to qed_aio_read/write_data() Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 23/31] qed: Remove ret argument from qed_aio_next_io() Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 24/31] qed: Remove recursion in qed_aio_next_io() Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 25/31] qed: Implement .bdrv_co_readv/writev Kevin Wolf
2017-06-17 11:36   ` [Qemu-devel] [Qemu-block] " Manos Pitsidianakis
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 26/31] qed: Use CoQueue for serialising allocations Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 27/31] qed: Simplify request handling Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 28/31] qed: Use a coroutine for need_check_timer Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 29/31] qed: Add coroutine_fn to I/O path functions Kevin Wolf
2017-06-16 17:37 ` [Qemu-devel] [PATCH v2 30/31] qed: Use bdrv_co_* for coroutine_fns Kevin Wolf
2017-06-17 11:41   ` [Qemu-devel] [Qemu-block] " Manos Pitsidianakis
2017-06-16 17:37 ` Kevin Wolf [this message]
2017-06-19 15:24 ` [Qemu-devel] [PATCH v2 00/31] qed: Convert to coroutines Stefan Hajnoczi
2017-06-22 16:58 ` Kevin Wolf

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=1497634636-20230-32-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).