[Sheepdog] [PATCH 1/4] sheepdog: remove request retry features

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Apr 21 19:32:17 CEST 2010


qemu no longer retries sending requests because collie does it.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 block/sheepdog.c |   69 ------------------------------------------------------
 1 files changed, 0 insertions(+), 69 deletions(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index c129d5d..880ea0c 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -79,9 +79,6 @@
 #define VDI_VMSTATE_MASK	0x7fffffff00000000
 #define VDI_VMSTATE_BIT 	0x4000000000000000
 
-/* should be configurable? */
-#define MAX_RETRIES 6
-
 #define SD_NR_VDIS   (1U << 24)
 #define VDI_SPACE_SHIFT   32
 #define VDI_BIT (UINT64_C(1) << 63)
@@ -248,7 +245,6 @@ struct sd_aiocb {
 
 	int ret;
 	enum aiocb_state aiocb_type;
-	int retries;
 
 	QEMUBH *bh;
 	void (*aio_done_func)(struct sd_aiocb *);
@@ -456,7 +452,6 @@ static struct sd_aiocb *sd_aio_setup(BlockDriverState *bs,
 	acb->write = write;
 	acb->bh = NULL;
 	acb->ret = 0;
-	acb->retries = 0;
 	QLIST_INIT(&acb->aioreq_head);
 	return acb;
 }
@@ -645,59 +640,6 @@ out:
 static void sd_write_bh_cb(void *p);
 static void sd_readv_bh_cb(void *p);
 
-static void retry_aiocb(struct bdrv_sd_state *s)
-{
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(s->aio_state_array); i++) {
-		struct sd_aiostate *as = &s->aio_state_array[i];
-
-		if (as->fd != -1) {
-			qemu_aio_set_fd_handler(as->fd, NULL, NULL, NULL, NULL, NULL);
-			close(as->fd);
-			as->fd = -1;
-		}
-
-		for (i = 0; i < ARRAY_SIZE(as->aio_req_list); i++) {
-			struct aio_req *aioreq = &as->aio_req_list[i];
-			struct sd_aiocb *acb = aioreq->aiocb;
-			int rest;
-
-			if (!acb)
-				continue;
-
-			rest = free_aio_req(as, aioreq);
-			if (rest)
-				continue;
-
-			/*
-			 * we are the last aioreq. Note that acb->bh
-			 * should be NULL. once acb is linked to
-			 * aio_req, acb is not in bh.
-			 */
-			if (acb->bh)
-				eprintf("bug\n");
-
-			if (++acb->retries > MAX_RETRIES) {
-				acb->ret = -EIO;
-				sd_schedule_bh(sd_aio_bh_cb, acb);
-			} else {
-				memset(acb->oid, 0, sizeof(acb->oid));
-
-				acb->aio_done_func = NULL;
-				acb->ret = 0;
-
-				QLIST_INIT(&acb->aioreq_head);
-
-				if (acb->write)
-					sd_schedule_bh(sd_write_bh_cb, acb);
-				else
-					sd_schedule_bh(sd_readv_bh_cb, acb);
-			}
-		}
-	}
-}
-
 static void aio_read_response(void *opaque)
 {
 	struct sd_obj_req hdr;
@@ -1403,11 +1345,6 @@ static void sd_write_bh_cb(void *p)
 		acb->bh = NULL;
 	}
 
-	if (acb->retries > MAX_RETRIES) {
-		ret = -EIO;
-		goto abort;
-	}
-
 	if (!s->is_current) {
 		ret = sd_create_branch(s);
 		if (ret) {
@@ -1546,11 +1483,6 @@ static void sd_readv_bh_cb(void *p)
 	qemu_bh_delete(acb->bh);
 	acb->bh = NULL;
 
-	if (acb->retries > MAX_RETRIES) {
-		ret = -EIO;
-		goto abort;
-	}
-
 	while (done != total) {
 		oid = s->inode.data_oid[idx];
 
@@ -1568,7 +1500,6 @@ static void sd_readv_bh_cb(void *p)
 		return;
 	}
 
-abort:
 	acb->ret = ret;
 	sd_schedule_bh(sd_aio_bh_cb, acb);
 	return;
-- 
1.5.6.5




More information about the sheepdog mailing list