diff options
| author | Anand V. Avati <avati@amp.gluster.com> | 2009-03-10 00:27:52 +0530 | 
|---|---|---|
| committer | Anand V. Avati <avati@amp.gluster.com> | 2009-03-10 00:33:58 +0530 | 
| commit | 2323b92d9b7b679c84cab64697fc715434e28ac9 (patch) | |
| tree | 996935179df8afe0747b34295e47091d54ec0eaf /xlators/protocol/client/src/client-protocol.c | |
| parent | ae378b63c0ae93d8077d250de6a035b92bac8697 (diff) | |
failover to any active transport when requested channel is not connected
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/protocol/client/src/client-protocol.c')
| -rw-r--r-- | xlators/protocol/client/src/client-protocol.c | 28 | 
1 files changed, 28 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index 2a636a18fef..95a5db89590 100644 --- a/xlators/protocol/client/src/client-protocol.c +++ b/xlators/protocol/client/src/client-protocol.c @@ -61,6 +61,34 @@ static gf_op_t gf_mops[];  static gf_op_t gf_cbks[]; +transport_t * +client_channel (xlator_t *this, int id) +{ +        transport_t              *trans = NULL; +        client_conf_t            *conf = NULL; +        int                       i = 0; +        struct client_connection *conn = NULL; + +        conf = this->private; + +        trans = conf->transport[id]; +        conn = trans->xl_private; + +        if (conn->connected == 1) +                goto ret; + +        for (i = 0; i < CHANNEL_MAX; i++) { +                trans = conf->transport[i]; +                conn = trans->xl_private; +                if (conn->connected == 1) +                        break; +        } + +ret: +        return trans; +} + +  static ino_t  this_ino_get_from_inode (inode_t *inode, xlator_t *this)  {  | 
