Faking dense files...

Besides that this reservation was not supposed to be for large amounts, only for relatively small numbers of blocks to avoid fragmentation, and it was meant to be done without user interaction.

Reserving large amounts of blocks is strictly contrary to the goals of an OS. This can only fail, because if every app always uses the upper bound for reservation before any actual operation, resources will seem exhausted a lot earlier before anything is really exhausted.

If you used more and smaller files instead of one big, you could more easily spread over more discs avoiding the race. Maybe it could be arranged more easily that the initial files could be consumed before the later files fill the space, e.g. you could wait for space to become available for the later files. If there is a point in time, where you need more disk space than available, then no trick will help you over the fact that you need more discs.

This is no filesystem problem, it is an application problem to handle resources properly, and an administration problem to provide enough resources.

Bernd Strieder

Reply to
Bernd Strieder
Loading thread data ...

In an embedded system that must not fail, most people grab all the resources their app needs at once. If it fails to get them, it would fail eventually anyway ... better to fail quickly.

So the best solution I have seen here is to partition your disk. Make one partition just for your data collection app and big enough for a worst case chunk of data. Only your app should access that partition, other apps can use the dynamic part of the disk. This partition is essentially a preallocated file and can have a normal file system on top of it so your current app will work just fine. And the reservation allocation is done once at partition making time, after that file creation and updating if normal disk fast.

Regards, Steve

Reply to
Steve Calfee

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.