~ubuntu-branches/ubuntu/wily/glusterfs/wily

« back to all changes in this revision

Viewing changes to glusterfsd/src/glusterfsd-mgmt.c

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Matthäi
  • Date: 2011-06-26 21:00:42 UTC
  • mfrom: (1.3.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110626210042-ps1aim0cwz06tkx1
Tags: 3.2.1-1
* New upstream release.
  - Refresh patch 02-spelling-error.
* Wrap dependencies.
* Merge libglusterfs0 and libglusterfs-dev package to glusterfs-common.
  Closes: #630147
* Use python-module.mk and remove useless python bytecode files.
  Closes: #630146

Show diffs side-by-side

added added

removed removed

Lines of Context:
899
899
}
900
900
 
901
901
static int
 
902
mgmt_pmap_signin2_cbk (struct rpc_req *req, struct iovec *iov, int count,
 
903
                       void *myframe)
 
904
{
 
905
        pmap_signin_rsp  rsp   = {0,};
 
906
        call_frame_t    *frame = NULL;
 
907
        int              ret   = 0;
 
908
 
 
909
        frame = myframe;
 
910
 
 
911
        if (-1 == req->rpc_status) {
 
912
                rsp.op_ret   = -1;
 
913
                rsp.op_errno = EINVAL;
 
914
                goto out;
 
915
        }
 
916
 
 
917
        ret = xdr_to_pmap_signin_rsp (*iov, &rsp);
 
918
        if (ret < 0) {
 
919
                gf_log (frame->this->name, GF_LOG_ERROR, "XDR decode error");
 
920
                rsp.op_ret   = -1;
 
921
                rsp.op_errno = EINVAL;
 
922
                goto out;
 
923
        }
 
924
 
 
925
        if (-1 == rsp.op_ret) {
 
926
                gf_log (frame->this->name, GF_LOG_ERROR,
 
927
                        "failed to register the port with glusterd");
 
928
                goto out;
 
929
        }
 
930
out:
 
931
        STACK_DESTROY (frame->root);
 
932
        return 0;
 
933
 
 
934
}
 
935
 
 
936
static int
902
937
mgmt_pmap_signin_cbk (struct rpc_req *req, struct iovec *iov, int count,
903
938
                      void *myframe)
904
939
{
905
940
        pmap_signin_rsp  rsp   = {0,};
906
941
        call_frame_t    *frame = NULL;
907
942
        int              ret   = 0;
 
943
        pmap_signin_req  pmap_req = {0, };
 
944
        cmd_args_t      *cmd_args = NULL;
 
945
        glusterfs_ctx_t *ctx      = NULL;
 
946
        char             brick_name[PATH_MAX] = {0,};
908
947
 
909
948
        frame = myframe;
910
949
 
927
966
                        "failed to register the port with glusterd");
928
967
                goto out;
929
968
        }
 
969
 
 
970
        ctx = glusterfs_ctx_get ();
 
971
        cmd_args = &ctx->cmd_args;
 
972
 
 
973
        if (!cmd_args->brick_port2) {
 
974
                /* We are done with signin process */
 
975
                goto out;
 
976
        }
 
977
 
 
978
        snprintf (brick_name, PATH_MAX, "%s.rdma", cmd_args->brick_name);
 
979
        pmap_req.port  = cmd_args->brick_port2;
 
980
        pmap_req.brick = brick_name;
 
981
 
 
982
        ret = mgmt_submit_request (&pmap_req, frame, ctx, &clnt_pmap_prog,
 
983
                                   GF_PMAP_SIGNIN, xdr_from_pmap_signin_req,
 
984
                                   mgmt_pmap_signin2_cbk);
 
985
        if (ret)
 
986
                goto out;
 
987
 
 
988
        return 0;
 
989
 
930
990
out:
931
991
 
932
992
        STACK_DESTROY (frame->root);