summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorHarshavardhana Ranganath <harsha@gluster.com>2010-01-25 05:09:40 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-01-25 04:32:19 -0800
commit3eef8dfd1bd7775e2b5ddddb07726b4bf4f6ee22 (patch)
treecce911b04845ccd456f958e96e9045263f08d348 /extras
parente5f49cc81a976489cb7629cdf1aacf467e9e22a5 (diff)
Fix occurence of cache-size being floating point
Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 516 (cache-size should not be hard-coded to 1GB) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=516
Diffstat (limited to 'extras')
-rw-r--r--extras/volgen/CreateVolfile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/extras/volgen/CreateVolfile.py b/extras/volgen/CreateVolfile.py
index 84de1a9cd96..1517e5920dc 100644
--- a/extras/volgen/CreateVolfile.py
+++ b/extras/volgen/CreateVolfile.py
@@ -4,7 +4,7 @@ import subprocess
num_replica = 2
num_stripe = 4
#Cachesize calculator
-cache_size = "`grep 'MemTotal' /proc/meminfo | awk '{print $2 * 0.2}'`"
+cache_size = "`grep 'MemTotal' /proc/meminfo | awk '{print $2 * 0.2 / 1024}' | cut -f1 -d.`"
class CreateVolfile:
@@ -184,7 +184,7 @@ class CreateVolfile:
mount_fd.write ("volume iocache\n")
mount_fd.write (" type performance/io-cache\n")
- mount_fd.write (" option cache-size %sKB\n" % cache_size)
+ mount_fd.write (" option cache-size %sMB\n" % cache_size)
mount_fd.write (" option cache-timeout 1\n")
if self.unused:
mount_fd.write ("# option priority *.html:1,abc*:2 # Priority list for iocaching files\n")