summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-pmap.c16
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c2
2 files changed, 10 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c
index 9b2954af64d..8c4174a3642 100644
--- a/xlators/mgmt/glusterd/src/glusterd-pmap.c
+++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c
@@ -27,7 +27,7 @@
#include <netinet/in.h>
-int
+static int
pmap_port_isfree (int port)
{
struct sockaddr_in sin;
@@ -155,7 +155,7 @@ pmap_registry_search (xlator_t *this, const char *brickname,
return 0;
}
-int
+static int
pmap_registry_search_by_xprt (xlator_t *this, void *xprt,
gf_pmap_port_type_t type)
{
@@ -168,10 +168,12 @@ pmap_registry_search_by_xprt (xlator_t *this, void *xprt,
for (p = pmap->last_alloc; p >= pmap->base_port; p--) {
if (!pmap->ports[p].xprt)
continue;
- if (pmap->ports[p].xprt == xprt &&
- pmap->ports[p].type == type) {
- port = p;
- break;
+ if (pmap->ports[p].xprt == xprt) {
+ if (pmap->ports[p].type == type ||
+ type == GF_PMAP_PORT_ANY) {
+ port = p;
+ break;
+ }
}
}
@@ -179,7 +181,7 @@ pmap_registry_search_by_xprt (xlator_t *this, void *xprt,
}
-char *
+static char *
pmap_registry_search_by_port (xlator_t *this, int port)
{
struct pmap_registry *pmap = NULL;
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 0a2641842aa..bbd7adcac1b 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -424,7 +424,7 @@ glusterd_rpcsvc_notify (rpcsvc_t *rpc, void *xl, rpcsvc_event_t event,
pthread_mutex_lock (&priv->xprt_lock);
list_del (&xprt->list);
pthread_mutex_unlock (&priv->xprt_lock);
- pmap_registry_remove (this, 0, NULL, GF_PMAP_PORT_NONE, xprt);
+ pmap_registry_remove (this, 0, NULL, GF_PMAP_PORT_ANY, xprt);
break;
}