This is the mail archive of the
mailing list for the eCos project.
Re: Receive available and used space from JFFS2
- From: Savin Zlobec <savin at elatec dot si>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: ecos-patches at sources dot redhat dot com
- Date: Tue, 22 Jun 2004 10:13:18 +0200
- Subject: Re: Receive available and used space from JFFS2
- References: <40D6F45F.email@example.com> <20040621164433.GK2031@lunn.ch>
Andrew Lunn wrote:
On a non block based fs block size could be just set to 1.
I've noticed that you used a 32 bit value for returning fs space info,
not be such an good idea - check an old discussion about this at
I think a better way would be to return a structure with free/used space
in blocks + block size.
You are assuming a block based storage media. romfs does not have
blocks. Although jffs2 uses flash blocks, the files themselves are not
block based. Only ramfs and fat use blocks.
I think i might change the interface to pass a cyg_uint64 instead.
There is a lot of operations on a fs which can be covered with this
It would also be nice to put the keys (+ common structures)
in a separate file - like it is done with IO config_keys.h.
Humm. I think Nick put the origional 3 keys in fileio.h. He should
decide if they should be moved out to a seperate header file.
some are general like the free/used sizes and the odher are fs dependent
set/get volume label, reserved blocks access ...
I don't like putting all of the keys and accompanying structures in
I would propose a separate file which could hold general keys and specific
fs keys offsets like:
#define FS_INFO_CONF 1
#define FS_INFO_ACCESS 2
#define FS_INFO_GETCWD 3
#define FS_INFO_FREESIZE 4
#define FS_INFO_USEDSIZE 5
#define FS_INFO_ROMFS_KEYS_START 0x100
#define FS_INFO_RAMFS_KEYS_START 0x200
#define FS_INFO_JFFS2_KEYS_START 0x300
#define FS_INFO_FATFS_KEYS_START 0x400
This way all of the fs specific data would go into fs specific header files.