diff options
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/src/cli-rpc-ops.c | 27 | 
1 files changed, 23 insertions, 4 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index ccd3b560ac4..d2372ef1483 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -3238,8 +3238,7 @@ out:  }  int -print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict, -                              int32_t list_count) +print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict)  {          char             *path          = NULL;          char             *default_sl    = NULL; @@ -3250,6 +3249,7 @@ print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict,          quota_limits_t   limits         = {0, };          quota_limits_t  *size_limits    = NULL;          int32_t          type           = 0; +        int32_t          success_count  = 0;          GF_ASSERT (frame); @@ -3313,7 +3313,25 @@ print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict,                  goto out;          } -        if (list_count == 0) { +        LOCK (&local->lock); +        { +                ret = dict_get_int32 (gd_rsp_dict, "quota-list-success-count", +                                      &success_count); +                if (ret) +                        success_count = 0; + +                ret = dict_set_int32 (gd_rsp_dict, +                                      "quota-list-success-count", +                                      success_count + 1); +        } +        UNLOCK (&local->lock); +        if (ret) { +                gf_log ("cli", GF_LOG_ERROR, "Failed to set " +                        "quota-list-success-count in dict"); +                goto out; +        } + +        if (success_count == 0) {                  if (!(global_state->mode & GLUSTER_MODE_XML)) {                          print_quota_list_header (type);                  } else { @@ -3418,7 +3436,8 @@ cli_quotad_getlimit_cbk (struct rpc_req *req, struct iovec *iov,                                  "unserialize req-buffer to dictionary");                          goto out;                  } -                print_quota_list_from_quotad (frame, dict, list_count); + +                print_quota_list_from_quotad (frame, dict);          }  out:  | 
