]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fix statfs units
authorSage Weil <sage@newdream.net>
Tue, 8 Apr 2008 03:26:13 +0000 (20:26 -0700)
committerSage Weil <sage@newdream.net>
Tue, 8 Apr 2008 13:34:46 +0000 (06:34 -0700)
src/kernel/super.c

index a30a0965bb9454cf4ff6532c9a1c43750063e3bd..c2fa757bdca15c0f1ba1c0469cb73869eef112eb 100644 (file)
@@ -64,12 +64,14 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
        if (err < 0)
                return err;
 
+#define BLOCK_IN_KB_SHIFT  10   /* 1 MB */
+
        /* fill in kstatfs */
        buf->f_type = CEPH_SUPER_MAGIC;  /* ?? */
-       buf->f_bsize = 1 << 20;   /* 1 MB */
-       buf->f_blocks = st.f_total >> 2;
-       buf->f_bfree = st.f_free >> 2;
-       buf->f_bavail = st.f_avail >> 2;
+       buf->f_bsize = 1 << (10 + BLOCK_IN_KB_SHIFT);     /* 1 MB */
+       buf->f_blocks = st.f_total >> BLOCK_IN_KB_SHIFT;  
+       buf->f_bfree = st.f_free >> BLOCK_IN_KB_SHIFT;  
+       buf->f_bavail = st.f_avail >> BLOCK_IN_KB_SHIFT;  
        buf->f_files = st.f_objects;
        buf->f_ffree = -1;
        /* fsid? */