On Fri, 2009-12-18 at 18:03 +0800, JiSheng Zhang wrote: > Hi Charles, > > 2009/12/16 Charles Manning : > > On Wednesday 16 December 2009 16:36:02 JiSheng Zhang wrote: > >> 2009/12/16 JiSheng Zhang : > >> > Hi list, > >> > > >> > First mount an empty partition, then cp some files to the mnt dir then > >> > run "df", and then delete all the files, then run "df" again. df > >> > report this time is wrong. It seems that the chunks occupied by > >> > unlinked files aren't recycled until needed. > >> > > >> > Is this a bug or characteristic? > > > > I don't see that problem. > > > > root@linux-dual-head:/opt/y/cvs/yaffs2# mount -t yaffs2 /dev/mtdblock0 /mnt > > root@linux-dual-head:/opt/y/cvs/yaffs2# df > > Filesystem 1K-blocks Used Available Use% Mounted on > > /dev/mtdblock0 65536 1152 64384 2% /mnt > > Here used blocks is 1152. > > > root@linux-dual-head:/opt/y/cvs/yaffs2# cp * /mnt > > root@linux-dual-head:/opt/y/cvs/yaffs2# df > > Filesystem 1K-blocks Used Available Use% Mounted on > > /dev/mtdblock0 65536 5860 59676 9% /mnt > > root@linux-dual-head:/opt/y/cvs/yaffs2# rm /mnt/* > > root@linux-dual-head:/opt/y/cvs/yaffs2# df > > Filesystem 1K-blocks Used Available Use% Mounted on > > /dev/mtdblock0 65536 1156 64380 2% /mnt > > Here used blocks is 1156. So there are 4 blocks lost. Would that be the root directory? I wonder if: mount -t yaffs2 /dev/mtdblock0 /mnt df ls -ld /mnt cp * /mnt df ls -ld /mnt rm /mnt/* df ls -ld /mnt would show that the root directory uses the 4 blocks to hold the directory entries for the files copied in. Is there code to garbage collect directories when the entries are deleted? > Regards, > Jisheng > > _______________________________________________ > yaffs mailing list > yaffs@lists.aleph1.co.uk > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs -- Peter Barada Logic Product Development, Inc.