This is the mail archive of the ecos-patches@sources.redhat.com 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: Receive available and used space from JFFS2


Andrew Lunn wrote:

I've noticed that you used a 32 bit value for returning fs space info, this may
not be such an good idea - check an old discussion about this at
http://ecos.sourceware.org/ml/ecos-devel/2003-07/msg00031.html .
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.



On a non block based fs block size could be just set to 1.

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.


There is a lot of operations on a fs which can be covered with this interface -
some are general like the free/used sizes and the odher are fs dependent - like
set/get volume label, reserved blocks access ...


I don't like putting all of the keys and accompanying structures in fileio.h.
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.


savin



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