This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Add functionality to extract disk usage from FAT FS


> -----Original Message-----
> From: Andrew Lunn [mailto:andrew@lunn.ch]
> Sent: Thursday, May 18, 2006 10:37 AM
> To: Fine, Paul
> Cc: 'ecos-patches@ecos.sourceware.org'
> Subject: Re: Add functionality to extract disk usage from FAT FS
> 
> 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


Andrew, 

Is this what you think is more appropriate?

struct cyg_fs_disk_usage{
  cyg_uint64 total_blocks;
  cyg_uint64 free_blocks;
  cyg_uint32 block_size;
};


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]