summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server.h
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2017-12-22 13:12:42 +0530
committerAmar Tumballi <amarts@redhat.com>2018-01-19 22:48:39 +0530
commit303cc2b54797bc5371be742543ccb289010c92f2 (patch)
treecf383488d0edff81b012b5e908f8ebca7affaea3 /xlators/protocol/server/src/server.h
parent9eefff096fd9b54120e4347b6b00f10a6c502cf4 (diff)
protocol: make on-wire-change of protocol using new XDR definition.
With this patchset, some major things are changed in XDR, mainly: * Naming: Instead of gfs3/gfs4 settle for gfx_ for xdr structures * add iattx as a separate structure, and add conversion methods * the *_rsp structure is now changed, and is also reduced in number (ie, no need for different strucutes if it is similar to other response). * use proper XDR methods for sending dict on wire. Also, with the change of xdr structure, there are changes needed outside of xlator protocol layer to handle these properly. Mainly because the abstraction was broken to support 0-copy RDMA with payload for write and read FOP. This made transport layer know about the xdr payload, hence with the change of xdr payload structure, transport layer needed to know about the change. Updates #384 Change-Id: I1448fbe9deab0a1b06cb8351f2f37488cefe461f Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/server.h')
-rw-r--r--xlators/protocol/server/src/server.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h
index 70af9fdecd3..fe407689ceb 100644
--- a/xlators/protocol/server/src/server.h
+++ b/xlators/protocol/server/src/server.h
@@ -58,6 +58,28 @@
free (_req->xdata.xdata_val); \
} while (0)
+#define CPD4_REQ_FIELD(v, f) ((v)->compound_req_v2_u.compound_##f##_req)
+#define CPD4_RSP_FIELD(v, f) ((v)->compound_rsp_v2_u.compound_##f##_rsp)
+
+#define SERVER4_COMMON_RSP_CLEANUP(rsp, fop, i) \
+ do { \
+ compound_rsp_v2 *this_rsp = NULL; \
+ this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
+ gfx_common_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp, fop); \
+ \
+ GF_FREE (_this_rsp->xdata.pairs.pairs_val); \
+ } while (0)
+
+#define SERVER4_FOP_RSP_CLEANUP(rsp, fop, i, rsp_type) \
+ do { \
+ compound_rsp_v2 *this_rsp = NULL; \
+ this_rsp = &rsp->compound_rsp_array.compound_rsp_array_val[i]; \
+ gfx_##rsp_type##_rsp *_this_rsp = &CPD4_RSP_FIELD(this_rsp, fop); \
+ \
+ GF_FREE (_this_rsp->xdata.pairs.pairs_val); \
+ } while (0)
+
+
typedef enum {
INTERNAL_LOCKS = 1,
POSIX_LOCKS = 2,
@@ -196,6 +218,11 @@ struct _server_state {
lock_migration_info_t locklist;
/* required for compound fops */
gfs3_compound_req req;
+ /* TODO: having xdr definition here
+ is not a good idea, but not taking
+ up the functionality right now */
+ gfx_compound_req req_v2;
+
/* last length till which iovec for compound
* writes was processed */
int write_length;
@@ -233,16 +260,6 @@ int gf_server_check_getxattr_cmd (call_frame_t *frame, const char *name);
void
forget_inode_if_no_dentry (inode_t *inode);
-int
-unserialize_req_locklist (gfs3_setactivelk_req *req,
- lock_migration_info_t *lmi);
-
-int
-serialize_rsp_dirent (gf_dirent_t *entries, gfs3_readdir_rsp *rsp);
-
-int
-serialize_rsp_direntp (gf_dirent_t *entries, gfs3_readdirp_rsp *rsp);
-
server_ctx_t*
server_ctx_get (client_t *client, xlator_t *xlator);
#endif /* !_SERVER_H */