diff options
author | Anand Avati <avati@gluster.com> | 2010-08-13 06:04:35 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-08-13 04:41:32 -0700 |
commit | 752cb30f695963befd95e0db1d56113c6cce976e (patch) | |
tree | beb60cf59a83cc872d5e2624aca6f130cbbd027a /xlators | |
parent | b2925e78a54e1aab7e2a06d40127c59cc922cf1b (diff) |
portmap: crash fix while getting registry pointer
Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1346 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1346
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-pmap.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c index 76ad72987..12e43ca31 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) |