Add functionality to extract disk usage from FAT FS
Andrew Lunn
andrew@lunn.ch
Thu May 18 14:37:00 GMT 2006
On Thu, May 18, 2006 at 10:09:44AM -0400, Fine, Paul wrote:
+struct cyg_fs_disk_usage{
+ cyg_uint32 total_clusters;
+ cyg_uint32 free_clusters;
+ cyg_uint32 cluster_size;
+};
Clusters are very much a M$ FAT thing. I would prefer a more generic
name, eg blocks, so that the same structure can be used by other
filesystems.
Is a uint32 the correct type? Assuming 1Kbyte blocks this allows a
maximum disk size of (1 << 42) which is (1 << 12) Gbytes, ie 4Tbytes.
Yes, that will probably be O.K. for most embedded system for a while.
The only problem could be with filesystems which are not block
based. They are then likely to simply report with blocks of size 1 and
then we are limited to 4Gbytes, which is not that big.
Andrew
More information about the Ecos-patches
mailing list