summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/common-utils.c4
-rw-r--r--libglusterfs/src/common-utils.h2
-rw-r--r--xlators/performance/io-cache/src/io-cache.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 7b5e02a34..31727adf8 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++;
}
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 05acfd83d..9c1c93ebf 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -332,7 +332,7 @@ int gf_lockfd (int fd);
int gf_unlockfd (int fd);
int get_checksum_for_file (int fd, uint32_t *checksum);
-int gf_log2 (unsigned long x);
+int log_base2 (unsigned long x);
#endif /* _COMMON_UTILS_H */
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 020a9f162..16d29109a 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -1462,7 +1462,7 @@ init (xlator_t *this)
ret = 0;
ctx = this->ctx;
- ioc_log2_page_size = gf_log2 (ctx->page_size);
+ ioc_log2_page_size = log_base2 (ctx->page_size);
out:
if (ret == -1) {