Hi Ian
Thanx for this. This is pretty much the same as the patch I put into CVS a
few hours back.
The patch I put in handles the cases where the chunk size > Linux block size
or other way around, while I believe the patch you have here only handles the
one case.
Thanx
-- Charles
On Saturday 30 April 2005 02:07, Ian McDonnell wrote:
> Sergei,
>
> Following patch should fix 'df' stats.
>
> -imcd
>
>
> diff -Naur orig-yaffs2/yaffs_fs.c yaffs2/yaffs_fs.c
> --- orig-yaffs2/yaffs_fs.c 2004-12-16 23:39:04.000000000
> -0500
> +++ yaffs2/yaffs_fs.c 2005-04-29 10:02:34.000000000 -0400
> @@ -1206,6 +1206,7 @@
> static int yaffs_statfs(struct super_block *sb, struct statfs
> *buf)
> #endif
> {
> + // yaffs_DeviceStruct
> yaffs_Device *dev = yaffs_SuperToDevice(sb);
> T(YAFFS_TRACE_OS,(KERN_DEBUG"yaffs_statfs\n"));
>
> @@ -1214,12 +1215,13 @@
> buf->f_type = YAFFS_MAGIC;
> buf->f_bsize = sb->s_blocksize;
> buf->f_namelen = 255;
> - buf->f_blocks = (dev->endBlock - dev->startBlock + 1) *
> YAFFS_CHUNKS_PER
> _BLOCK/
> - (sb->s_blocksize/YAFFS_BYTES_PER
> _CHUNK);
> + buf->f_blocks = ((dev->endBlock - dev->startBlock + 1) *
> + dev->nChunksPerBlock * dev->nBytesPerChunk) /
> sb->s_blocksize;
> buf->f_files = 0;
> buf->f_ffree = 0;
> buf->f_bfree = yaffs_GetNumberOfFreeChunks(dev)/
> - (sb->s_blocksize/YAFFS_BYTES_PER
> _CHUNK);
> + (sb->s_blocksize/dev->nBytesPerChunk);
> +
> buf->f_bavail = buf->f_bfree;
>
> yaffs_GrossUnlock(dev);
>
>
> _______________________________________________
> yaffs mailing list
> yaffs@stoneboat.aleph1.co.uk
> http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs