[Devel] [PATCH] fix of sim_statfs

Mishin Dmitry dim at sw.ru
Wed Dec 28 04:50:54 PST 2005


Patch from Dmitry (dim@), issue found by BJMG:
 - fixed statfs over simfs with enabled LBD

-- 
Thanks,
Dmitry.
-------------- next part --------------
--- ./fs/simfs.c.statfs	2005-12-13 16:15:01.000000000 +0300
+++ ./fs/simfs.c	2005-12-28 15:42:37.000000000 +0300
@@ -122,6 +122,7 @@ static int sim_statfs(struct super_block
 {
 	int err;
 	struct super_block *lsb;
+	struct kstatfs statbuf;
 
 	err = 0;
 	if (sb->s_op != &sim_super_ops)
@@ -131,11 +132,17 @@ static int sim_statfs(struct super_block
 
 	err = -ENOSYS;
 	if (lsb && lsb->s_op && lsb->s_op->statfs)
-		err = lsb->s_op->statfs(lsb, (struct kstatfs *)buf);
+		err = lsb->s_op->statfs(lsb, &statbuf);
 	if (err)
 		goto out;
 
-	quota_get_stat(sb, (struct kstatfs *)buf);
+	quota_get_stat(sb, &statbuf);
+
+	buf->f_files    = statbuf.f_files;
+	buf->f_ffree    = statbuf.f_ffree;
+	buf->f_blocks   = statbuf.f_blocks;
+	buf->f_bfree    = statbuf.f_bfree;
+	buf->f_bavail   = statbuf.f_bavail;
 out:
 	return err;
 }


More information about the Devel mailing list