From: Jeff Cody <jcody@redhat.com>
To: qemu-block@nongnu.org
Cc: peter.maydell@linaro.org, jcody@redhat.com,
qemu-devel@nongnu.org, stefanha@redhat.com
Subject: [Qemu-devel] [PULL 1/5] sheepdog: remove unused cancellation support
Date: Wed, 1 Feb 2017 00:34:36 -0500 [thread overview]
Message-ID: <20170201053440.26002-2-jcody@redhat.com> (raw)
In-Reply-To: <20170201053440.26002-1-jcody@redhat.com>
From: Paolo Bonzini <pbonzini@redhat.com>
SheepdogAIOCB is internal to sheepdog.c, hence it is never canceled.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20161129113245.32724-2-pbonzini@redhat.com
Signed-off-by: Jeff Cody <jcody@redhat.com>
---
block/sheepdog.c | 52 ----------------------------------------------------
1 file changed, 52 deletions(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 5637e0c..5fde37a 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -347,7 +347,6 @@ struct SheepdogAIOCB {
Coroutine *coroutine;
void (*aio_done_func)(SheepdogAIOCB *);
- bool cancelable;
int nr_pending;
uint32_t min_affect_data_idx;
@@ -486,7 +485,6 @@ static inline void free_aio_req(BDRVSheepdogState *s, AIOReq *aio_req)
{
SheepdogAIOCB *acb = aio_req->aiocb;
- acb->cancelable = false;
QLIST_REMOVE(aio_req, aio_siblings);
g_free(aio_req);
@@ -499,57 +497,8 @@ static void coroutine_fn sd_finish_aiocb(SheepdogAIOCB *acb)
qemu_aio_unref(acb);
}
-/*
- * Check whether the specified acb can be canceled
- *
- * We can cancel aio when any request belonging to the acb is:
- * - Not processed by the sheepdog server.
- * - Not linked to the inflight queue.
- */
-static bool sd_acb_cancelable(const SheepdogAIOCB *acb)
-{
- BDRVSheepdogState *s = acb->common.bs->opaque;
- AIOReq *aioreq;
-
- if (!acb->cancelable) {
- return false;
- }
-
- QLIST_FOREACH(aioreq, &s->inflight_aio_head, aio_siblings) {
- if (aioreq->aiocb == acb) {
- return false;
- }
- }
-
- return true;
-}
-
-static void sd_aio_cancel(BlockAIOCB *blockacb)
-{
- SheepdogAIOCB *acb = (SheepdogAIOCB *)blockacb;
- BDRVSheepdogState *s = acb->common.bs->opaque;
- AIOReq *aioreq, *next;
-
- if (sd_acb_cancelable(acb)) {
- /* Remove outstanding requests from failed queue. */
- QLIST_FOREACH_SAFE(aioreq, &s->failed_aio_head, aio_siblings,
- next) {
- if (aioreq->aiocb == acb) {
- free_aio_req(s, aioreq);
- }
- }
-
- assert(acb->nr_pending == 0);
- if (acb->common.cb) {
- acb->common.cb(acb->common.opaque, -ECANCELED);
- }
- sd_finish_aiocb(acb);
- }
-}
-
static const AIOCBInfo sd_aiocb_info = {
.aiocb_size = sizeof(SheepdogAIOCB),
- .cancel_async = sd_aio_cancel,
};
static SheepdogAIOCB *sd_aio_setup(BlockDriverState *bs, QEMUIOVector *qiov,
@@ -569,7 +518,6 @@ static SheepdogAIOCB *sd_aio_setup(BlockDriverState *bs, QEMUIOVector *qiov,
acb->nb_sectors = nb_sectors;
acb->aio_done_func = NULL;
- acb->cancelable = true;
acb->coroutine = qemu_coroutine_self();
acb->ret = 0;
acb->nr_pending = 0;
--
2.9.3
next prev parent reply other threads:[~2017-02-01 5:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 5:34 [Qemu-devel] [PULL 0/5] Block patches Jeff Cody
2017-02-01 5:34 ` Jeff Cody [this message]
2017-02-01 5:34 ` [Qemu-devel] [PULL 2/5] sheepdog: reorganize coroutine flow Jeff Cody
2017-02-01 5:34 ` [Qemu-devel] [PULL 3/5] sheepdog: do not use BlockAIOCB Jeff Cody
2017-02-01 5:34 ` [Qemu-devel] [PULL 4/5] sheepdog: simplify inflight_aio_head management Jeff Cody
2017-02-01 5:34 ` [Qemu-devel] [PULL 5/5] sheepdog: reorganize check for overlapping requests Jeff Cody
2017-02-02 15:14 ` [Qemu-devel] [PULL 0/5] Block patches Peter Maydell
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=20170201053440.26002-2-jcody@redhat.com \
--to=jcody@redhat.com \
--cc=peter.maydell@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.