summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/rpc-drc.h
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/rpc-lib/src/rpc-drc.h')
-rw-r--r--rpc/rpc-lib/src/rpc-drc.h96
1 files changed, 46 insertions, 50 deletions
diff --git a/rpc/rpc-lib/src/rpc-drc.h b/rpc/rpc-lib/src/rpc-drc.h
index cd9e2c73d32..1fd1e5e24ef 100644
--- a/rpc/rpc-lib/src/rpc-drc.h
+++ b/rpc/rpc-lib/src/rpc-drc.h
@@ -19,83 +19,79 @@
/* per-client cache structure */
struct drc_client {
- uint32_t ref;
- union gf_sock_union sock_union;
- /* pointers to the cache */
- struct rb_table *rbtree;
- /* no. of ops currently cached */
- uint32_t op_count;
- struct list_head client_list;
+ uint32_t ref;
+ union gf_sock_union sock_union;
+ /* pointers to the cache */
+ struct rb_table *rbtree;
+ /* no. of ops currently cached */
+ uint32_t op_count;
+ struct list_head client_list;
};
struct drc_cached_op {
- drc_op_state_t state;
- uint32_t xid;
- int prognum;
- int progversion;
- int procnum;
- rpc_transport_msg_t msg;
- drc_client_t *client;
- struct list_head client_list;
- struct list_head global_list;
- int32_t ref;
+ drc_op_state_t state;
+ uint32_t xid;
+ int prognum;
+ int progversion;
+ int procnum;
+ rpc_transport_msg_t msg;
+ drc_client_t *client;
+ struct list_head client_list;
+ struct list_head global_list;
+ int32_t ref;
};
/* global drc definitions */
-enum drc_status {
- DRC_UNINITIATED,
- DRC_INITIATED
-};
+enum drc_status { DRC_UNINITIATED, DRC_INITIATED };
typedef enum drc_status drc_status_t;
struct drc_globals {
- /* allocator must be the first member since
- * it is used so in gf_libavl_allocator
- */
- struct libavl_allocator allocator;
- drc_type_t type;
- /* configurable size parameter */
- uint32_t global_cache_size;
- drc_lru_factor_t lru_factor;
- gf_lock_t lock;
- drc_status_t status;
- uint32_t op_count;
- uint64_t cache_hits;
- uint64_t intransit_hits;
- struct mem_pool *mempool;
- struct list_head cache_head;
- uint32_t client_count;
- struct list_head clients_head;
+ /* allocator must be the first member since
+ * it is used so in gf_libavl_allocator
+ */
+ struct libavl_allocator allocator;
+ drc_type_t type;
+ /* configurable size parameter */
+ uint32_t global_cache_size;
+ drc_lru_factor_t lru_factor;
+ gf_lock_t lock;
+ drc_status_t status;
+ uint32_t op_count;
+ uint64_t cache_hits;
+ uint64_t intransit_hits;
+ struct mem_pool *mempool;
+ struct list_head cache_head;
+ uint32_t client_count;
+ struct list_head clients_head;
};
int
-rpcsvc_need_drc (rpcsvc_request_t *req);
+rpcsvc_need_drc(rpcsvc_request_t *req);
drc_cached_op_t *
-rpcsvc_drc_lookup (rpcsvc_request_t *req);
+rpcsvc_drc_lookup(rpcsvc_request_t *req);
int
-rpcsvc_send_cached_reply (rpcsvc_request_t *req, drc_cached_op_t *reply);
+rpcsvc_send_cached_reply(rpcsvc_request_t *req, drc_cached_op_t *reply);
int
-rpcsvc_cache_reply (rpcsvc_request_t *req, struct iobref *iobref,
- struct iovec *rpchdr, int rpchdrcount,
- struct iovec *proghdr, int proghdrcount,
- struct iovec *payload, int payloadcount);
+rpcsvc_cache_reply(rpcsvc_request_t *req, struct iobref *iobref,
+ struct iovec *rpchdr, int rpchdrcount, struct iovec *proghdr,
+ int proghdrcount, struct iovec *payload, int payloadcount);
int
-rpcsvc_cache_request (rpcsvc_request_t *req);
+rpcsvc_cache_request(rpcsvc_request_t *req);
int32_t
-rpcsvc_drc_priv (rpcsvc_drc_globals_t *drc);
+rpcsvc_drc_priv(rpcsvc_drc_globals_t *drc);
int
-rpcsvc_drc_init (rpcsvc_t *svc, dict_t *options);
+rpcsvc_drc_init(rpcsvc_t *svc, dict_t *options);
int
-rpcsvc_drc_deinit (rpcsvc_t *svc);
+rpcsvc_drc_deinit(rpcsvc_t *svc);
int
-rpcsvc_drc_reconfigure (rpcsvc_t *svc, dict_t *options);
+rpcsvc_drc_reconfigure(rpcsvc_t *svc, dict_t *options);
#endif /* RPC_DRC_H */