From: Xiubo Li <xiubli@xxxxxxxxxx> At the same time rename CEPH_BLOCK to CEPH_BLOCK_SIZE. Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx> --- fs/ceph/super.c | 8 ++++---- fs/ceph/super.h | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 88d7e67130b8..ba835db374a3 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -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; } /* diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 9bc34c31831b..02115ed59ff1 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -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 */ -- 2.36.0.rc1