@@ -70,7 +70,7 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
/* fill in kstatfs */
buf->f_type = CEPH_SUPER_MAGIC; /* ?? */
- buf->f_frsize = 1 << CEPH_BLOCK_SHIFT;
+ buf->f_frsize = CEPH_BLOCK_SIZE;
/*
* By default use root quota for stats; fallback to overall filesystem
@@ -79,9 +79,9 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
*/
if (ceph_test_mount_opt(fsc, NOQUOTADF) ||
!ceph_quota_update_statfs(fsc, buf)) {
- buf->f_blocks = le64_to_cpu(st.kb) >> (CEPH_BLOCK_SHIFT-10);
- buf->f_bfree = le64_to_cpu(st.kb_avail) >> (CEPH_BLOCK_SHIFT-10);
- buf->f_bavail = le64_to_cpu(st.kb_avail) >> (CEPH_BLOCK_SHIFT-10);
+ buf->f_blocks = le64_to_cpu(st.kb) >> CEPH_4K_BLOCK_SHIFT;
+ buf->f_bfree = le64_to_cpu(st.kb_avail) >> CEPH_4K_BLOCK_SHIFT;
+ buf->f_bavail = le64_to_cpu(st.kb_avail) >> CEPH_4K_BLOCK_SHIFT;
}
/*
@@ -25,9 +25,10 @@
/* large granularity for statfs utilization stats to facilitate
* large volume sizes on 32-bit machines. */
-#define CEPH_BLOCK_SHIFT 22 /* 4 MB */
-#define CEPH_BLOCK (1 << CEPH_BLOCK_SHIFT)
+#define CEPH_BLOCK_SHIFT 22 /* 4 MB */
+#define CEPH_BLOCK_SIZE (1 << CEPH_BLOCK_SHIFT)
#define CEPH_4K_BLOCK_SHIFT 12 /* 4 KB */
+#define CEPH_4K_BLOCK_SIZE (1 << CEPH_4K_BLOCK_SHIFT)
#define CEPH_MOUNT_OPT_CLEANRECOVER (1<<1) /* auto reonnect (clean mode) after blocklisted */
#define CEPH_MOUNT_OPT_DIRSTAT (1<<4) /* `cat dirname` for stats */