[Yaffs] statfs call reports incorrect amount of free space

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: Mikhail Ryleev
Date:  
To: yaffs
New-Topics: Re: [Yaffs] statfs call reports incorrect amount of free space
Subject: [Yaffs] statfs call reports incorrect amount of free space
Hi, all

It looks like statfs call reports incorrect amount of free space available
on device. It is off by the number of "deleted" but "uncollected" by garbage
collector files on device which can be signifficant in certain cases.
Such files belongs to "deleted" directory and while the amount of space
occupiend by data in such files is acounted as free, the entry in directory
is NOT.

The proposed fix does two things:

1: nDeletedFiles variable would correctly count the number of "deleted" but
uncollected files
2: the number of free blocks is adjusted by that value.


--- ./old/yaffs_guts.c 2005-12-19 20:02:18.000000000 -0800
+++ ./yaffs_guts.c 2005-12-20 11:54:58.000000000 -0800
@@ -2346,6 +2346,7 @@
        ("yaffs: About to finally delete object %d"
         TENDSTR), object->objectId));
     yaffs_DoGenericObjectDeletion(object);
+    object->myDev->nDeletedFiles--;
    }


}
@@ -5690,6 +5691,8 @@
nFree = yaffs_CountFreeChunks(dev);
#endif

+    nFree += dev->nDeletedFiles;
+
  /* Now count the number of dirty chunks in the cache and subtract those */


{