[sheepdog] [PATCH 5/5] sheep: remove resume_recovery_work()

Liu Yuan namei.unix at gmail.com
Fri Jun 1 11:31:37 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

When the requested object is in sys->outstanding_req_list, the object is already
being recovered, so we don't need check this busy status and should proceed.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/group.c      |   11 -----------
 sheep/recovery.c   |   27 ---------------------------
 sheep/sdnet.c      |    5 -----
 sheep/sheep_priv.h |    2 --
 4 files changed, 45 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index 66906ca..3381b44 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -886,17 +886,6 @@ static int send_join_request(struct sd_node *ent)
 	return ret;
 }
 
-int is_access_to_busy_objects(uint64_t oid)
-{
-	struct request *req;
-
-	list_for_each_entry(req, &sys->outstanding_req_list, request_list) {
-		if (oid == req->local_oid)
-			return 1;
-	}
-	return 0;
-}
-
 void sd_join_handler(struct sd_node *joined, struct sd_node *members,
 		size_t nr_members, enum cluster_join_result result,
 		void *opaque)
diff --git a/sheep/recovery.c b/sheep/recovery.c
index 7c5d442..c076a4f 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -262,26 +262,6 @@ static void recover_object_work(struct work *work)
 		eprintf("failed to recover object %"PRIx64"\n", oid);
 }
 
-static struct recovery_work *suspended_recovery_work;
-
-void resume_recovery_work(void)
-{
-	struct recovery_work *rw;
-	uint64_t oid;
-
-	if (!suspended_recovery_work)
-		return;
-
-	rw = suspended_recovery_work;
-
-	oid =  rw->oids[rw->done];
-	if (is_access_to_busy_objects(oid))
-		return;
-
-	suspended_recovery_work = NULL;
-	queue_work(sys->recovery_wqueue, &rw->work);
-}
-
 int node_in_recovery(void)
 {
 	return !!recovering_work;
@@ -388,13 +368,6 @@ static void recover_object_main(struct work *work)
 	resume_wait_obj_requests(rw->done++);
 
 	if (rw->done < rw->count) {
-		uint64_t oid;
-		oid = rw->oids[rw->done];
-
-		if (is_access_to_busy_objects(oid)) {
-			suspended_recovery_work = rw;
-			return;
-		}
 		/* Requeue the work */
 		queue_work(sys->recovery_wqueue, &rw->work);
 		return;
diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index dd3cccc..0041077 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -126,8 +126,6 @@ static void io_op_done(struct work *work)
 		leave_cluster();
 	}
 
-	resume_recovery_work();
-
 	req_done(req);
 	return;
 }
@@ -165,11 +163,8 @@ static void gateway_op_done(struct work *work)
 		break;
 	}
 
-	resume_recovery_work();
-
 	req_done(req);
 	return;
-
 retry:
 	if (req->vnodes)
 		put_vnode_info(req->vnodes);
diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index 91621be..19a6c9c 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -244,8 +244,6 @@ void oid_to_vnodes(struct vnode_info *vnode_info, uint64_t oid, int nr_copies,
 		struct sd_vnode **vnodes);
 int get_nr_copies(struct vnode_info *vnode_info);
 
-int is_access_to_busy_objects(uint64_t oid);
-
 void resume_pending_requests(void);
 void resume_wait_epoch_requests(void);
 void resume_wait_obj_requests(uint64_t oid);
-- 
1.7.10.2




More information about the sheepdog mailing list