From 752cb30f695963befd95e0db1d56113c6cce976e Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Fri, 13 Aug 2010 06:04:35 +0000 Subject: portmap: crash fix while getting registry pointer Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati BUG: 1346 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1346 --- xlators/mgmt/glusterd/src/glusterd-pmap.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-pmap.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c index 76ad7298764..12e43ca3119 100644 --- a/xlators/mgmt/glusterd/src/glusterd-pmap.c +++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c @@ -106,14 +106,11 @@ pmap_registry_get (xlator_t *this) int pmap_registry_search (xlator_t *this, const char *brickname) { - glusterd_conf_t *priv = NULL; struct pmap_registry *pmap = NULL; int p = 0; int port = 0; - priv = this->private; - - pmap = priv->pmap; + pmap = pmap_registry_get (this); for (p = pmap->base_port; p < 65535; p++) { if (strcmp (pmap->ports[p].brickname, brickname) == 0) { @@ -129,14 +126,11 @@ pmap_registry_search (xlator_t *this, const char *brickname) int pmap_registry_alloc (xlator_t *this) { - glusterd_conf_t *priv = NULL; struct pmap_registry *pmap = NULL; int p = 0; int port = 0; - priv = this->private; - - pmap = priv->pmap; + pmap = pmap_registry_get (this); for (p = pmap->base_port; p < 65535; p++) { if (pmap->ports[p].used) @@ -157,14 +151,10 @@ pmap_registry_alloc (xlator_t *this) int pmap_registry_bind (xlator_t *this, int port, const char *brickname) { - glusterd_conf_t *priv = NULL; struct pmap_registry *pmap = NULL; int p = 0; - - priv = this->private; - - pmap = priv->pmap; + pmap = pmap_registry_get (this); pmap->ports[p].used = 1; if (pmap->ports[p].brickname) -- cgit