Signed-off-by: Christoph Hellwig <[email protected]>

---
 sheep/group.c      |    2 +-
 sheep/sdnet.c      |   16 ++++++----------
 sheep/sheep_priv.h |    5 ++---
 3 files changed, 9 insertions(+), 14 deletions(-)

Index: sheepdog/sheep/group.c
===================================================================
--- sheepdog.orig/sheep/group.c 2012-05-08 15:44:28.448690303 +0200
+++ sheepdog/sheep/group.c      2012-05-08 15:44:29.708690290 +0200
@@ -635,7 +635,7 @@ static void __sd_notify_done(struct even
        if (has_process_main(req->op))
                memcpy(req->data, msg->data, msg->rsp.data_length);
        memcpy(&req->rp, &msg->rsp, sizeof(req->rp));
-       req->done(req);
+       req_done(req);
 }
 
 void sd_notify_handler(struct sd_node *sender, void *msg, size_t msg_len)
Index: sheepdog/sheep/sdnet.c
===================================================================
--- sheepdog.orig/sheep/sdnet.c 2012-05-08 15:44:28.448690303 +0200
+++ sheepdog/sheep/sdnet.c      2012-05-08 15:44:29.708690290 +0200
@@ -144,7 +144,7 @@ static void io_op_done(struct work *work
        resume_pending_requests();
        resume_recovery_work();
 
-       req->done(req);
+       req_done(req);
        return;
 
 retry:
@@ -168,7 +168,7 @@ static void local_op_done(struct work *w
                                                 &req->rp, req->data);
        }
 
-       req->done(req);
+       req_done(req);
 }
 
 static void cluster_op_done(struct work *work)
@@ -265,8 +265,7 @@ static void queue_request(struct request
        if (!req->op) {
                eprintf("invalid opcode %d\n", hdr->opcode);
                rsp->result = SD_RES_INVALID_PARMS;
-               req->done(req);
-               return;
+               goto done;
        }
 
        dprintf("%x\n", hdr->opcode);
@@ -328,8 +327,7 @@ static void queue_request(struct request
        } else {
                eprintf("unknown operation %d\n", hdr->opcode);
                rsp->result = SD_RES_SYSTEM_ERROR;
-               req->done(req);
-               return;
+               goto done;
        }
        list_del(&req->r_wlist);
 
@@ -338,7 +336,7 @@ static void queue_request(struct request
        process_request_event_queues();
        return;
 done:
-       req->done(req);
+       req_done(req);
 }
 
 static void client_incref(struct client_info *ci);
@@ -383,7 +381,7 @@ static void free_request(struct request
        free(req);
 }
 
-static void req_done(struct request *req)
+void req_done(struct request *req)
 {
        int dead = 0;
        struct client_info *ci = req->ci;
@@ -475,8 +473,6 @@ static void client_rx_handler(struct cli
        else
                req->rp.data_length = hdr->data_length;
 
-       req->done = req_done;
-
        dprintf("connection from: %s:%d\n", ci->conn.ipstr, ci->conn.port);
        queue_request(req);
 }
Index: sheepdog/sheep/sheep_priv.h
===================================================================
--- sheepdog.orig/sheep/sheep_priv.h    2012-05-08 15:44:28.448690303 +0200
+++ sheepdog/sheep/sheep_priv.h 2012-05-08 15:44:29.712690290 +0200
@@ -65,8 +65,6 @@ struct client_info {
 struct request;
 struct vnode_info;
 
-typedef void (*req_end_t) (struct request *);
-
 struct request {
        struct event_struct cev;
        struct sd_req rq;
@@ -88,7 +86,6 @@ struct request {
        struct vnode_info *vnodes;
        int check_consistency;
 
-       req_end_t done;
        struct work work;
 };
 
@@ -314,6 +311,8 @@ int init_objlist_cache(void);
 int objlist_cache_rb_remove(struct rb_root *root, uint64_t oid);
 int check_and_insert_objlist_cache(uint64_t oid);
 
+void req_done(struct request *req);
+
 /* Operations */
 
 struct sd_op_template *get_sd_op(uint8_t opcode);

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to