diff options
author | Anand Avati <avati@gluster.com> | 2010-02-22 10:59:40 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-02-22 08:51:44 -0800 |
commit | af2f208ff4f40e44069ede605a5e21148de053de (patch) | |
tree | c4d97c1bbb76e7bb88550a39918bdec8b36260e3 /libglusterfs/src/common-utils.c | |
parent | a6f0dca7cd348b2a428b2583ebcfc80425213d5c (diff) |
common-utils: gf_log2 handles 0 input
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 583 (filesystem access hangs while deleting large files)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=583
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r-- | libglusterfs/src/common-utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 7b5e02a344c..31727adf813 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -58,11 +58,11 @@ struct dnscache6 { int -gf_log2 (unsigned long x) +log_base2 (unsigned long x) { int val = 0; - while (x != 1) { + while (x > 1) { x /= 2; val++; } |