diff options
| author | Krutika Dhananjay <kdhananj@redhat.com> | 2012-09-21 15:38:07 +0530 | 
|---|---|---|
| committer | Anand Avati <avati@redhat.com> | 2012-09-30 14:12:01 -0700 | 
| commit | 947523a74c97b057b8bcfdf2c65943495ab118d2 (patch) | |
| tree | b733b4d8e667a84250eecdd725f438903fb11e47 /cli/src/cli.h | |
| parent | 1ee65fe16f427c48d55856879f125d8e218a5823 (diff) | |
cli: removed extra dict unrefs and memory leaks
PROBLEMS ADDRESSED:
a. The following change
      http://review.gluster.com/#change,3948
   introduces extra dict unrefs in cli.
b. There are instances of memory leak in gf_cli_*_cbk functions.
FIX:
Problem (a) is fixed by ensuring the dict is ref'd (indirectly at
the time of creation) and unref'd (in CLI_STACK_DESTROY) ONLY
once. The following is the rationale behind this approach:
   The number of refs and unrefs on dict varies across the different
   commands that use it. The cli thread MUST wait for the
   gf_cli_*_cbks to complete before the frame is destroyed. This
   rules out the need to do extra refs and unrefs in the code path.
Problem (b) is fixed by doing unref on dicts that are created for
the purpose of unserializing the response but never freed in
gf_cli_*_cbk functions.
Change-Id: I5a7431543fc8e3cac4d256f5c87d1e3c62a331be
BUG: 823081
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/3966
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'cli/src/cli.h')
| -rw-r--r-- | cli/src/cli.h | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/src/cli.h b/cli/src/cli.h index 0299220cea1..7aa2148f494 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -273,6 +273,10 @@ cli_cmd_volume_heal_options_parse (const char **words, int wordcount,                                     dict_t **options);  int +cli_cmd_volume_defrag_parse (const char **words, int wordcount, +                             dict_t **options); + +int  cli_print_brick_status (cli_volume_status_t *status);  void  | 
