3 /* main mpeer structs */
6 struct xseg_request *req;
17 uint32_t defer_portno;
18 struct peer_req *peer_reqs;
23 enum dispatch_reason {
29 void fail(struct peerd *peer, struct peer_req *pr);
30 void complete(struct peerd *peer, struct peer_req *pr);
31 void defer_request(struct peerd *peer, struct peer_req *pr);
32 void pending(struct peerd *peer, struct peer_req *req);
33 void log_pr(char *msg, struct peer_req *pr);
34 int canDefer(struct peerd *peer);
35 int submit_peer_req(struct peerd *peer, struct peer_req *pr);
36 struct peer_req *alloc_peer_req(struct peerd *peer);
37 void free_peer_req(struct peerd *peer, struct peer_req *pr);
38 void get_submits_stats();
39 void get_responds_stats();
41 static inline struct peerd * __get_peerd(void * custom_peerd)
43 return (struct peerd *) ((unsigned long) custom_peerd - offsetof(struct peerd, priv));
46 /********************************
47 * mandatory peer functions *
48 ********************************/
50 /* peer main function */
51 int custom_peer_init(struct peerd *peer, int argc, char *argv[]);
53 /* dispatch function that cannot block
54 * defers blocking calls to helper threads
56 int dispatch(struct peerd *peer, struct peer_req *pr, struct xseg_request *xseg,
57 enum dispatch_reason reason);