[sheepdog] [PATCH] sheep: remove outstanding_req_list

Christoph Hellwig hch at infradead.org
Sat Jun 2 16:04:29 CEST 2012


As a fallout we can use requeue_request in gateway_op_done now.

Signed-off-by: Christoph Hellwig <hch at lst.de>

---
 sheep/group.c      |    1 -
 sheep/sdnet.c      |   28 +++++++++-------------------
 sheep/sheep_priv.h |    1 -
 3 files changed, 9 insertions(+), 21 deletions(-)

Index: sheepdog/sheep/group.c
===================================================================
--- sheepdog.orig/sheep/group.c	2012-06-02 15:32:44.768063952 +0200
+++ sheepdog/sheep/group.c	2012-06-02 15:51:23.220092595 +0200
@@ -1061,7 +1061,6 @@ int create_cluster(int port, int64_t zon
 	INIT_LIST_HEAD(&sys->pending_list);
 	INIT_LIST_HEAD(&sys->leave_list);
 
-	INIT_LIST_HEAD(&sys->outstanding_req_list);
 	INIT_LIST_HEAD(&sys->consistent_obj_list);
 	INIT_LIST_HEAD(&sys->blocking_conn_list);
 
Index: sheepdog/sheep/sdnet.c
===================================================================
--- sheepdog.orig/sheep/sdnet.c	2012-06-02 15:32:44.772063958 +0200
+++ sheepdog/sheep/sdnet.c	2012-06-02 15:52:48.024094764 +0200
@@ -20,7 +20,7 @@
 
 #include "sheep_priv.h"
 
-static void queue_request(struct request *req);
+static void requeue_request(struct request *req);
 
 static int is_access_local(struct request *req, uint64_t oid)
 {
@@ -117,8 +117,6 @@ static void io_op_done(struct work *work
 {
 	struct request *req = container_of(work, struct request, work);
 
-	list_del(&req->request_list);
-
 	if (req->rp.result == SD_RES_EIO) {
 		req->rp.result = SD_RES_NETWORK_ERROR;
 
@@ -135,8 +133,6 @@ static void gateway_op_done(struct work
 	struct request *req = container_of(work, struct request, work);
 	struct sd_req *hdr = &req->rq;
 
-	list_del(&req->request_list);
-
 	switch (req->rp.result) {
 	case SD_RES_OLD_NODE_VER:
 		if (req->rp.epoch > sys->epoch) {
@@ -170,9 +166,7 @@ static void gateway_op_done(struct work
 	req_done(req);
 	return;
 retry:
-	if (req->vnodes)
-		put_vnode_info(req->vnodes);
-	queue_request(req);
+	requeue_request(req);
 }
 
 static void local_op_done(struct work *work)
@@ -249,14 +243,6 @@ static int check_request_in_recovery(str
 	return 0;
 }
 
-static void requeue_request(struct request *req)
-{
-	list_del(&req->request_list);
-	if (req->vnodes)
-		put_vnode_info(req->vnodes);
-	queue_request(req);
-}
-
 void resume_wait_epoch_requests(void)
 {
 	struct request *req, *t;
@@ -345,7 +331,6 @@ static void queue_io_request(struct requ
 		if (check_request_in_recovery(req) < 0)
 			return;
 	}
-	list_add_tail(&req->request_list, &sys->outstanding_req_list);
 
 	req->work.fn = do_io_request;
 	req->work.done = io_op_done;
@@ -370,8 +355,6 @@ static void queue_gateway_request(struct
 			return;
 	}
 
-	list_add_tail(&req->request_list, &sys->outstanding_req_list);
-
 	if (need_consistency_check(req))
 		set_consistency_check(req);
 
@@ -464,6 +447,13 @@ done:
 	req_done(req);
 }
 
+static void requeue_request(struct request *req)
+{
+	if (req->vnodes)
+		put_vnode_info(req->vnodes);
+	queue_request(req);
+}
+
 static void client_incref(struct client_info *ci);
 static void client_decref(struct client_info *ci);
 
Index: sheepdog/sheep/sheep_priv.h
===================================================================
--- sheepdog.orig/sheep/sheep_priv.h	2012-06-02 15:32:44.772063958 +0200
+++ sheepdog/sheep/sheep_priv.h	2012-06-02 15:51:30.188092770 +0200
@@ -119,7 +119,6 @@ struct cluster_info {
 
 	DECLARE_BITMAP(vdi_inuse, SD_NR_VDIS);
 
-	struct list_head outstanding_req_list;
 	struct list_head consistent_obj_list;
 	struct list_head blocking_conn_list;
 



More information about the sheepdog mailing list