diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 39 | 
1 files changed, 8 insertions, 31 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index e2ab6d38bab..c7edefc03c8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2843,41 +2843,18 @@ glusterd_is_defrag_on (glusterd_volinfo_t *volinfo)          return (volinfo->defrag != NULL);  } -int -glusterd_is_replace_running (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *brickinfo) +gf_boolean_t +glusterd_is_rb_ongoing (glusterd_volinfo_t *volinfo)  { -        int ret = 0; -        char *src_hostname = NULL; -        char *brick_hostname = NULL; - -        if (volinfo->src_brick) { -                src_hostname = gf_strdup (volinfo->src_brick->hostname); -                if (!src_hostname) { -                        ret = -1; -                        goto out; -                } -        } else { -                gf_log ("glusterd", GF_LOG_DEBUG, -                        "replace brick is not running"); -                goto out; -        } +        GF_ASSERT (volinfo); +        gf_boolean_t    ongoing = _gf_false; -        brick_hostname = gf_strdup (brickinfo->hostname); -        if (!brick_hostname) { -                ret = -1; -                goto out; -        } -        if (!glusterd_is_local_addr (src_hostname) && !glusterd_is_local_addr (brick_hostname)) { -                if (glusterd_is_rb_started (volinfo) || glusterd_is_rb_paused (volinfo)) -                        ret = -1; +        if (glusterd_is_rb_started (volinfo) +            || glusterd_is_rb_paused (volinfo)) { +                ongoing = _gf_true;          } -out: -        if (src_hostname) -                GF_FREE (src_hostname); -        if (brick_hostname) -                GF_FREE (brick_hostname); -        return ret; +        return ongoing;  }  int  | 
