diff options
Diffstat (limited to 'xlators/protocol/server/src')
-rw-r--r-- | xlators/protocol/server/src/server.c | 73 | ||||
-rw-r--r-- | xlators/protocol/server/src/server3_1-fops.c | 97 |
2 files changed, 0 insertions, 170 deletions
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 1210a807a9a..00247c1eef8 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -167,79 +167,6 @@ xdr_to_glusterfs_req (rpcsvc_request_t *req, void *arg, gfs_serialize_t sfunc) return ret; } - -#if 0 -/* - * prototype of operations function for each of mop and - * fop at server protocol level - * - * @frame: call frame pointer - * @bound_xl: the xlator that this frame is bound to - * @params: parameters dictionary - * - * to be used by protocol interpret, _not_ for exterenal reference - */ -typedef int32_t (*gf_op_t) (call_frame_t *frame, xlator_t *bould_xl, - gf_hdr_common_t *hdr, size_t hdrlen, - struct iobuf *iobuf); - - -static gf_op_t gf_fops[] = { - [GF_FOP_STAT] = server_stat, - [GF_FOP_READLINK] = server_readlink, - [GF_FOP_MKNOD] = server_mknod, - [GF_FOP_MKDIR] = server_mkdir, - [GF_FOP_UNLINK] = server_unlink, - [GF_FOP_RMDIR] = server_rmdir, - [GF_FOP_SYMLINK] = server_symlink, - [GF_FOP_RENAME] = server_rename, - [GF_FOP_LINK] = server_link, - [GF_FOP_TRUNCATE] = server_truncate, - [GF_FOP_OPEN] = server_open, - [GF_FOP_READ] = server_readv, - [GF_FOP_WRITE] = server_writev, - [GF_FOP_STATFS] = server_statfs, - [GF_FOP_FLUSH] = server_flush, - [GF_FOP_FSYNC] = server_fsync, - [GF_FOP_SETXATTR] = server_setxattr, - [GF_FOP_GETXATTR] = server_getxattr, - [GF_FOP_FGETXATTR] = server_fgetxattr, - [GF_FOP_FSETXATTR] = server_fsetxattr, - [GF_FOP_REMOVEXATTR] = server_removexattr, - [GF_FOP_OPENDIR] = server_opendir, - [GF_FOP_FSYNCDIR] = server_fsyncdir, - [GF_FOP_ACCESS] = server_access, - [GF_FOP_CREATE] = server_create, - [GF_FOP_FTRUNCATE] = server_ftruncate, - [GF_FOP_FSTAT] = server_fstat, - [GF_FOP_LK] = server_lk, - [GF_FOP_LOOKUP] = server_lookup, - [GF_FOP_READDIR] = server_readdir, - [GF_FOP_READDIRP] = server_readdirp, - [GF_FOP_INODELK] = server_inodelk, - [GF_FOP_FINODELK] = server_finodelk, - [GF_FOP_ENTRYLK] = server_entrylk, - [GF_FOP_FENTRYLK] = server_fentrylk, - [GF_FOP_CHECKSUM] = server_checksum, - [GF_FOP_RCHECKSUM] = server_rchecksum, - [GF_FOP_XATTROP] = server_xattrop, - [GF_FOP_FXATTROP] = server_fxattrop, - [GF_FOP_SETATTR] = server_setattr, - [GF_FOP_FSETATTR] = server_fsetattr, - [GF_FOP_SETDENTS] = server_setdents, - [GF_FOP_GETDENTS] = server_getdents, - [GF_FOP_LOCK_NOTIFY] = server_lock_notify, - [GF_FOP_LOCK_FNOTIFY] = server_lock_fnotify, -}; - -static gf_op_t gf_cbks[] = { - [GF_CBK_FORGET] = server_forget, - [GF_CBK_RELEASE] = server_release, - [GF_CBK_RELEASEDIR] = server_releasedir -}; - -#endif - int server_fd (xlator_t *this) { diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index 825e66c3c0b..1cf4e0ded33 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -1258,34 +1258,6 @@ server_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } int -server_checksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, - uint8_t *fchecksum, uint8_t *dchecksum) -{ - gfs3_checksum_rsp rsp = {0,}; - rpcsvc_request_t *req = NULL; - - req = frame->local; - - rsp.gfs_id = req->gfs_id; - rsp.op_ret = op_ret; - rsp.op_errno = gf_errno_to_error (op_errno); - - if (op_ret >= 0) { - rsp.fchecksum.fchecksum_val = (char *)fchecksum; - rsp.fchecksum.fchecksum_len = NAME_MAX; - rsp.dchecksum.dchecksum_val = (char *)dchecksum; - rsp.dchecksum.dchecksum_len = NAME_MAX; - } - - server_submit_reply (frame, req, &rsp, NULL, 0, NULL, - xdr_serialize_checksum_rsp); - - return 0; -} - - -int server_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, uint8_t *strong_checksum) @@ -1777,32 +1749,6 @@ err: } int -server_checksum_resume (call_frame_t *frame, xlator_t *bound_xl) -{ - server_state_t *state = NULL; - int op_ret = 0; - int op_errno = 0; - - state = CALL_STATE (frame); - - if (state->resolve.op_ret != 0) { - op_ret = state->resolve.op_ret; - op_errno = state->resolve.op_errno; - goto err; - } - - STACK_WIND (frame, server_checksum_cbk, bound_xl, - bound_xl->fops->checksum, &state->loc, state->flags); - - return 0; -err: - server_checksum_cbk (frame, NULL, frame->this, state->resolve.op_ret, - state->resolve.op_errno, NULL, NULL); - - return 0; -} - -int server_lk_resume (call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; @@ -4536,48 +4482,6 @@ out: return 0; } -int -server_checksum (rpcsvc_request_t *req) -{ - server_state_t *state = NULL; - server_connection_t *conn = NULL; - call_frame_t *frame = NULL; - gfs3_checksum_req args = {0,}; - char path[SERVER_PATH_MAX] = {0,}; - - if (!req) - return 0; - - conn = req->conn->trans->xl_private; - - args.path = path; - if (!xdr_to_checksum_req (req->msg[0], &args)) { - //failed to decode msg; - req->rpc_err = GARBAGE_ARGS; - goto out; - } - - frame = get_frame_from_request (req); - if (!frame) { - // something wrong, mostly insufficient memory - req->rpc_err = GARBAGE_ARGS; /* TODO */ - goto out; - } - - state = CALL_STATE (frame); - - state->resolve.type = RESOLVE_MAY; - state->resolve.path = gf_strdup (args.path); - state->resolve.gen = args.gen; - state->resolve.ino = args.ino; - state->flags = args.flag; - - resolve_and_resume (frame, server_checksum_resume); -out: - return 0; -} - - int server_rchecksum (rpcsvc_request_t *req) @@ -4808,7 +4712,6 @@ rpcsvc_actor_t glusterfs3_1_fop_actors[] = { [GFS3_OP_FINODELK] = { "FINODELK", GFS3_OP_FINODELK, server_finodelk, NULL, NULL }, [GFS3_OP_ENTRYLK] = { "ENTRYLK", GFS3_OP_ENTRYLK, server_entrylk, NULL, NULL }, [GFS3_OP_FENTRYLK] = { "FENTRYLK", GFS3_OP_FENTRYLK, server_fentrylk, NULL, NULL }, - [GFS3_OP_CHECKSUM] = { "CHECKSUM", GFS3_OP_CHECKSUM, server_checksum, NULL, NULL }, [GFS3_OP_XATTROP] = { "XATTROP", GFS3_OP_XATTROP, server_xattrop, NULL, NULL }, [GFS3_OP_FXATTROP] = { "FXATTROP", GFS3_OP_FXATTROP, server_fxattrop, NULL, NULL }, [GFS3_OP_FGETXATTR] = { "FGETXATTR", GFS3_OP_FGETXATTR, server_fgetxattr, NULL, NULL }, |