summaryrefslogtreecommitdiffstats
path: root/utils/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/utils.h')
-rw-r--r--utils/utils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/utils.h b/utils/utils.h
index d3b1027..ce1ef52 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -278,6 +278,18 @@ extern struct gbConf gbConf;
GB_FREE(tmp); \
} while (0)
+# define GB_RPC_CALL(op, blk, reply, rqstp, ret) \
+ do { \
+ blockResponse *resp = block_##op##_1_svc_st(blk, rqstp); \
+ if (resp) { \
+ memcpy(reply, resp, sizeof(*reply)); \
+ GB_FREE(resp); \
+ ret = true; \
+ } else { \
+ ret = false; \
+ } \
+ } while (0)
+
# define CALLOC(x) \
calloc(1, x)