volume client type protocol/client option transport-type tcp # for TCP/IP transport # option transport-type ib-sdp # for Infiniband transport option remote-host 192.168.1.10 # IP address of the remote brick # option transport.socket.remote-port 24016 # option transport-type ib-verbs # for Infiniband verbs transport # option transport.ib-verbs.work-request-send-size 1048576 # option transport.ib-verbs.work-request-send-count 16 # option transport.ib-verbs.work-request-recv-size 1048576 # option transport.ib-verbs.work-request-recv-count 16 # option transport.ib-verbs.remote-port 24016 option remote-subvolume brick # name of the remote volume # option transport-timeout 30 # default value is 120seconds end-volume 255]; }; struct trie { struct trienode root; int nodecnt; size_t len; }; trie_t * trie_new () { trie_t *trie = NULL; trie = GF_CALLOC (1, sizeof (*trie), gf_common_mt_trie_trie); if (!trie) return NULL; trie->root.trie = trie; return trie; } static trienode_t * trie_subnode (trienode_t *node, int id) { trienode_t *subnode = NULL; subnode = node->subnodes[id]; if (!subnode) { subnode = GF_CALLOC (1, sizeof (*subnode), gf_common_mt_trie_node); if (!subnode) return NULL; subnode->id = id; subnode->depth = node->depth + 1; node->subnodes[id] = subnode; subnode->parent = node; subnode->trie = node->trie; node->trie->nodecnt++; } return subnode; } int trie_add (trie_t *trie, const char *dword) { trienode_t *node = NULL; int i = 0; char id = 0; trienode_t *subnode = NULL; node = &trie->root; for (i = 0; i < strlen (dword); i++) { id = dword[i]; subnode = trie_subnode (node, id); if (!subnode) return -1; node = subnode; } node->eow = 1; return 0; } static void trienode_free (trienode_t *node) { trienode_t *trav = NULL; int i = 0; for (i = 0; i < 255; i++) { trav = node->subnodes[i]; if (trav) trienode_free (trav); } GF_FREE (node->data); GF_FREE (node); } void trie_destroy (trie_t *trie) { trienode_free ((trienode_t *)trie); } void trie_destroy_bynode (trienode_t *node) { trie_destroy (node->trie); } static int trienode_walk (trienode_t *node, int (*fn)(trienode_t *node, void *data), void *data, int eowonly) { trienode_t *trav = NULL; int i = 0; int cret = 0; int ret = 0; if (!eowonly || node->eow) ret = fn (node, data); if (ret) goto out; for (i = 0; i < 255; i++) { trav = node->subnodes[i]; if (!trav) continue; cret = trienode_walk (trav, fn, data, eowonly); if (cret < 0) { ret = cret; goto out; } ret += cret; } out: return ret; } static int trie_walk (trie_t *trie, int (*fn)(trienode_t *node, void *data), void