fsync() for FAT file system

Sebastian Huber sebastian.huber at embedded-brains.de
Fri May 4 14:57:22 UTC 2012

On 05/04/2012 04:51 PM, Thomas Doerfler wrote:
> Sebastian,
> if I get this code right, it actually parses each buffer of the _volume_
> and ensures it is synced, so this is FAR from optimal ;-)

If I understand the fat_get_fat_cluster() correctly it follows the chain of 
clusters of the file (initial value is fat_fd->cln).

> Syncing the device will defintivly be an improvement. For large files,
> this will not be worse than syncing the file-specific buffers.
> Another area: For really "syncing" the file, would it make sense to also
> ensure that the file/directory information is updated as far as possible
> to make sure the FS contains as much information as possible to read
> back the file (in case of a device or power loss)?

It does actually this kind of operation in msdos_file_sync() (unfortunately 
without a synchronization request to the cache).  This should be fixed as well.

Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

More information about the devel mailing list