--- ./fs/simfs.c.simfs-quota 2007-02-12 11:43:01.000000000 +0300 +++ ./fs/simfs.c 2007-02-12 12:04:59.000000000 +0300 @@ -67,8 +67,8 @@ static void quota_get_stat(struct super_ int err; struct dq_stat qstat; struct virt_info_quota q; - long free_file, adj_file; - s64 blk, free_blk, adj_blk; + long free_file; + s64 blk, free_blk; int bsize_bits; q.super = sb; @@ -81,38 +81,21 @@ static void quota_get_stat(struct super_ free_blk = (s64)(qstat.bsoftlimit - qstat.bcurrent) >> bsize_bits; if (free_blk < 0) free_blk = 0; - /* - * In the regular case, we always set buf->f_bfree and buf->f_blocks to - * the values reported by quota. In case of real disk space shortage, - * we adjust the values. We want this adjustment to look as if the - * total disk space were reduced, not as if the usage were increased. - * -- SAW - */ - adj_blk = 0; - if (buf->f_bfree < free_blk) - adj_blk = free_blk - buf->f_bfree; - buf->f_bfree = (long)(free_blk - adj_blk); - if (free_blk < buf->f_bavail) - buf->f_bavail = (long)free_blk; /* min(f_bavail, free_blk) */ + /* This a very bad hack: just gets information + from quota, no smart adjusting */ - blk = (qstat.bsoftlimit >> bsize_bits) - adj_blk; + buf->f_bfree = (long)free_blk; + buf->f_bavail = (long)free_blk; + blk = (qstat.bsoftlimit >> bsize_bits); buf->f_blocks = blk > LONG_MAX ? LONG_MAX : blk; free_file = qstat.isoftlimit - qstat.icurrent; if (free_file < 0) free_file = 0; - if (buf->f_type == REISERFS_SUPER_MAGIC) - /* - * reiserfs doesn't initialize f_ffree and f_files values of - * kstatfs because it doesn't have an inode limit. - */ - buf->f_ffree = free_file; - adj_file = 0; - if (buf->f_ffree < free_file) - adj_file = free_file - buf->f_ffree; - buf->f_ffree = free_file - adj_file; - buf->f_files = qstat.isoftlimit - adj_file; + + buf->f_ffree = free_file; + buf->f_files = qstat.isoftlimit; } static int sim_statfs(struct super_block *sb, struct kstatfs *buf)