[PATCH 1/1 linux-next] fs/ceph/super.c: Undefined field set to 0 + clean-up

From: Fabian Frederick
Date: Fri Mar 07 2014 - 16:51:57 EST


-statfs(2) /undefined
-Don't recalculate f_frsize and f_bavail.
-Remove ?? comment.
-Use defined CEPH_BLOCK.
-Directly work with >> 12 for 4Kb conversions (like in dir.c)

Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
fs/ceph/super.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 10a4ccb..7ceecd8 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -67,7 +67,7 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
return err;

/* fill in kstatfs */
- buf->f_type = CEPH_SUPER_MAGIC; /* ?? */
+ buf->f_type = CEPH_SUPER_MAGIC;

/*
* express utilization in terms of large blocks to avoid
@@ -78,14 +78,14 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
* Someday, we will probably want to report a real block
* size... whatever that may mean for a network file system!
*/
- buf->f_bsize = 1 << CEPH_BLOCK_SHIFT;
- buf->f_frsize = 1 << CEPH_BLOCK_SHIFT;
- 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_bsize = CEPH_BLOCK;
+ buf->f_frsize = buf->f_bsize;
+ buf->f_blocks = le64_to_cpu(st.kb) >> 12;
+ buf->f_bfree = le64_to_cpu(st.kb_avail) >> 12;
+ buf->f_bavail = buf->f_bfree;

buf->f_files = le64_to_cpu(st.num_objects);
- buf->f_ffree = -1;
+ buf->f_ffree = 0;
buf->f_namelen = NAME_MAX;

/* leave fsid little-endian, regardless of host endianness */
--
1.8.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/