[sheepdog] [PATCH v10 08/19] sheep: get_request() for deferred response

Hitoshi Mitake mitake.hitoshi at gmail.com
Mon Jun 2 17:09:02 CEST 2014


With the new function, response message to clients can be deferred
safely without blocking the main thread.

Cc: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Tested-by: Valerio Pachera <sirio81 at gmail.com>
Cc: Alessandro Bolgia <alessandro at extensys.it>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/request.c    | 5 +++++
 sheep/sheep_priv.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/sheep/request.c b/sheep/request.c
index 4aa928e..6972f10 100644
--- a/sheep/request.c
+++ b/sheep/request.c
@@ -709,6 +709,11 @@ main_fn void put_request(struct request *req)
 	}
 }
 
+main_fn void get_request(struct request *req)
+{
+	refcount_inc(&req->refcnt);
+}
+
 static void rx_work(struct work *work)
 {
 	struct client_info *ci = container_of(work, struct client_info,
diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index d66ae1e..da0acb2 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -425,6 +425,7 @@ int objlist_cache_insert(uint64_t oid);
 void objlist_cache_remove(uint64_t oid);
 
 void put_request(struct request *req);
+void get_request(struct request *req);
 
 int sheep_bnode_writer(uint64_t oid, void *mem, unsigned int len,
 		       uint64_t offset, uint32_t flags, int copies,
-- 
1.9.1




More information about the sheepdog mailing list