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

Cc: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp>
Tested-by: Valerio Pachera <siri...@gmail.com>
Cc: Alessandro Bolgia <alessan...@extensys.it>
Signed-off-by: Hitoshi Mitake <mitake.hito...@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

-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to